OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // r1: Callee's JS function. | 144 // r1: Callee's JS function. |
145 // cp: Callee's context. | 145 // cp: Callee's context. |
146 // pp: Callee's constant pool pointer (if FLAG_enable_ool_constant_pool) | 146 // pp: Callee's constant pool pointer (if FLAG_enable_ool_constant_pool) |
147 // fp: Caller's frame pointer. | 147 // fp: Caller's frame pointer. |
148 // lr: Caller's pc. | 148 // lr: Caller's pc. |
149 | 149 |
150 // Sloppy mode functions and builtins need to replace the receiver with the | 150 // Sloppy mode functions and builtins need to replace the receiver with the |
151 // global proxy when called as functions (without an explicit receiver | 151 // global proxy when called as functions (without an explicit receiver |
152 // object). | 152 // object). |
153 if (info_->this_has_uses() && | 153 if (info_->this_has_uses() && |
154 info_->is_sloppy_mode() && | 154 info_->strict_mode() == SLOPPY && |
155 !info_->is_native()) { | 155 !info_->is_native()) { |
156 Label ok; | 156 Label ok; |
157 int receiver_offset = info_->scope()->num_parameters() * kPointerSize; | 157 int receiver_offset = info_->scope()->num_parameters() * kPointerSize; |
158 __ ldr(r2, MemOperand(sp, receiver_offset)); | 158 __ ldr(r2, MemOperand(sp, receiver_offset)); |
159 __ CompareRoot(r2, Heap::kUndefinedValueRootIndex); | 159 __ CompareRoot(r2, Heap::kUndefinedValueRootIndex); |
160 __ b(ne, &ok); | 160 __ b(ne, &ok); |
161 | 161 |
162 __ ldr(r2, GlobalObjectOperand()); | 162 __ ldr(r2, GlobalObjectOperand()); |
163 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalReceiverOffset)); | 163 __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalReceiverOffset)); |
164 | 164 |
(...skipping 3961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4126 } | 4126 } |
4127 | 4127 |
4128 | 4128 |
4129 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4129 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4130 ASSERT(ToRegister(instr->context()).is(cp)); | 4130 ASSERT(ToRegister(instr->context()).is(cp)); |
4131 ASSERT(ToRegister(instr->object()).is(r1)); | 4131 ASSERT(ToRegister(instr->object()).is(r1)); |
4132 ASSERT(ToRegister(instr->value()).is(r0)); | 4132 ASSERT(ToRegister(instr->value()).is(r0)); |
4133 | 4133 |
4134 // Name is always in r2. | 4134 // Name is always in r2. |
4135 __ mov(r2, Operand(instr->name())); | 4135 __ mov(r2, Operand(instr->name())); |
4136 Handle<Code> ic = StoreIC::initialize_stub(isolate(), | 4136 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); |
4137 instr->strict_mode_flag()); | |
4138 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 4137 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
4139 } | 4138 } |
4140 | 4139 |
4141 | 4140 |
4142 void LCodeGen::ApplyCheckIf(Condition condition, LBoundsCheck* check) { | 4141 void LCodeGen::ApplyCheckIf(Condition condition, LBoundsCheck* check) { |
4143 if (FLAG_debug_code && check->hydrogen()->skip_check()) { | 4142 if (FLAG_debug_code && check->hydrogen()->skip_check()) { |
4144 Label done; | 4143 Label done; |
4145 __ b(NegateCondition(condition), &done); | 4144 __ b(NegateCondition(condition), &done); |
4146 __ stop("eliminated bounds check failed"); | 4145 __ stop("eliminated bounds check failed"); |
4147 __ bind(&done); | 4146 __ bind(&done); |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4364 } | 4363 } |
4365 } | 4364 } |
4366 | 4365 |
4367 | 4366 |
4368 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 4367 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
4369 ASSERT(ToRegister(instr->context()).is(cp)); | 4368 ASSERT(ToRegister(instr->context()).is(cp)); |
4370 ASSERT(ToRegister(instr->object()).is(r2)); | 4369 ASSERT(ToRegister(instr->object()).is(r2)); |
4371 ASSERT(ToRegister(instr->key()).is(r1)); | 4370 ASSERT(ToRegister(instr->key()).is(r1)); |
4372 ASSERT(ToRegister(instr->value()).is(r0)); | 4371 ASSERT(ToRegister(instr->value()).is(r0)); |
4373 | 4372 |
4374 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) | 4373 Handle<Code> ic = instr->strict_mode() == STRICT |
4375 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() | 4374 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() |
4376 : isolate()->builtins()->KeyedStoreIC_Initialize(); | 4375 : isolate()->builtins()->KeyedStoreIC_Initialize(); |
4377 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 4376 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
4378 } | 4377 } |
4379 | 4378 |
4380 | 4379 |
4381 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { | 4380 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { |
4382 Register object_reg = ToRegister(instr->object()); | 4381 Register object_reg = ToRegister(instr->object()); |
4383 Register scratch = scratch0(); | 4382 Register scratch = scratch0(); |
4384 | 4383 |
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5375 __ CopyFields(r0, r1, double_scratch0(), size / kPointerSize); | 5374 __ CopyFields(r0, r1, double_scratch0(), size / kPointerSize); |
5376 } | 5375 } |
5377 | 5376 |
5378 | 5377 |
5379 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { | 5378 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { |
5380 ASSERT(ToRegister(instr->context()).is(cp)); | 5379 ASSERT(ToRegister(instr->context()).is(cp)); |
5381 // Use the fast case closure allocation code that allocates in new | 5380 // Use the fast case closure allocation code that allocates in new |
5382 // space for nested functions that don't need literals cloning. | 5381 // space for nested functions that don't need literals cloning. |
5383 bool pretenure = instr->hydrogen()->pretenure(); | 5382 bool pretenure = instr->hydrogen()->pretenure(); |
5384 if (!pretenure && instr->hydrogen()->has_no_literals()) { | 5383 if (!pretenure && instr->hydrogen()->has_no_literals()) { |
5385 FastNewClosureStub stub(instr->hydrogen()->language_mode(), | 5384 FastNewClosureStub stub(instr->hydrogen()->strict_mode(), |
5386 instr->hydrogen()->is_generator()); | 5385 instr->hydrogen()->is_generator()); |
5387 __ mov(r2, Operand(instr->hydrogen()->shared_info())); | 5386 __ mov(r2, Operand(instr->hydrogen()->shared_info())); |
5388 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 5387 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
5389 } else { | 5388 } else { |
5390 __ mov(r2, Operand(instr->hydrogen()->shared_info())); | 5389 __ mov(r2, Operand(instr->hydrogen()->shared_info())); |
5391 __ mov(r1, Operand(pretenure ? factory()->true_value() | 5390 __ mov(r1, Operand(pretenure ? factory()->true_value() |
5392 : factory()->false_value())); | 5391 : factory()->false_value())); |
5393 __ Push(cp, r2, r1); | 5392 __ Push(cp, r2, r1); |
5394 CallRuntime(Runtime::kNewClosure, 3, instr); | 5393 CallRuntime(Runtime::kNewClosure, 3, instr); |
5395 } | 5394 } |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5742 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5741 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5743 __ ldr(result, FieldMemOperand(scratch, | 5742 __ ldr(result, FieldMemOperand(scratch, |
5744 FixedArray::kHeaderSize - kPointerSize)); | 5743 FixedArray::kHeaderSize - kPointerSize)); |
5745 __ bind(&done); | 5744 __ bind(&done); |
5746 } | 5745 } |
5747 | 5746 |
5748 | 5747 |
5749 #undef __ | 5748 #undef __ |
5750 | 5749 |
5751 } } // namespace v8::internal | 5750 } } // namespace v8::internal |
OLD | NEW |