| 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/ast/scopes.h" | 7 #include "src/ast/scopes.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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 } | 617 } |
| 618 } | 618 } |
| 619 | 619 |
| 620 | 620 |
| 621 void FullCodeGenerator::DoTest(Expression* condition, | 621 void FullCodeGenerator::DoTest(Expression* condition, |
| 622 Label* if_true, | 622 Label* if_true, |
| 623 Label* if_false, | 623 Label* if_false, |
| 624 Label* fall_through) { | 624 Label* fall_through) { |
| 625 Handle<Code> ic = ToBooleanStub::GetUninitialized(isolate()); | 625 Handle<Code> ic = ToBooleanStub::GetUninitialized(isolate()); |
| 626 CallIC(ic, condition->test_id()); | 626 CallIC(ic, condition->test_id()); |
| 627 __ test(result_register(), result_register()); | 627 __ CompareRoot(result_register(), Heap::kTrueValueRootIndex); |
| 628 // The stub returns nonzero for true. | 628 Split(equal, if_true, if_false, fall_through); |
| 629 Split(not_zero, if_true, if_false, fall_through); | |
| 630 } | 629 } |
| 631 | 630 |
| 632 | 631 |
| 633 void FullCodeGenerator::Split(Condition cc, | 632 void FullCodeGenerator::Split(Condition cc, |
| 634 Label* if_true, | 633 Label* if_true, |
| 635 Label* if_false, | 634 Label* if_false, |
| 636 Label* fall_through) { | 635 Label* fall_through) { |
| 637 if (if_false == fall_through) { | 636 if (if_false == fall_through) { |
| 638 __ j(cc, if_true); | 637 __ j(cc, if_true); |
| 639 } else if (if_true == fall_through) { | 638 } else if (if_true == fall_through) { |
| (...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1978 __ bind(&l_loop); | 1977 __ bind(&l_loop); |
| 1979 __ push(eax); // save result | 1978 __ push(eax); // save result |
| 1980 __ Move(load_receiver, eax); // result | 1979 __ Move(load_receiver, eax); // result |
| 1981 __ mov(load_name, | 1980 __ mov(load_name, |
| 1982 isolate()->factory()->done_string()); // "done" | 1981 isolate()->factory()->done_string()); // "done" |
| 1983 __ mov(LoadDescriptor::SlotRegister(), | 1982 __ mov(LoadDescriptor::SlotRegister(), |
| 1984 Immediate(SmiFromSlot(expr->DoneFeedbackSlot()))); | 1983 Immediate(SmiFromSlot(expr->DoneFeedbackSlot()))); |
| 1985 CallLoadIC(NOT_INSIDE_TYPEOF); // result.done in eax | 1984 CallLoadIC(NOT_INSIDE_TYPEOF); // result.done in eax |
| 1986 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); | 1985 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); |
| 1987 CallIC(bool_ic); | 1986 CallIC(bool_ic); |
| 1988 __ test(eax, eax); | 1987 __ CompareRoot(result_register(), Heap::kTrueValueRootIndex); |
| 1989 __ j(zero, &l_try); | 1988 __ j(not_equal, &l_try); |
| 1990 | 1989 |
| 1991 // result.value | 1990 // result.value |
| 1992 __ pop(load_receiver); // result | 1991 __ pop(load_receiver); // result |
| 1993 __ mov(load_name, | 1992 __ mov(load_name, |
| 1994 isolate()->factory()->value_string()); // "value" | 1993 isolate()->factory()->value_string()); // "value" |
| 1995 __ mov(LoadDescriptor::SlotRegister(), | 1994 __ mov(LoadDescriptor::SlotRegister(), |
| 1996 Immediate(SmiFromSlot(expr->ValueFeedbackSlot()))); | 1995 Immediate(SmiFromSlot(expr->ValueFeedbackSlot()))); |
| 1997 CallLoadIC(NOT_INSIDE_TYPEOF); // result.value in eax | 1996 CallLoadIC(NOT_INSIDE_TYPEOF); // result.value in eax |
| 1998 context()->DropAndPlug(2, eax); // drop iter and g | 1997 context()->DropAndPlug(2, eax); // drop iter and g |
| 1999 break; | 1998 break; |
| (...skipping 2841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4841 Assembler::target_address_at(call_target_address, | 4840 Assembler::target_address_at(call_target_address, |
| 4842 unoptimized_code)); | 4841 unoptimized_code)); |
| 4843 return OSR_AFTER_STACK_CHECK; | 4842 return OSR_AFTER_STACK_CHECK; |
| 4844 } | 4843 } |
| 4845 | 4844 |
| 4846 | 4845 |
| 4847 } // namespace internal | 4846 } // namespace internal |
| 4848 } // namespace v8 | 4847 } // namespace v8 |
| 4849 | 4848 |
| 4850 #endif // V8_TARGET_ARCH_IA32 | 4849 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |