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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 if (strlen(FLAG_stop_at) > 0 && | 172 if (strlen(FLAG_stop_at) > 0 && |
173 info_->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { | 173 info_->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { |
174 __ int3(); | 174 __ int3(); |
175 } | 175 } |
176 #endif | 176 #endif |
177 | 177 |
178 // Sloppy mode functions and builtins need to replace the receiver with the | 178 // Sloppy mode functions and builtins need to replace the receiver with the |
179 // global proxy when called as functions (without an explicit receiver | 179 // global proxy when called as functions (without an explicit receiver |
180 // object). | 180 // object). |
181 if (info_->this_has_uses() && | 181 if (info_->this_has_uses() && |
182 info_->is_sloppy_mode() && | 182 info_->strict_mode() == SLOPPY && |
183 !info_->is_native()) { | 183 !info_->is_native()) { |
184 Label ok; | 184 Label ok; |
185 // +1 for return address. | 185 // +1 for return address. |
186 int receiver_offset = (scope()->num_parameters() + 1) * kPointerSize; | 186 int receiver_offset = (scope()->num_parameters() + 1) * kPointerSize; |
187 __ mov(ecx, Operand(esp, receiver_offset)); | 187 __ mov(ecx, Operand(esp, receiver_offset)); |
188 | 188 |
189 __ cmp(ecx, isolate()->factory()->undefined_value()); | 189 __ cmp(ecx, isolate()->factory()->undefined_value()); |
190 __ j(not_equal, &ok, Label::kNear); | 190 __ j(not_equal, &ok, Label::kNear); |
191 | 191 |
192 __ mov(ecx, GlobalObjectOperand()); | 192 __ mov(ecx, GlobalObjectOperand()); |
(...skipping 4200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4393 } | 4393 } |
4394 } | 4394 } |
4395 | 4395 |
4396 | 4396 |
4397 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4397 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4398 ASSERT(ToRegister(instr->context()).is(esi)); | 4398 ASSERT(ToRegister(instr->context()).is(esi)); |
4399 ASSERT(ToRegister(instr->object()).is(edx)); | 4399 ASSERT(ToRegister(instr->object()).is(edx)); |
4400 ASSERT(ToRegister(instr->value()).is(eax)); | 4400 ASSERT(ToRegister(instr->value()).is(eax)); |
4401 | 4401 |
4402 __ mov(ecx, instr->name()); | 4402 __ mov(ecx, instr->name()); |
4403 Handle<Code> ic = StoreIC::initialize_stub(isolate(), | 4403 Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); |
4404 instr->strict_mode_flag()); | |
4405 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4404 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4406 } | 4405 } |
4407 | 4406 |
4408 | 4407 |
4409 void LCodeGen::ApplyCheckIf(Condition cc, LBoundsCheck* check) { | 4408 void LCodeGen::ApplyCheckIf(Condition cc, LBoundsCheck* check) { |
4410 if (FLAG_debug_code && check->hydrogen()->skip_check()) { | 4409 if (FLAG_debug_code && check->hydrogen()->skip_check()) { |
4411 Label done; | 4410 Label done; |
4412 __ j(NegateCondition(cc), &done, Label::kNear); | 4411 __ j(NegateCondition(cc), &done, Label::kNear); |
4413 __ int3(); | 4412 __ int3(); |
4414 __ bind(&done); | 4413 __ bind(&done); |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4645 } | 4644 } |
4646 } | 4645 } |
4647 | 4646 |
4648 | 4647 |
4649 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 4648 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
4650 ASSERT(ToRegister(instr->context()).is(esi)); | 4649 ASSERT(ToRegister(instr->context()).is(esi)); |
4651 ASSERT(ToRegister(instr->object()).is(edx)); | 4650 ASSERT(ToRegister(instr->object()).is(edx)); |
4652 ASSERT(ToRegister(instr->key()).is(ecx)); | 4651 ASSERT(ToRegister(instr->key()).is(ecx)); |
4653 ASSERT(ToRegister(instr->value()).is(eax)); | 4652 ASSERT(ToRegister(instr->value()).is(eax)); |
4654 | 4653 |
4655 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) | 4654 Handle<Code> ic = instr->strict_mode() == STRICT |
4656 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() | 4655 ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() |
4657 : isolate()->builtins()->KeyedStoreIC_Initialize(); | 4656 : isolate()->builtins()->KeyedStoreIC_Initialize(); |
4658 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4657 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4659 } | 4658 } |
4660 | 4659 |
4661 | 4660 |
4662 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) { | 4661 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) { |
4663 Register object = ToRegister(instr->object()); | 4662 Register object = ToRegister(instr->object()); |
4664 Register temp = ToRegister(instr->temp()); | 4663 Register temp = ToRegister(instr->temp()); |
4665 Label no_memento_found; | 4664 Label no_memento_found; |
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5908 } | 5907 } |
5909 } | 5908 } |
5910 | 5909 |
5911 | 5910 |
5912 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { | 5911 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { |
5913 ASSERT(ToRegister(instr->context()).is(esi)); | 5912 ASSERT(ToRegister(instr->context()).is(esi)); |
5914 // Use the fast case closure allocation code that allocates in new | 5913 // Use the fast case closure allocation code that allocates in new |
5915 // space for nested functions that don't need literals cloning. | 5914 // space for nested functions that don't need literals cloning. |
5916 bool pretenure = instr->hydrogen()->pretenure(); | 5915 bool pretenure = instr->hydrogen()->pretenure(); |
5917 if (!pretenure && instr->hydrogen()->has_no_literals()) { | 5916 if (!pretenure && instr->hydrogen()->has_no_literals()) { |
5918 FastNewClosureStub stub(instr->hydrogen()->language_mode(), | 5917 FastNewClosureStub stub(instr->hydrogen()->strict_mode(), |
5919 instr->hydrogen()->is_generator()); | 5918 instr->hydrogen()->is_generator()); |
5920 __ mov(ebx, Immediate(instr->hydrogen()->shared_info())); | 5919 __ mov(ebx, Immediate(instr->hydrogen()->shared_info())); |
5921 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 5920 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
5922 } else { | 5921 } else { |
5923 __ push(esi); | 5922 __ push(esi); |
5924 __ push(Immediate(instr->hydrogen()->shared_info())); | 5923 __ push(Immediate(instr->hydrogen()->shared_info())); |
5925 __ push(Immediate(pretenure ? factory()->true_value() | 5924 __ push(Immediate(pretenure ? factory()->true_value() |
5926 : factory()->false_value())); | 5925 : factory()->false_value())); |
5927 CallRuntime(Runtime::kNewClosure, 3, instr); | 5926 CallRuntime(Runtime::kNewClosure, 3, instr); |
5928 } | 5927 } |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6270 FixedArray::kHeaderSize - kPointerSize)); | 6269 FixedArray::kHeaderSize - kPointerSize)); |
6271 __ bind(&done); | 6270 __ bind(&done); |
6272 } | 6271 } |
6273 | 6272 |
6274 | 6273 |
6275 #undef __ | 6274 #undef __ |
6276 | 6275 |
6277 } } // namespace v8::internal | 6276 } } // namespace v8::internal |
6278 | 6277 |
6279 #endif // V8_TARGET_ARCH_IA32 | 6278 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |