OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 } else { | 559 } else { |
560 if (false_label_ != fall_through_) __ jmp(false_label_); | 560 if (false_label_ != fall_through_) __ jmp(false_label_); |
561 } | 561 } |
562 } | 562 } |
563 | 563 |
564 | 564 |
565 void FullCodeGenerator::DoTest(Expression* condition, | 565 void FullCodeGenerator::DoTest(Expression* condition, |
566 Label* if_true, | 566 Label* if_true, |
567 Label* if_false, | 567 Label* if_false, |
568 Label* fall_through) { | 568 Label* fall_through) { |
569 ToBooleanStub stub; | 569 ToBooleanStub stub(result_register()); |
570 __ push(result_register()); | 570 __ push(result_register()); |
571 __ CallStub(&stub); | 571 __ CallStub(&stub); |
572 __ test(eax, Operand(eax)); | 572 __ test(result_register(), Operand(result_register())); |
573 // The stub returns nonzero for true. | 573 // The stub returns nonzero for true. |
574 Split(not_zero, if_true, if_false, fall_through); | 574 Split(not_zero, if_true, if_false, fall_through); |
575 } | 575 } |
576 | 576 |
577 | 577 |
578 void FullCodeGenerator::Split(Condition cc, | 578 void FullCodeGenerator::Split(Condition cc, |
579 Label* if_true, | 579 Label* if_true, |
580 Label* if_false, | 580 Label* if_false, |
581 Label* fall_through) { | 581 Label* fall_through) { |
582 if (if_false == fall_through) { | 582 if (if_false == fall_through) { |
(...skipping 3669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4252 // And return. | 4252 // And return. |
4253 __ ret(0); | 4253 __ ret(0); |
4254 } | 4254 } |
4255 | 4255 |
4256 | 4256 |
4257 #undef __ | 4257 #undef __ |
4258 | 4258 |
4259 } } // namespace v8::internal | 4259 } } // namespace v8::internal |
4260 | 4260 |
4261 #endif // V8_TARGET_ARCH_IA32 | 4261 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |