| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 6 | 6 |
| 7 #include "src/crankshaft/x64/lithium-codegen-x64.h" | 7 #include "src/crankshaft/x64/lithium-codegen-x64.h" |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 2940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2951 | 2951 |
| 2952 // Do not transform the receiver to object for builtins. | 2952 // Do not transform the receiver to object for builtins. |
| 2953 __ testb(FieldOperand(kScratchRegister, | 2953 __ testb(FieldOperand(kScratchRegister, |
| 2954 SharedFunctionInfo::kNativeByteOffset), | 2954 SharedFunctionInfo::kNativeByteOffset), |
| 2955 Immediate(1 << SharedFunctionInfo::kNativeBitWithinByte)); | 2955 Immediate(1 << SharedFunctionInfo::kNativeBitWithinByte)); |
| 2956 __ j(not_equal, &receiver_ok, dist); | 2956 __ j(not_equal, &receiver_ok, dist); |
| 2957 } | 2957 } |
| 2958 | 2958 |
| 2959 // Normal function. Replace undefined or null with global receiver. | 2959 // Normal function. Replace undefined or null with global receiver. |
| 2960 __ CompareRoot(receiver, Heap::kNullValueRootIndex); | 2960 __ CompareRoot(receiver, Heap::kNullValueRootIndex); |
| 2961 __ j(equal, &global_object, Label::kNear); | 2961 __ j(equal, &global_object, dist); |
| 2962 __ CompareRoot(receiver, Heap::kUndefinedValueRootIndex); | 2962 __ CompareRoot(receiver, Heap::kUndefinedValueRootIndex); |
| 2963 __ j(equal, &global_object, Label::kNear); | 2963 __ j(equal, &global_object, dist); |
| 2964 | 2964 |
| 2965 // The receiver should be a JS object. | 2965 // The receiver should be a JS object. |
| 2966 Condition is_smi = __ CheckSmi(receiver); | 2966 Condition is_smi = __ CheckSmi(receiver); |
| 2967 DeoptimizeIf(is_smi, instr, DeoptimizeReason::kSmi); | 2967 DeoptimizeIf(is_smi, instr, DeoptimizeReason::kSmi); |
| 2968 __ CmpObjectType(receiver, FIRST_JS_RECEIVER_TYPE, kScratchRegister); | 2968 __ CmpObjectType(receiver, FIRST_JS_RECEIVER_TYPE, kScratchRegister); |
| 2969 DeoptimizeIf(below, instr, DeoptimizeReason::kNotAJavaScriptObject); | 2969 DeoptimizeIf(below, instr, DeoptimizeReason::kNotAJavaScriptObject); |
| 2970 | 2970 |
| 2971 __ jmp(&receiver_ok, Label::kNear); | 2971 __ jmp(&receiver_ok, dist); |
| 2972 __ bind(&global_object); | 2972 __ bind(&global_object); |
| 2973 __ movp(receiver, FieldOperand(function, JSFunction::kContextOffset)); | 2973 __ movp(receiver, FieldOperand(function, JSFunction::kContextOffset)); |
| 2974 __ movp(receiver, ContextOperand(receiver, Context::NATIVE_CONTEXT_INDEX)); | 2974 __ movp(receiver, ContextOperand(receiver, Context::NATIVE_CONTEXT_INDEX)); |
| 2975 __ movp(receiver, ContextOperand(receiver, Context::GLOBAL_PROXY_INDEX)); | 2975 __ movp(receiver, ContextOperand(receiver, Context::GLOBAL_PROXY_INDEX)); |
| 2976 | 2976 |
| 2977 __ bind(&receiver_ok); | 2977 __ bind(&receiver_ok); |
| 2978 } | 2978 } |
| 2979 | 2979 |
| 2980 | 2980 |
| 2981 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { | 2981 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { |
| (...skipping 2447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5429 __ bind(deferred->exit()); | 5429 __ bind(deferred->exit()); |
| 5430 __ bind(&done); | 5430 __ bind(&done); |
| 5431 } | 5431 } |
| 5432 | 5432 |
| 5433 #undef __ | 5433 #undef __ |
| 5434 | 5434 |
| 5435 } // namespace internal | 5435 } // namespace internal |
| 5436 } // namespace v8 | 5436 } // namespace v8 |
| 5437 | 5437 |
| 5438 #endif // V8_TARGET_ARCH_X64 | 5438 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |