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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 } else { | 557 } else { |
558 if (false_label_ != fall_through_) __ jmp(false_label_); | 558 if (false_label_ != fall_through_) __ jmp(false_label_); |
559 } | 559 } |
560 } | 560 } |
561 | 561 |
562 | 562 |
563 void FullCodeGenerator::DoTest(Expression* condition, | 563 void FullCodeGenerator::DoTest(Expression* condition, |
564 Label* if_true, | 564 Label* if_true, |
565 Label* if_false, | 565 Label* if_false, |
566 Label* fall_through) { | 566 Label* fall_through) { |
567 ToBooleanStub stub; | 567 ToBooleanStub stub(result_register()); |
568 __ push(result_register()); | 568 __ push(result_register()); |
569 __ CallStub(&stub); | 569 __ CallStub(&stub); |
570 __ testq(rax, rax); | 570 __ testq(result_register(), result_register()); |
571 // The stub returns nonzero for true. | 571 // The stub returns nonzero for true. |
572 Split(not_zero, if_true, if_false, fall_through); | 572 Split(not_zero, if_true, if_false, fall_through); |
573 } | 573 } |
574 | 574 |
575 | 575 |
576 void FullCodeGenerator::Split(Condition cc, | 576 void FullCodeGenerator::Split(Condition cc, |
577 Label* if_true, | 577 Label* if_true, |
578 Label* if_false, | 578 Label* if_false, |
579 Label* fall_through) { | 579 Label* fall_through) { |
580 if (if_false == fall_through) { | 580 if (if_false == fall_through) { |
(...skipping 3653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4234 __ ret(0); | 4234 __ ret(0); |
4235 } | 4235 } |
4236 | 4236 |
4237 | 4237 |
4238 #undef __ | 4238 #undef __ |
4239 | 4239 |
4240 | 4240 |
4241 } } // namespace v8::internal | 4241 } } // namespace v8::internal |
4242 | 4242 |
4243 #endif // V8_TARGET_ARCH_X64 | 4243 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |