OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2650 // Faster code path to avoid two compares: subtract lower bound from the | 2650 // Faster code path to avoid two compares: subtract lower bound from the |
2651 // actual type and do a signed compare with the width of the type range. | 2651 // actual type and do a signed compare with the width of the type range. |
2652 __ GetObjectType(input, temp, temp2); | 2652 __ GetObjectType(input, temp, temp2); |
2653 __ Subu(temp2, temp2, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 2653 __ Subu(temp2, temp2, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
2654 __ Branch(is_false, gt, temp2, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE - | 2654 __ Branch(is_false, gt, temp2, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE - |
2655 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 2655 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
2656 } | 2656 } |
2657 | 2657 |
2658 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. | 2658 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. |
2659 // Check if the constructor in the map is a function. | 2659 // Check if the constructor in the map is a function. |
2660 __ lw(temp, FieldMemOperand(temp, Map::kConstructorOffset)); | 2660 Register instance_type = scratch1(); |
2661 DCHECK(!instance_type.is(temp)); | |
2662 DCHECK(!instance_type.is(temp2)); | |
Jakob Kummerow
2015/02/25 09:39:45
DBC: having |instance_type| and |temp2| overlap sh
| |
2663 __ GetMapConstructor(temp, temp, temp2, instance_type); | |
2661 | 2664 |
2662 // Objects with a non-function constructor have class 'Object'. | 2665 // Objects with a non-function constructor have class 'Object'. |
2663 __ GetObjectType(temp, temp2, temp2); | |
2664 if (String::Equals(class_name, isolate()->factory()->Object_string())) { | 2666 if (String::Equals(class_name, isolate()->factory()->Object_string())) { |
2665 __ Branch(is_true, ne, temp2, Operand(JS_FUNCTION_TYPE)); | 2667 __ Branch(is_true, ne, instance_type, Operand(JS_FUNCTION_TYPE)); |
2666 } else { | 2668 } else { |
2667 __ Branch(is_false, ne, temp2, Operand(JS_FUNCTION_TYPE)); | 2669 __ Branch(is_false, ne, instance_type, Operand(JS_FUNCTION_TYPE)); |
2668 } | 2670 } |
2669 | 2671 |
2670 // temp now contains the constructor function. Grab the | 2672 // temp now contains the constructor function. Grab the |
2671 // instance class name from there. | 2673 // instance class name from there. |
2672 __ lw(temp, FieldMemOperand(temp, JSFunction::kSharedFunctionInfoOffset)); | 2674 __ lw(temp, FieldMemOperand(temp, JSFunction::kSharedFunctionInfoOffset)); |
2673 __ lw(temp, FieldMemOperand(temp, | 2675 __ lw(temp, FieldMemOperand(temp, |
2674 SharedFunctionInfo::kInstanceClassNameOffset)); | 2676 SharedFunctionInfo::kInstanceClassNameOffset)); |
2675 // The class name we are testing against is internalized since it's a literal. | 2677 // The class name we are testing against is internalized since it's a literal. |
2676 // The name in the constructor is internalized because of the way the context | 2678 // The name in the constructor is internalized because of the way the context |
2677 // is booted. This routine isn't expected to work for random API-created | 2679 // is booted. This routine isn't expected to work for random API-created |
(...skipping 3353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6031 __ li(at, scope_info); | 6033 __ li(at, scope_info); |
6032 __ Push(at, ToRegister(instr->function())); | 6034 __ Push(at, ToRegister(instr->function())); |
6033 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6035 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6034 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6036 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6035 } | 6037 } |
6036 | 6038 |
6037 | 6039 |
6038 #undef __ | 6040 #undef __ |
6039 | 6041 |
6040 } } // namespace v8::internal | 6042 } } // namespace v8::internal |
OLD | NEW |