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 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
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 5368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5379 __ push(Immediate(instr->hydrogen()->shared_info())); | 5379 __ push(Immediate(instr->hydrogen()->shared_info())); |
5380 __ push(Immediate(pretenure ? factory()->true_value() | 5380 __ push(Immediate(pretenure ? factory()->true_value() |
5381 : factory()->false_value())); | 5381 : factory()->false_value())); |
5382 CallRuntime(Runtime::kNewClosure, 3, instr); | 5382 CallRuntime(Runtime::kNewClosure, 3, instr); |
5383 } | 5383 } |
5384 } | 5384 } |
5385 | 5385 |
5386 | 5386 |
5387 void LCodeGen::DoTypeof(LTypeof* instr) { | 5387 void LCodeGen::DoTypeof(LTypeof* instr) { |
5388 DCHECK(ToRegister(instr->context()).is(esi)); | 5388 DCHECK(ToRegister(instr->context()).is(esi)); |
5389 LOperand* input = instr->value(); | 5389 DCHECK(ToRegister(instr->value()).is(ebx)); |
5390 EmitPushTaggedOperand(input); | 5390 Label end, do_call; |
5391 CallRuntime(Runtime::kTypeof, 1, instr); | 5391 Register value_register = ToRegister(instr->value()); |
| 5392 __ JumpIfNotSmi(value_register, &do_call); |
| 5393 __ mov(eax, Immediate(isolate()->factory()->number_string())); |
| 5394 __ jmp(&end); |
| 5395 __ bind(&do_call); |
| 5396 TypeofStub stub(isolate()); |
| 5397 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 5398 __ bind(&end); |
5392 } | 5399 } |
5393 | 5400 |
5394 | 5401 |
5395 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { | 5402 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { |
5396 Register input = ToRegister(instr->value()); | 5403 Register input = ToRegister(instr->value()); |
5397 Condition final_branch_condition = EmitTypeofIs(instr, input); | 5404 Condition final_branch_condition = EmitTypeofIs(instr, input); |
5398 if (final_branch_condition != no_condition) { | 5405 if (final_branch_condition != no_condition) { |
5399 EmitBranch(instr, final_branch_condition); | 5406 EmitBranch(instr, final_branch_condition); |
5400 } | 5407 } |
5401 } | 5408 } |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5767 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5774 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5768 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5775 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5769 } | 5776 } |
5770 | 5777 |
5771 | 5778 |
5772 #undef __ | 5779 #undef __ |
5773 | 5780 |
5774 } } // namespace v8::internal | 5781 } } // namespace v8::internal |
5775 | 5782 |
5776 #endif // V8_TARGET_ARCH_IA32 | 5783 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |