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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" | 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.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 3170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3181 | 3181 |
3182 // The receiver should be a JS object. | 3182 // The receiver should be a JS object. |
3183 __ test(receiver, Immediate(kSmiTagMask)); | 3183 __ test(receiver, Immediate(kSmiTagMask)); |
3184 DeoptimizeIf(equal, instr, Deoptimizer::kSmi); | 3184 DeoptimizeIf(equal, instr, Deoptimizer::kSmi); |
3185 __ CmpObjectType(receiver, FIRST_SPEC_OBJECT_TYPE, scratch); | 3185 __ CmpObjectType(receiver, FIRST_SPEC_OBJECT_TYPE, scratch); |
3186 DeoptimizeIf(below, instr, Deoptimizer::kNotAJavaScriptObject); | 3186 DeoptimizeIf(below, instr, Deoptimizer::kNotAJavaScriptObject); |
3187 | 3187 |
3188 __ jmp(&receiver_ok, Label::kNear); | 3188 __ jmp(&receiver_ok, Label::kNear); |
3189 __ bind(&global_object); | 3189 __ bind(&global_object); |
3190 __ mov(receiver, FieldOperand(function, JSFunction::kContextOffset)); | 3190 __ mov(receiver, FieldOperand(function, JSFunction::kContextOffset)); |
3191 __ mov(receiver, ContextOperand(receiver, Context::NATIVE_CONTEXT_INDEX)); | 3191 const int global_offset = Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX); |
3192 __ mov(receiver, ContextOperand(receiver, Context::GLOBAL_PROXY_INDEX)); | 3192 __ mov(receiver, Operand(receiver, global_offset)); |
| 3193 const int proxy_offset = JSGlobalObject::kGlobalProxyOffset; |
| 3194 __ mov(receiver, FieldOperand(receiver, proxy_offset)); |
3193 __ bind(&receiver_ok); | 3195 __ bind(&receiver_ok); |
3194 } | 3196 } |
3195 | 3197 |
3196 | 3198 |
3197 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { | 3199 void LCodeGen::DoApplyArguments(LApplyArguments* instr) { |
3198 Register receiver = ToRegister(instr->receiver()); | 3200 Register receiver = ToRegister(instr->receiver()); |
3199 Register function = ToRegister(instr->function()); | 3201 Register function = ToRegister(instr->function()); |
3200 Register length = ToRegister(instr->length()); | 3202 Register length = ToRegister(instr->length()); |
3201 Register elements = ToRegister(instr->elements()); | 3203 Register elements = ToRegister(instr->elements()); |
3202 DCHECK(receiver.is(eax)); // Used for parameter count. | 3204 DCHECK(receiver.is(eax)); // Used for parameter count. |
(...skipping 2385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5588 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5590 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5589 } | 5591 } |
5590 | 5592 |
5591 | 5593 |
5592 #undef __ | 5594 #undef __ |
5593 | 5595 |
5594 } // namespace internal | 5596 } // namespace internal |
5595 } // namespace v8 | 5597 } // namespace v8 |
5596 | 5598 |
5597 #endif // V8_TARGET_ARCH_IA32 | 5599 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |