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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 5312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5323 __ mov(FieldOperand(eax, i), edx); | 5323 __ mov(FieldOperand(eax, i), edx); |
5324 __ mov(FieldOperand(eax, i + kPointerSize), ecx); | 5324 __ mov(FieldOperand(eax, i + kPointerSize), ecx); |
5325 } | 5325 } |
5326 if ((size % (2 * kPointerSize)) != 0) { | 5326 if ((size % (2 * kPointerSize)) != 0) { |
5327 __ mov(edx, FieldOperand(ebx, size - kPointerSize)); | 5327 __ mov(edx, FieldOperand(ebx, size - kPointerSize)); |
5328 __ mov(FieldOperand(eax, size - kPointerSize), edx); | 5328 __ mov(FieldOperand(eax, size - kPointerSize), edx); |
5329 } | 5329 } |
5330 } | 5330 } |
5331 | 5331 |
5332 | 5332 |
5333 void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) { | |
5334 DCHECK(ToRegister(instr->context()).is(esi)); | |
5335 // Use the fast case closure allocation code that allocates in new | |
5336 // space for nested functions that don't need literals cloning. | |
5337 bool pretenure = instr->hydrogen()->pretenure(); | |
5338 if (!pretenure && instr->hydrogen()->has_no_literals()) { | |
5339 FastNewClosureStub stub(isolate(), instr->hydrogen()->language_mode(), | |
5340 instr->hydrogen()->kind()); | |
5341 __ mov(ebx, Immediate(instr->hydrogen()->shared_info())); | |
5342 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | |
5343 } else { | |
5344 __ push(esi); | |
5345 __ push(Immediate(instr->hydrogen()->shared_info())); | |
5346 __ push(Immediate(pretenure ? factory()->true_value() | |
5347 : factory()->false_value())); | |
5348 CallRuntime(Runtime::kNewClosure, 3, instr); | |
5349 } | |
5350 } | |
5351 | |
5352 | |
5353 void LCodeGen::DoTypeof(LTypeof* instr) { | 5333 void LCodeGen::DoTypeof(LTypeof* instr) { |
5354 DCHECK(ToRegister(instr->context()).is(esi)); | 5334 DCHECK(ToRegister(instr->context()).is(esi)); |
5355 DCHECK(ToRegister(instr->value()).is(ebx)); | 5335 DCHECK(ToRegister(instr->value()).is(ebx)); |
5356 Label end, do_call; | 5336 Label end, do_call; |
5357 Register value_register = ToRegister(instr->value()); | 5337 Register value_register = ToRegister(instr->value()); |
5358 __ JumpIfNotSmi(value_register, &do_call); | 5338 __ JumpIfNotSmi(value_register, &do_call); |
5359 __ mov(eax, Immediate(isolate()->factory()->number_string())); | 5339 __ mov(eax, Immediate(isolate()->factory()->number_string())); |
5360 __ jmp(&end); | 5340 __ jmp(&end); |
5361 __ bind(&do_call); | 5341 __ bind(&do_call); |
5362 TypeofStub stub(isolate()); | 5342 TypeofStub stub(isolate()); |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5749 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5729 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5750 } | 5730 } |
5751 | 5731 |
5752 | 5732 |
5753 #undef __ | 5733 #undef __ |
5754 | 5734 |
5755 } // namespace internal | 5735 } // namespace internal |
5756 } // namespace v8 | 5736 } // namespace v8 |
5757 | 5737 |
5758 #endif // V8_TARGET_ARCH_IA32 | 5738 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |