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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // when called as functions (without an explicit receiver object). | 130 // when called as functions (without an explicit receiver object). |
131 if (info()->MustReplaceUndefinedReceiverWithGlobalProxy()) { | 131 if (info()->MustReplaceUndefinedReceiverWithGlobalProxy()) { |
132 Label ok; | 132 Label ok; |
133 StackArgumentsAccessor args(rsp, scope()->num_parameters()); | 133 StackArgumentsAccessor args(rsp, scope()->num_parameters()); |
134 __ movp(rcx, args.GetReceiverOperand()); | 134 __ movp(rcx, args.GetReceiverOperand()); |
135 | 135 |
136 __ CompareRoot(rcx, Heap::kUndefinedValueRootIndex); | 136 __ CompareRoot(rcx, Heap::kUndefinedValueRootIndex); |
137 __ j(not_equal, &ok, Label::kNear); | 137 __ j(not_equal, &ok, Label::kNear); |
138 | 138 |
139 __ movp(rcx, GlobalObjectOperand()); | 139 __ movp(rcx, GlobalObjectOperand()); |
140 __ movp(rcx, FieldOperand(rcx, GlobalObject::kGlobalProxyOffset)); | 140 __ movp(rcx, FieldOperand(rcx, JSGlobalObject::kGlobalProxyOffset)); |
141 | 141 |
142 __ movp(args.GetReceiverOperand(), rcx); | 142 __ movp(args.GetReceiverOperand(), rcx); |
143 | 143 |
144 __ bind(&ok); | 144 __ bind(&ok); |
145 } | 145 } |
146 } | 146 } |
147 | 147 |
148 info()->set_prologue_offset(masm_->pc_offset()); | 148 info()->set_prologue_offset(masm_->pc_offset()); |
149 if (NeedsEagerFrame()) { | 149 if (NeedsEagerFrame()) { |
150 DCHECK(!frame_is_built_); | 150 DCHECK(!frame_is_built_); |
(...skipping 3129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3280 DeoptimizeIf(is_smi, instr, Deoptimizer::kSmi); | 3280 DeoptimizeIf(is_smi, instr, Deoptimizer::kSmi); |
3281 __ CmpObjectType(receiver, FIRST_SPEC_OBJECT_TYPE, kScratchRegister); | 3281 __ CmpObjectType(receiver, FIRST_SPEC_OBJECT_TYPE, kScratchRegister); |
3282 DeoptimizeIf(below, instr, Deoptimizer::kNotAJavaScriptObject); | 3282 DeoptimizeIf(below, instr, Deoptimizer::kNotAJavaScriptObject); |
3283 | 3283 |
3284 __ jmp(&receiver_ok, Label::kNear); | 3284 __ jmp(&receiver_ok, Label::kNear); |
3285 __ bind(&global_object); | 3285 __ bind(&global_object); |
3286 __ movp(receiver, FieldOperand(function, JSFunction::kContextOffset)); | 3286 __ movp(receiver, FieldOperand(function, JSFunction::kContextOffset)); |
3287 __ movp(receiver, | 3287 __ movp(receiver, |
3288 Operand(receiver, | 3288 Operand(receiver, |
3289 Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); | 3289 Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
3290 __ movp(receiver, FieldOperand(receiver, GlobalObject::kGlobalProxyOffset)); | 3290 __ movp(receiver, FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); |
3291 | 3291 |
3292 __ bind(&receiver_ok); | 3292 __ bind(&receiver_ok); |
3293 } | 3293 } |
3294 | 3294 |
3295 | 3295 |
3296 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { | 3296 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { |
3297 Register receiver = ToRegister(instr->receiver()); | 3297 Register receiver = ToRegister(instr->receiver()); |
3298 Register function = ToRegister(instr->function()); | 3298 Register function = ToRegister(instr->function()); |
3299 Register length = ToRegister(instr->length()); | 3299 Register length = ToRegister(instr->length()); |
3300 Register elements = ToRegister(instr->elements()); | 3300 Register elements = ToRegister(instr->elements()); |
(...skipping 2568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5869 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5869 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5870 } | 5870 } |
5871 | 5871 |
5872 | 5872 |
5873 #undef __ | 5873 #undef __ |
5874 | 5874 |
5875 } // namespace internal | 5875 } // namespace internal |
5876 } // namespace v8 | 5876 } // namespace v8 |
5877 | 5877 |
5878 #endif // V8_TARGET_ARCH_X64 | 5878 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |