| Index: src/x64/codegen-x64.cc
|
| ===================================================================
|
| --- src/x64/codegen-x64.cc (revision 5085)
|
| +++ src/x64/codegen-x64.cc (working copy)
|
| @@ -5723,6 +5723,25 @@
|
| }
|
|
|
|
|
| +void CodeGenerator::GenerateIsSpecObject(ZoneList<Expression*>* args) {
|
| + // This generates a fast version of:
|
| + // (typeof(arg) === 'object' || %_ClassOf(arg) == 'RegExp' ||
|
| + // typeof(arg) == function).
|
| + // It includes undetectable objects (as opposed to IsObject).
|
| + ASSERT(args->length() == 1);
|
| + Load(args->at(0));
|
| + Result value = frame_->Pop();
|
| + value.ToRegister();
|
| + ASSERT(value.is_valid());
|
| + Condition is_smi = masm_->CheckSmi(value.reg());
|
| + destination()->false_target()->Branch(is_smi);
|
| + // Check that this is an object.
|
| + __ CmpObjectType(value.reg(), FIRST_JS_OBJECT_TYPE, kScratchRegister);
|
| + value.Unuse();
|
| + destination()->Split(above_equal);
|
| +}
|
| +
|
| +
|
| void CodeGenerator::GenerateIsFunction(ZoneList<Expression*>* args) {
|
| // This generates a fast version of:
|
| // (%_ClassOf(arg) === 'Function')
|
|
|