OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 } | 553 } |
554 value->set_untagged_int32(false); | 554 value->set_untagged_int32(false); |
555 } | 555 } |
556 | 556 |
557 | 557 |
558 void CodeGenerator::Load(Expression* expr) { | 558 void CodeGenerator::Load(Expression* expr) { |
559 #ifdef DEBUG | 559 #ifdef DEBUG |
560 int original_height = frame_->height(); | 560 int original_height = frame_->height(); |
561 #endif | 561 #endif |
562 ASSERT(!in_spilled_code()); | 562 ASSERT(!in_spilled_code()); |
563 JumpTarget done; | |
564 | 563 |
565 // If the expression should be a side-effect-free 32-bit int computation, | 564 // If the expression should be a side-effect-free 32-bit int computation, |
566 // compile that SafeInt32 path, and a bailout path. | 565 // compile that SafeInt32 path, and a bailout path. |
567 if (!in_safe_int32_mode() && | 566 if (!in_safe_int32_mode() && |
568 safe_int32_mode_enabled() && | 567 safe_int32_mode_enabled() && |
569 expr->side_effect_free() && | 568 expr->side_effect_free() && |
570 expr->num_bit_ops() > 2 && | 569 expr->num_bit_ops() > 2 && |
571 CpuFeatures::IsSupported(SSE2)) { | 570 CpuFeatures::IsSupported(SSE2)) { |
572 BreakTarget unsafe_bailout; | 571 BreakTarget unsafe_bailout; |
| 572 JumpTarget done; |
573 unsafe_bailout.set_expected_height(frame_->height()); | 573 unsafe_bailout.set_expected_height(frame_->height()); |
574 LoadInSafeInt32Mode(expr, &unsafe_bailout); | 574 LoadInSafeInt32Mode(expr, &unsafe_bailout); |
575 done.Jump(); | 575 done.Jump(); |
576 | 576 |
577 if (unsafe_bailout.is_linked()) { | 577 if (unsafe_bailout.is_linked()) { |
578 unsafe_bailout.Bind(); | 578 unsafe_bailout.Bind(); |
579 LoadWithSafeInt32ModeDisabled(expr); | 579 LoadWithSafeInt32ModeDisabled(expr); |
580 } | 580 } |
| 581 done.Bind(); |
581 } else { | 582 } else { |
582 JumpTarget true_target; | 583 JumpTarget true_target; |
583 JumpTarget false_target; | 584 JumpTarget false_target; |
584 | 585 |
585 ControlDestination dest(&true_target, &false_target, true); | 586 ControlDestination dest(&true_target, &false_target, true); |
586 LoadCondition(expr, &dest, false); | 587 LoadCondition(expr, &dest, false); |
587 | 588 |
588 if (dest.false_was_fall_through()) { | 589 if (dest.false_was_fall_through()) { |
589 // The false target was just bound. | 590 // The false target was just bound. |
590 JumpTarget loaded; | 591 JumpTarget loaded; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 } | 627 } |
627 } | 628 } |
628 if (false_target.is_linked()) { | 629 if (false_target.is_linked()) { |
629 false_target.Bind(); | 630 false_target.Bind(); |
630 frame_->Push(Factory::false_value()); | 631 frame_->Push(Factory::false_value()); |
631 } | 632 } |
632 loaded.Bind(); | 633 loaded.Bind(); |
633 } | 634 } |
634 } | 635 } |
635 } | 636 } |
636 done.Bind(); | |
637 ASSERT(has_valid_frame()); | 637 ASSERT(has_valid_frame()); |
638 ASSERT(frame_->height() == original_height + 1); | 638 ASSERT(frame_->height() == original_height + 1); |
639 } | 639 } |
640 | 640 |
641 | 641 |
642 void CodeGenerator::LoadGlobal() { | 642 void CodeGenerator::LoadGlobal() { |
643 if (in_spilled_code()) { | 643 if (in_spilled_code()) { |
644 frame_->EmitPush(GlobalObject()); | 644 frame_->EmitPush(GlobalObject()); |
645 } else { | 645 } else { |
646 Result temp = allocator_->Allocate(); | 646 Result temp = allocator_->Allocate(); |
(...skipping 11546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12193 | 12193 |
12194 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) | 12194 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
12195 // tagged as a small integer. | 12195 // tagged as a small integer. |
12196 __ bind(&runtime); | 12196 __ bind(&runtime); |
12197 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); | 12197 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
12198 } | 12198 } |
12199 | 12199 |
12200 #undef __ | 12200 #undef __ |
12201 | 12201 |
12202 } } // namespace v8::internal | 12202 } } // namespace v8::internal |
OLD | NEW |