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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arm/lithium-codegen-arm.h" | 7 #include "src/arm/lithium-codegen-arm.h" |
8 #include "src/arm/lithium-gap-resolver-arm.h" | 8 #include "src/arm/lithium-gap-resolver-arm.h" |
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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 // r1: Callee's JS function. | 113 // r1: Callee's JS function. |
114 // cp: Callee's context. | 114 // cp: Callee's context. |
115 // pp: Callee's constant pool pointer (if FLAG_enable_ool_constant_pool) | 115 // pp: Callee's constant pool pointer (if FLAG_enable_ool_constant_pool) |
116 // fp: Caller's frame pointer. | 116 // fp: Caller's frame pointer. |
117 // lr: Caller's pc. | 117 // lr: Caller's pc. |
118 | 118 |
119 // Sloppy mode functions and builtins need to replace the receiver with the | 119 // Sloppy mode functions and builtins need to replace the receiver with the |
120 // global proxy when called as functions (without an explicit receiver | 120 // global proxy when called as functions (without an explicit receiver |
121 // object). | 121 // object). |
122 if (info_->this_has_uses() && | 122 if (info_->this_has_uses() && is_sloppy(info_->language_mode()) && |
123 info_->strict_mode() == SLOPPY && | |
124 !info_->is_native()) { | 123 !info_->is_native()) { |
125 Label ok; | 124 Label ok; |
126 int receiver_offset = info_->scope()->num_parameters() * kPointerSize; | 125 int receiver_offset = info_->scope()->num_parameters() * kPointerSize; |
127 __ ldr(r2, MemOperand(sp, receiver_offset)); | 126 __ ldr(r2, MemOperand(sp, receiver_offset)); |
128 __ CompareRoot(r2, Heap::kUndefinedValueRootIndex); | 127 __ CompareRoot(r2, Heap::kUndefinedValueRootIndex); |
129 __ b(ne, &ok); | 128 __ b(ne, &ok); |
130 | 129 |
131 __ ldr(r2, GlobalObjectOperand()); | 130 __ ldr(r2, GlobalObjectOperand()); |
132 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalProxyOffset)); | 131 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalProxyOffset)); |
133 | 132 |
(...skipping 4169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4303 } | 4302 } |
4304 } | 4303 } |
4305 | 4304 |
4306 | 4305 |
4307 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4306 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4308 DCHECK(ToRegister(instr->context()).is(cp)); | 4307 DCHECK(ToRegister(instr->context()).is(cp)); |
4309 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | 4308 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
4310 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | 4309 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
4311 | 4310 |
4312 __ mov(StoreDescriptor::NameRegister(), Operand(instr->name())); | 4311 __ mov(StoreDescriptor::NameRegister(), Operand(instr->name())); |
4313 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); | 4312 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->language_mode()); |
4314 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 4313 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
4315 } | 4314 } |
4316 | 4315 |
4317 | 4316 |
4318 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4317 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4319 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; | 4318 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; |
4320 if (instr->index()->IsConstantOperand()) { | 4319 if (instr->index()->IsConstantOperand()) { |
4321 Operand index = ToOperand(instr->index()); | 4320 Operand index = ToOperand(instr->index()); |
4322 Register length = ToRegister(instr->length()); | 4321 Register length = ToRegister(instr->length()); |
4323 __ cmp(length, index); | 4322 __ cmp(length, index); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4525 } | 4524 } |
4526 | 4525 |
4527 | 4526 |
4528 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 4527 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
4529 DCHECK(ToRegister(instr->context()).is(cp)); | 4528 DCHECK(ToRegister(instr->context()).is(cp)); |
4530 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); | 4529 DCHECK(ToRegister(instr->object()).is(StoreDescriptor::ReceiverRegister())); |
4531 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); | 4530 DCHECK(ToRegister(instr->key()).is(StoreDescriptor::NameRegister())); |
4532 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); | 4531 DCHECK(ToRegister(instr->value()).is(StoreDescriptor::ValueRegister())); |
4533 | 4532 |
4534 Handle<Code> ic = | 4533 Handle<Code> ic = |
4535 CodeFactory::KeyedStoreIC(isolate(), instr->strict_mode()).code(); | 4534 CodeFactory::KeyedStoreIC(isolate(), instr->language_mode()).code(); |
4536 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 4535 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
4537 } | 4536 } |
4538 | 4537 |
4539 | 4538 |
4540 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { | 4539 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { |
4541 Register object_reg = ToRegister(instr->object()); | 4540 Register object_reg = ToRegister(instr->object()); |
4542 Register scratch = scratch0(); | 4541 Register scratch = scratch0(); |
4543 | 4542 |
4544 Handle<Map> from_map = instr->original_map(); | 4543 Handle<Map> from_map = instr->original_map(); |
4545 Handle<Map> to_map = instr->transitioned_map(); | 4544 Handle<Map> to_map = instr->transitioned_map(); |
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5556 __ CopyFields(r0, r1, double_scratch0(), size / kPointerSize); | 5555 __ CopyFields(r0, r1, double_scratch0(), size / kPointerSize); |
5557 } | 5556 } |
5558 | 5557 |
5559 | 5558 |
5560 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { | 5559 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { |
5561 DCHECK(ToRegister(instr->context()).is(cp)); | 5560 DCHECK(ToRegister(instr->context()).is(cp)); |
5562 // Use the fast case closure allocation code that allocates in new | 5561 // Use the fast case closure allocation code that allocates in new |
5563 // space for nested functions that don't need literals cloning. | 5562 // space for nested functions that don't need literals cloning. |
5564 bool pretenure = instr->hydrogen()->pretenure(); | 5563 bool pretenure = instr->hydrogen()->pretenure(); |
5565 if (!pretenure && instr->hydrogen()->has_no_literals()) { | 5564 if (!pretenure && instr->hydrogen()->has_no_literals()) { |
5566 FastNewClosureStub stub(isolate(), instr->hydrogen()->strict_mode(), | 5565 FastNewClosureStub stub(isolate(), instr->hydrogen()->language_mode(), |
5567 instr->hydrogen()->kind()); | 5566 instr->hydrogen()->kind()); |
5568 __ mov(r2, Operand(instr->hydrogen()->shared_info())); | 5567 __ mov(r2, Operand(instr->hydrogen()->shared_info())); |
5569 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 5568 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
5570 } else { | 5569 } else { |
5571 __ mov(r2, Operand(instr->hydrogen()->shared_info())); | 5570 __ mov(r2, Operand(instr->hydrogen()->shared_info())); |
5572 __ mov(r1, Operand(pretenure ? factory()->true_value() | 5571 __ mov(r1, Operand(pretenure ? factory()->true_value() |
5573 : factory()->false_value())); | 5572 : factory()->false_value())); |
5574 __ Push(cp, r2, r1); | 5573 __ Push(cp, r2, r1); |
5575 CallRuntime(Runtime::kNewClosure, 3, instr); | 5574 CallRuntime(Runtime::kNewClosure, 3, instr); |
5576 } | 5575 } |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5978 __ Push(scope_info); | 5977 __ Push(scope_info); |
5979 __ push(ToRegister(instr->function())); | 5978 __ push(ToRegister(instr->function())); |
5980 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5979 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5981 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5980 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5982 } | 5981 } |
5983 | 5982 |
5984 | 5983 |
5985 #undef __ | 5984 #undef __ |
5986 | 5985 |
5987 } } // namespace v8::internal | 5986 } } // namespace v8::internal |
OLD | NEW |