Ignore:
Timestamp:
May 11, 2009, 10:31:02 PM (16 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2009-05-11 Gavin Barraclough <[email protected]>

Reviewed by Cameron Zwarich.

Implement JIT generation for instanceof for non-objects (always returns false).
Also fixes the sequencing of the prototype and value isObject checks, to no match the spec.

0.5% progression on v8 tests overall, due to 3.5% on early-boyer.

  • jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases):
  • runtime/JSObject.cpp: (JSC::JSObject::hasInstance):
  • runtime/TypeInfo.h: (JSC::TypeInfo::TypeInfo):

LayoutTests:

2009-05-11 Gavin Barraclough <[email protected]>

Reviewed by Oliver Hunt.

Add a layout test for instanceof.

  • fast/js/instance-of-immediates-expected.txt: Added.
  • fast/js/instance-of-immediates.html: Added.
  • fast/js/resources/instance-of-immediates.js: Added. (testInstanceOf): (): (testSet):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSObject.cpp

    r43432 r43551  
    388388bool JSObject::hasInstance(ExecState* exec, JSValue value, JSValue proto)
    389389{
     390    if (!value.isObject())
     391        return false;
     392
    390393    if (!proto.isObject()) {
    391394        throwError(exec, TypeError, "instanceof called on an object with an invalid prototype property.");
    392395        return false;
    393396    }
    394 
    395     if (!value.isObject())
    396         return false;
    397397
    398398    JSObject* object = asObject(value);
Note: See TracChangeset for help on using the changeset viewer.