Closed Bug 846973 Opened 11 years ago Closed 11 years ago

BaselineCompiler: Change all uses of lookupProperty to be effectless

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: djvj, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

We use JSObject::lookupProperty in many places in the BaselineIC, without first checking obj->hasIdempotentProtoChain().

These should all use a helper method that does the following:
  if hasIdempotentProtoChain() is true, uses lookupProperty.
  otherwise, uses nativeLookup
Attached patch PatchSplinter Review
Attachment #720227 - Flags: review?(jdemooij)
Hm, why is this a problem for us and not a problem with JM / Ion ICs?
Comment on attachment 720227 [details] [diff] [review]
Patch

Review of attachment 720227 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/ion/BaselineIC.cpp
@@ +2381,5 @@
> +    if (obj->hasIdempotentProtoChain()) {
> +        if (!JSObject::lookupProperty(cx, obj, name, holder, shape))
> +            return false;
> +    } else {
> +        shape.set(obj->nativeLookup(cx, NameToId(name)));

I think you can just remove the "else", or if we have to keep it change it to "else if (!obj->isNative())"
Attachment #720227 - Flags: review?(jdemooij) → review+
(In reply to Jan de Mooij [:jandem] from comment #3)
> change it to "else if (!obj->isNative())"

Er, no "!", of course.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: