| 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_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 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 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 } | 614 } |
| 615 } | 615 } |
| 616 | 616 |
| 617 | 617 |
| 618 void FullCodeGenerator::DoTest(Expression* condition, | 618 void FullCodeGenerator::DoTest(Expression* condition, |
| 619 Label* if_true, | 619 Label* if_true, |
| 620 Label* if_false, | 620 Label* if_false, |
| 621 Label* fall_through) { | 621 Label* fall_through) { |
| 622 Handle<Code> ic = ToBooleanStub::GetUninitialized(isolate()); | 622 Handle<Code> ic = ToBooleanStub::GetUninitialized(isolate()); |
| 623 CallIC(ic, condition->test_id()); | 623 CallIC(ic, condition->test_id()); |
| 624 __ test(result_register(), result_register()); | 624 __ CompareRoot(result_register(), Heap::kTrueValueRootIndex); |
| 625 // The stub returns nonzero for true. | 625 Split(equal, if_true, if_false, fall_through); |
| 626 Split(not_zero, if_true, if_false, fall_through); | |
| 627 } | 626 } |
| 628 | 627 |
| 629 | 628 |
| 630 void FullCodeGenerator::Split(Condition cc, | 629 void FullCodeGenerator::Split(Condition cc, |
| 631 Label* if_true, | 630 Label* if_true, |
| 632 Label* if_false, | 631 Label* if_false, |
| 633 Label* fall_through) { | 632 Label* fall_through) { |
| 634 if (if_false == fall_through) { | 633 if (if_false == fall_through) { |
| 635 __ j(cc, if_true); | 634 __ j(cc, if_true); |
| 636 } else if (if_true == fall_through) { | 635 } else if (if_true == fall_through) { |
| (...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1970 __ bind(&l_loop); | 1969 __ bind(&l_loop); |
| 1971 __ push(eax); // save result | 1970 __ push(eax); // save result |
| 1972 __ Move(load_receiver, eax); // result | 1971 __ Move(load_receiver, eax); // result |
| 1973 __ mov(load_name, | 1972 __ mov(load_name, |
| 1974 isolate()->factory()->done_string()); // "done" | 1973 isolate()->factory()->done_string()); // "done" |
| 1975 __ mov(LoadDescriptor::SlotRegister(), | 1974 __ mov(LoadDescriptor::SlotRegister(), |
| 1976 Immediate(SmiFromSlot(expr->DoneFeedbackSlot()))); | 1975 Immediate(SmiFromSlot(expr->DoneFeedbackSlot()))); |
| 1977 CallLoadIC(NOT_INSIDE_TYPEOF); // result.done in eax | 1976 CallLoadIC(NOT_INSIDE_TYPEOF); // result.done in eax |
| 1978 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); | 1977 Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate()); |
| 1979 CallIC(bool_ic); | 1978 CallIC(bool_ic); |
| 1980 __ test(eax, eax); | 1979 __ CompareRoot(result_register(), Heap::kTrueValueRootIndex); |
| 1981 __ j(zero, &l_try); | 1980 __ j(not_equal, &l_try); |
| 1982 | 1981 |
| 1983 // result.value | 1982 // result.value |
| 1984 __ pop(load_receiver); // result | 1983 __ pop(load_receiver); // result |
| 1985 __ mov(load_name, | 1984 __ mov(load_name, |
| 1986 isolate()->factory()->value_string()); // "value" | 1985 isolate()->factory()->value_string()); // "value" |
| 1987 __ mov(LoadDescriptor::SlotRegister(), | 1986 __ mov(LoadDescriptor::SlotRegister(), |
| 1988 Immediate(SmiFromSlot(expr->ValueFeedbackSlot()))); | 1987 Immediate(SmiFromSlot(expr->ValueFeedbackSlot()))); |
| 1989 CallLoadIC(NOT_INSIDE_TYPEOF); // result.value in eax | 1988 CallLoadIC(NOT_INSIDE_TYPEOF); // result.value in eax |
| 1990 context()->DropAndPlug(2, eax); // drop iter and g | 1989 context()->DropAndPlug(2, eax); // drop iter and g |
| 1991 break; | 1990 break; |
| (...skipping 2841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4833 Assembler::target_address_at(call_target_address, | 4832 Assembler::target_address_at(call_target_address, |
| 4834 unoptimized_code)); | 4833 unoptimized_code)); |
| 4835 return OSR_AFTER_STACK_CHECK; | 4834 return OSR_AFTER_STACK_CHECK; |
| 4836 } | 4835 } |
| 4837 | 4836 |
| 4838 | 4837 |
| 4839 } // namespace internal | 4838 } // namespace internal |
| 4840 } // namespace v8 | 4839 } // namespace v8 |
| 4841 | 4840 |
| 4842 #endif // V8_TARGET_ARCH_X87 | 4841 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |