| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
| 6 | 6 |
| 7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
| 8 // | 8 // |
| 9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
| 10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
| (...skipping 2821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2832 Label done, null, function, non_function_constructor; | 2832 Label done, null, function, non_function_constructor; |
| 2833 | 2833 |
| 2834 VisitForAccumulatorValue(args->at(0)); | 2834 VisitForAccumulatorValue(args->at(0)); |
| 2835 | 2835 |
| 2836 // If the object is not a JSReceiver, we return null. | 2836 // If the object is not a JSReceiver, we return null. |
| 2837 __ JumpIfSmi(v0, &null); | 2837 __ JumpIfSmi(v0, &null); |
| 2838 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); | 2838 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
| 2839 __ GetObjectType(v0, v0, a1); // Map is now in v0. | 2839 __ GetObjectType(v0, v0, a1); // Map is now in v0. |
| 2840 __ Branch(&null, lt, a1, Operand(FIRST_JS_RECEIVER_TYPE)); | 2840 __ Branch(&null, lt, a1, Operand(FIRST_JS_RECEIVER_TYPE)); |
| 2841 | 2841 |
| 2842 // Return 'Function' for JSFunction objects. | 2842 // Return 'Function' for JSFunction and JSBoundFunction objects. |
| 2843 __ Branch(&function, eq, a1, Operand(JS_FUNCTION_TYPE)); | 2843 STATIC_ASSERT(LAST_FUNCTION_TYPE == LAST_TYPE); |
| 2844 __ Branch(&function, hs, a1, Operand(FIRST_FUNCTION_TYPE)); |
| 2844 | 2845 |
| 2845 // Check if the constructor in the map is a JS function. | 2846 // Check if the constructor in the map is a JS function. |
| 2846 Register instance_type = a2; | 2847 Register instance_type = a2; |
| 2847 __ GetMapConstructor(v0, v0, a1, instance_type); | 2848 __ GetMapConstructor(v0, v0, a1, instance_type); |
| 2848 __ Branch(&non_function_constructor, ne, instance_type, | 2849 __ Branch(&non_function_constructor, ne, instance_type, |
| 2849 Operand(JS_FUNCTION_TYPE)); | 2850 Operand(JS_FUNCTION_TYPE)); |
| 2850 | 2851 |
| 2851 // v0 now contains the constructor function. Grab the | 2852 // v0 now contains the constructor function. Grab the |
| 2852 // instance class name from there. | 2853 // instance class name from there. |
| 2853 __ lw(v0, FieldMemOperand(v0, JSFunction::kSharedFunctionInfoOffset)); | 2854 __ lw(v0, FieldMemOperand(v0, JSFunction::kSharedFunctionInfoOffset)); |
| (...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3944 reinterpret_cast<uint32_t>( | 3945 reinterpret_cast<uint32_t>( |
| 3945 isolate->builtins()->OnStackReplacement()->entry())); | 3946 isolate->builtins()->OnStackReplacement()->entry())); |
| 3946 return ON_STACK_REPLACEMENT; | 3947 return ON_STACK_REPLACEMENT; |
| 3947 } | 3948 } |
| 3948 | 3949 |
| 3949 | 3950 |
| 3950 } // namespace internal | 3951 } // namespace internal |
| 3951 } // namespace v8 | 3952 } // namespace v8 |
| 3952 | 3953 |
| 3953 #endif // V8_TARGET_ARCH_MIPS | 3954 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |