OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 // a1: Callee's JS function. | 144 // a1: Callee's JS function. |
145 // cp: Callee's context. | 145 // cp: Callee's context. |
146 // fp: Caller's frame pointer. | 146 // fp: Caller's frame pointer. |
147 // lr: Caller's pc. | 147 // lr: Caller's pc. |
148 | 148 |
149 // Sloppy mode functions and builtins need to replace the receiver with the | 149 // Sloppy mode functions and builtins need to replace the receiver with the |
150 // global proxy when called as functions (without an explicit receiver | 150 // global proxy when called as functions (without an explicit receiver |
151 // object). | 151 // object). |
152 if (info_->this_has_uses() && | 152 if (info_->this_has_uses() && |
153 info_->is_sloppy_mode() && | 153 info_->strict_mode() == SLOPPY && |
154 !info_->is_native()) { | 154 !info_->is_native()) { |
155 Label ok; | 155 Label ok; |
156 int receiver_offset = info_->scope()->num_parameters() * kPointerSize; | 156 int receiver_offset = info_->scope()->num_parameters() * kPointerSize; |
157 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 157 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
158 __ lw(a2, MemOperand(sp, receiver_offset)); | 158 __ lw(a2, MemOperand(sp, receiver_offset)); |
159 __ Branch(&ok, ne, a2, Operand(at)); | 159 __ Branch(&ok, ne, a2, Operand(at)); |
160 | 160 |
161 __ lw(a2, GlobalObjectOperand()); | 161 __ lw(a2, GlobalObjectOperand()); |
162 __ lw(a2, FieldMemOperand(a2, GlobalObject::kGlobalReceiverOffset)); | 162 __ lw(a2, FieldMemOperand(a2, GlobalObject::kGlobalReceiverOffset)); |
163 | 163 |
(...skipping 3836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4000 } | 4000 } |
4001 | 4001 |
4002 | 4002 |
4003 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4003 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4004 ASSERT(ToRegister(instr->context()).is(cp)); | 4004 ASSERT(ToRegister(instr->context()).is(cp)); |
4005 ASSERT(ToRegister(instr->object()).is(a1)); | 4005 ASSERT(ToRegister(instr->object()).is(a1)); |
4006 ASSERT(ToRegister(instr->value()).is(a0)); | 4006 ASSERT(ToRegister(instr->value()).is(a0)); |
4007 | 4007 |
4008 // Name is always in a2. | 4008 // Name is always in a2. |
4009 __ li(a2, Operand(instr->name())); | 4009 __ li(a2, Operand(instr->name())); |
4010 Handle<Code> ic = StoreIC::initialize_stub(isolate(), | 4010 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); |
4011 instr->strict_mode_flag()); | |
4012 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4011 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4013 } | 4012 } |
4014 | 4013 |
4015 | 4014 |
4016 void LCodeGen::ApplyCheckIf(Condition condition, | 4015 void LCodeGen::ApplyCheckIf(Condition condition, |
4017 LBoundsCheck* check, | 4016 LBoundsCheck* check, |
4018 Register src1, | 4017 Register src1, |
4019 const Operand& src2) { | 4018 const Operand& src2) { |
4020 if (FLAG_debug_code && check->hydrogen()->skip_check()) { | 4019 if (FLAG_debug_code && check->hydrogen()->skip_check()) { |
4021 Label done; | 4020 Label done; |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4257 } | 4256 } |
4258 } | 4257 } |
4259 | 4258 |
4260 | 4259 |
4261 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 4260 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
4262 ASSERT(ToRegister(instr->context()).is(cp)); | 4261 ASSERT(ToRegister(instr->context()).is(cp)); |
4263 ASSERT(ToRegister(instr->object()).is(a2)); | 4262 ASSERT(ToRegister(instr->object()).is(a2)); |
4264 ASSERT(ToRegister(instr->key()).is(a1)); | 4263 ASSERT(ToRegister(instr->key()).is(a1)); |
4265 ASSERT(ToRegister(instr->value()).is(a0)); | 4264 ASSERT(ToRegister(instr->value()).is(a0)); |
4266 | 4265 |
4267 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) | 4266 Handle<Code> ic = (instr->strict_mode() == STRICT) |
4268 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() | 4267 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() |
4269 : isolate()->builtins()->KeyedStoreIC_Initialize(); | 4268 : isolate()->builtins()->KeyedStoreIC_Initialize(); |
4270 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4269 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4271 } | 4270 } |
4272 | 4271 |
4273 | 4272 |
4274 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { | 4273 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { |
4275 Register object_reg = ToRegister(instr->object()); | 4274 Register object_reg = ToRegister(instr->object()); |
4276 Register scratch = scratch0(); | 4275 Register scratch = scratch0(); |
4277 | 4276 |
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5318 } | 5317 } |
5319 } | 5318 } |
5320 | 5319 |
5321 | 5320 |
5322 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { | 5321 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { |
5323 ASSERT(ToRegister(instr->context()).is(cp)); | 5322 ASSERT(ToRegister(instr->context()).is(cp)); |
5324 // Use the fast case closure allocation code that allocates in new | 5323 // Use the fast case closure allocation code that allocates in new |
5325 // space for nested functions that don't need literals cloning. | 5324 // space for nested functions that don't need literals cloning. |
5326 bool pretenure = instr->hydrogen()->pretenure(); | 5325 bool pretenure = instr->hydrogen()->pretenure(); |
5327 if (!pretenure && instr->hydrogen()->has_no_literals()) { | 5326 if (!pretenure && instr->hydrogen()->has_no_literals()) { |
5328 FastNewClosureStub stub(instr->hydrogen()->language_mode(), | 5327 FastNewClosureStub stub(instr->hydrogen()->strict_mode(), |
5329 instr->hydrogen()->is_generator()); | 5328 instr->hydrogen()->is_generator()); |
5330 __ li(a2, Operand(instr->hydrogen()->shared_info())); | 5329 __ li(a2, Operand(instr->hydrogen()->shared_info())); |
5331 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 5330 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
5332 } else { | 5331 } else { |
5333 __ li(a2, Operand(instr->hydrogen()->shared_info())); | 5332 __ li(a2, Operand(instr->hydrogen()->shared_info())); |
5334 __ li(a1, Operand(pretenure ? factory()->true_value() | 5333 __ li(a1, Operand(pretenure ? factory()->true_value() |
5335 : factory()->false_value())); | 5334 : factory()->false_value())); |
5336 __ Push(cp, a2, a1); | 5335 __ Push(cp, a2, a1); |
5337 CallRuntime(Runtime::kNewClosure, 3, instr); | 5336 CallRuntime(Runtime::kNewClosure, 3, instr); |
5338 } | 5337 } |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5719 __ Subu(scratch, result, scratch); | 5718 __ Subu(scratch, result, scratch); |
5720 __ lw(result, FieldMemOperand(scratch, | 5719 __ lw(result, FieldMemOperand(scratch, |
5721 FixedArray::kHeaderSize - kPointerSize)); | 5720 FixedArray::kHeaderSize - kPointerSize)); |
5722 __ bind(&done); | 5721 __ bind(&done); |
5723 } | 5722 } |
5724 | 5723 |
5725 | 5724 |
5726 #undef __ | 5725 #undef __ |
5727 | 5726 |
5728 } } // namespace v8::internal | 5727 } } // namespace v8::internal |
OLD | NEW |