Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Side by Side Diff: src/mips64/lithium-mips64.cc

Issue 430503007: Rename ASSERT* to DCHECK*. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE and fixes Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mips64/lithium-mips64.h ('k') | src/mips64/macro-assembler-mips64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_MIPS64 7 #if V8_TARGET_ARCH_MIPS64
8 8
9 #include "src/hydrogen-osr.h" 9 #include "src/hydrogen-osr.h"
10 #include "src/lithium-inl.h" 10 #include "src/lithium-inl.h"
11 #include "src/mips64/lithium-codegen-mips64.h" 11 #include "src/mips64/lithium-codegen-mips64.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 15
16 #define DEFINE_COMPILE(type) \ 16 #define DEFINE_COMPILE(type) \
17 void L##type::CompileToNative(LCodeGen* generator) { \ 17 void L##type::CompileToNative(LCodeGen* generator) { \
18 generator->Do##type(this); \ 18 generator->Do##type(this); \
19 } 19 }
20 LITHIUM_CONCRETE_INSTRUCTION_LIST(DEFINE_COMPILE) 20 LITHIUM_CONCRETE_INSTRUCTION_LIST(DEFINE_COMPILE)
21 #undef DEFINE_COMPILE 21 #undef DEFINE_COMPILE
22 22
23 #ifdef DEBUG 23 #ifdef DEBUG
24 void LInstruction::VerifyCall() { 24 void LInstruction::VerifyCall() {
25 // Call instructions can use only fixed registers as temporaries and 25 // Call instructions can use only fixed registers as temporaries and
26 // outputs because all registers are blocked by the calling convention. 26 // outputs because all registers are blocked by the calling convention.
27 // Inputs operands must use a fixed register or use-at-start policy or 27 // Inputs operands must use a fixed register or use-at-start policy or
28 // a non-register policy. 28 // a non-register policy.
29 ASSERT(Output() == NULL || 29 DCHECK(Output() == NULL ||
30 LUnallocated::cast(Output())->HasFixedPolicy() || 30 LUnallocated::cast(Output())->HasFixedPolicy() ||
31 !LUnallocated::cast(Output())->HasRegisterPolicy()); 31 !LUnallocated::cast(Output())->HasRegisterPolicy());
32 for (UseIterator it(this); !it.Done(); it.Advance()) { 32 for (UseIterator it(this); !it.Done(); it.Advance()) {
33 LUnallocated* operand = LUnallocated::cast(it.Current()); 33 LUnallocated* operand = LUnallocated::cast(it.Current());
34 ASSERT(operand->HasFixedPolicy() || 34 DCHECK(operand->HasFixedPolicy() ||
35 operand->IsUsedAtStart()); 35 operand->IsUsedAtStart());
36 } 36 }
37 for (TempIterator it(this); !it.Done(); it.Advance()) { 37 for (TempIterator it(this); !it.Done(); it.Advance()) {
38 LUnallocated* operand = LUnallocated::cast(it.Current()); 38 LUnallocated* operand = LUnallocated::cast(it.Current());
39 ASSERT(operand->HasFixedPolicy() ||!operand->HasRegisterPolicy()); 39 DCHECK(operand->HasFixedPolicy() ||!operand->HasRegisterPolicy());
40 } 40 }
41 } 41 }
42 #endif 42 #endif
43 43
44 44
45 void LInstruction::PrintTo(StringStream* stream) { 45 void LInstruction::PrintTo(StringStream* stream) {
46 stream->Add("%s ", this->Mnemonic()); 46 stream->Add("%s ", this->Mnemonic());
47 47
48 PrintOutputOperandTo(stream); 48 PrintOutputOperandTo(stream);
49 49
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 elements()->PrintTo(stream); 355 elements()->PrintTo(stream);
356 stream->Add("["); 356 stream->Add("[");
357 key()->PrintTo(stream); 357 key()->PrintTo(stream);
358 if (hydrogen()->IsDehoisted()) { 358 if (hydrogen()->IsDehoisted()) {
359 stream->Add(" + %d] <-", base_offset()); 359 stream->Add(" + %d] <-", base_offset());
360 } else { 360 } else {
361 stream->Add("] <- "); 361 stream->Add("] <- ");
362 } 362 }
363 363
364 if (value() == NULL) { 364 if (value() == NULL) {
365 ASSERT(hydrogen()->IsConstantHoleStore() && 365 DCHECK(hydrogen()->IsConstantHoleStore() &&
366 hydrogen()->value()->representation().IsDouble()); 366 hydrogen()->value()->representation().IsDouble());
367 stream->Add("<the hole(nan)>"); 367 stream->Add("<the hole(nan)>");
368 } else { 368 } else {
369 value()->PrintTo(stream); 369 value()->PrintTo(stream);
370 } 370 }
371 } 371 }
372 372
373 373
374 void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) { 374 void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) {
375 object()->PrintTo(stream); 375 object()->PrintTo(stream);
(...skipping 15 matching lines...) Expand all
391 if (kind == DOUBLE_REGISTERS) spill_slot_count_++; 391 if (kind == DOUBLE_REGISTERS) spill_slot_count_++;
392 return spill_slot_count_++; 392 return spill_slot_count_++;
393 } 393 }
394 394
395 395
396 LOperand* LPlatformChunk::GetNextSpillSlot(RegisterKind kind) { 396 LOperand* LPlatformChunk::GetNextSpillSlot(RegisterKind kind) {
397 int index = GetNextSpillIndex(kind); 397 int index = GetNextSpillIndex(kind);
398 if (kind == DOUBLE_REGISTERS) { 398 if (kind == DOUBLE_REGISTERS) {
399 return LDoubleStackSlot::Create(index, zone()); 399 return LDoubleStackSlot::Create(index, zone());
400 } else { 400 } else {
401 ASSERT(kind == GENERAL_REGISTERS); 401 DCHECK(kind == GENERAL_REGISTERS);
402 return LStackSlot::Create(index, zone()); 402 return LStackSlot::Create(index, zone());
403 } 403 }
404 } 404 }
405 405
406 406
407 LPlatformChunk* LChunkBuilder::Build() { 407 LPlatformChunk* LChunkBuilder::Build() {
408 ASSERT(is_unused()); 408 DCHECK(is_unused());
409 chunk_ = new(zone()) LPlatformChunk(info(), graph()); 409 chunk_ = new(zone()) LPlatformChunk(info(), graph());
410 LPhase phase("L_Building chunk", chunk_); 410 LPhase phase("L_Building chunk", chunk_);
411 status_ = BUILDING; 411 status_ = BUILDING;
412 412
413 // If compiling for OSR, reserve space for the unoptimized frame, 413 // If compiling for OSR, reserve space for the unoptimized frame,
414 // which will be subsumed into this frame. 414 // which will be subsumed into this frame.
415 if (graph()->has_osr()) { 415 if (graph()->has_osr()) {
416 for (int i = graph()->osr()->UnoptimizedFrameSlots(); i > 0; i--) { 416 for (int i = graph()->osr()->UnoptimizedFrameSlots(); i > 0; i--) {
417 chunk_->GetNextSpillIndex(GENERAL_REGISTERS); 417 chunk_->GetNextSpillIndex(GENERAL_REGISTERS);
418 } 418 }
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 instr = AssignEnvironment(instr); 609 instr = AssignEnvironment(instr);
610 // We can't really figure out if the environment is needed or not. 610 // We can't really figure out if the environment is needed or not.
611 instr->environment()->set_has_been_used(); 611 instr->environment()->set_has_been_used();
612 } 612 }
613 613
614 return instr; 614 return instr;
615 } 615 }
616 616
617 617
618 LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) { 618 LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) {
619 ASSERT(!instr->HasPointerMap()); 619 DCHECK(!instr->HasPointerMap());
620 instr->set_pointer_map(new(zone()) LPointerMap(zone())); 620 instr->set_pointer_map(new(zone()) LPointerMap(zone()));
621 return instr; 621 return instr;
622 } 622 }
623 623
624 624
625 LUnallocated* LChunkBuilder::TempRegister() { 625 LUnallocated* LChunkBuilder::TempRegister() {
626 LUnallocated* operand = 626 LUnallocated* operand =
627 new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER); 627 new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER);
628 int vreg = allocator_->GetVirtualRegister(); 628 int vreg = allocator_->GetVirtualRegister();
629 if (!allocator_->AllocationOk()) { 629 if (!allocator_->AllocationOk()) {
(...skipping 13 matching lines...) Expand all
643 Abort(kOutOfVirtualRegistersWhileTryingToAllocateTempRegister); 643 Abort(kOutOfVirtualRegistersWhileTryingToAllocateTempRegister);
644 vreg = 0; 644 vreg = 0;
645 } 645 }
646 operand->set_virtual_register(vreg); 646 operand->set_virtual_register(vreg);
647 return operand; 647 return operand;
648 } 648 }
649 649
650 650
651 LOperand* LChunkBuilder::FixedTemp(Register reg) { 651 LOperand* LChunkBuilder::FixedTemp(Register reg) {
652 LUnallocated* operand = ToUnallocated(reg); 652 LUnallocated* operand = ToUnallocated(reg);
653 ASSERT(operand->HasFixedPolicy()); 653 DCHECK(operand->HasFixedPolicy());
654 return operand; 654 return operand;
655 } 655 }
656 656
657 657
658 LOperand* LChunkBuilder::FixedTemp(DoubleRegister reg) { 658 LOperand* LChunkBuilder::FixedTemp(DoubleRegister reg) {
659 LUnallocated* operand = ToUnallocated(reg); 659 LUnallocated* operand = ToUnallocated(reg);
660 ASSERT(operand->HasFixedPolicy()); 660 DCHECK(operand->HasFixedPolicy());
661 return operand; 661 return operand;
662 } 662 }
663 663
664 664
665 LInstruction* LChunkBuilder::DoBlockEntry(HBlockEntry* instr) { 665 LInstruction* LChunkBuilder::DoBlockEntry(HBlockEntry* instr) {
666 return new(zone()) LLabel(instr->block()); 666 return new(zone()) LLabel(instr->block());
667 } 667 }
668 668
669 669
670 LInstruction* LChunkBuilder::DoDummyUse(HDummyUse* instr) { 670 LInstruction* LChunkBuilder::DoDummyUse(HDummyUse* instr) {
671 return DefineAsRegister(new(zone()) LDummyUse(UseAny(instr->value()))); 671 return DefineAsRegister(new(zone()) LDummyUse(UseAny(instr->value())));
672 } 672 }
673 673
674 674
675 LInstruction* LChunkBuilder::DoEnvironmentMarker(HEnvironmentMarker* instr) { 675 LInstruction* LChunkBuilder::DoEnvironmentMarker(HEnvironmentMarker* instr) {
676 UNREACHABLE(); 676 UNREACHABLE();
677 return NULL; 677 return NULL;
678 } 678 }
679 679
680 680
681 LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) { 681 LInstruction* LChunkBuilder::DoDeoptimize(HDeoptimize* instr) {
682 return AssignEnvironment(new(zone()) LDeoptimize); 682 return AssignEnvironment(new(zone()) LDeoptimize);
683 } 683 }
684 684
685 685
686 LInstruction* LChunkBuilder::DoShift(Token::Value op, 686 LInstruction* LChunkBuilder::DoShift(Token::Value op,
687 HBitwiseBinaryOperation* instr) { 687 HBitwiseBinaryOperation* instr) {
688 if (instr->representation().IsSmiOrInteger32()) { 688 if (instr->representation().IsSmiOrInteger32()) {
689 ASSERT(instr->left()->representation().Equals(instr->representation())); 689 DCHECK(instr->left()->representation().Equals(instr->representation()));
690 ASSERT(instr->right()->representation().Equals(instr->representation())); 690 DCHECK(instr->right()->representation().Equals(instr->representation()));
691 LOperand* left = UseRegisterAtStart(instr->left()); 691 LOperand* left = UseRegisterAtStart(instr->left());
692 692
693 HValue* right_value = instr->right(); 693 HValue* right_value = instr->right();
694 LOperand* right = NULL; 694 LOperand* right = NULL;
695 int constant_value = 0; 695 int constant_value = 0;
696 bool does_deopt = false; 696 bool does_deopt = false;
697 if (right_value->IsConstant()) { 697 if (right_value->IsConstant()) {
698 HConstant* constant = HConstant::cast(right_value); 698 HConstant* constant = HConstant::cast(right_value);
699 right = chunk_->DefineConstantOperand(constant); 699 right = chunk_->DefineConstantOperand(constant);
700 constant_value = constant->Integer32Value() & 0x1f; 700 constant_value = constant->Integer32Value() & 0x1f;
(...skipping 20 matching lines...) Expand all
721 DefineAsRegister(new(zone()) LShiftI(op, left, right, does_deopt)); 721 DefineAsRegister(new(zone()) LShiftI(op, left, right, does_deopt));
722 return does_deopt ? AssignEnvironment(result) : result; 722 return does_deopt ? AssignEnvironment(result) : result;
723 } else { 723 } else {
724 return DoArithmeticT(op, instr); 724 return DoArithmeticT(op, instr);
725 } 725 }
726 } 726 }
727 727
728 728
729 LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op, 729 LInstruction* LChunkBuilder::DoArithmeticD(Token::Value op,
730 HArithmeticBinaryOperation* instr) { 730 HArithmeticBinaryOperation* instr) {
731 ASSERT(instr->representation().IsDouble()); 731 DCHECK(instr->representation().IsDouble());
732 ASSERT(instr->left()->representation().IsDouble()); 732 DCHECK(instr->left()->representation().IsDouble());
733 ASSERT(instr->right()->representation().IsDouble()); 733 DCHECK(instr->right()->representation().IsDouble());
734 if (op == Token::MOD) { 734 if (op == Token::MOD) {
735 LOperand* left = UseFixedDouble(instr->left(), f2); 735 LOperand* left = UseFixedDouble(instr->left(), f2);
736 LOperand* right = UseFixedDouble(instr->right(), f4); 736 LOperand* right = UseFixedDouble(instr->right(), f4);
737 LArithmeticD* result = new(zone()) LArithmeticD(op, left, right); 737 LArithmeticD* result = new(zone()) LArithmeticD(op, left, right);
738 // We call a C function for double modulo. It can't trigger a GC. We need 738 // We call a C function for double modulo. It can't trigger a GC. We need
739 // to use fixed result register for the call. 739 // to use fixed result register for the call.
740 // TODO(fschneider): Allow any register as input registers. 740 // TODO(fschneider): Allow any register as input registers.
741 return MarkAsCall(DefineFixedDouble(result, f2), instr); 741 return MarkAsCall(DefineFixedDouble(result, f2), instr);
742 } else { 742 } else {
743 LOperand* left = UseRegisterAtStart(instr->left()); 743 LOperand* left = UseRegisterAtStart(instr->left());
744 LOperand* right = UseRegisterAtStart(instr->right()); 744 LOperand* right = UseRegisterAtStart(instr->right());
745 LArithmeticD* result = new(zone()) LArithmeticD(op, left, right); 745 LArithmeticD* result = new(zone()) LArithmeticD(op, left, right);
746 return DefineAsRegister(result); 746 return DefineAsRegister(result);
747 } 747 }
748 } 748 }
749 749
750 750
751 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, 751 LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op,
752 HBinaryOperation* instr) { 752 HBinaryOperation* instr) {
753 HValue* left = instr->left(); 753 HValue* left = instr->left();
754 HValue* right = instr->right(); 754 HValue* right = instr->right();
755 ASSERT(left->representation().IsTagged()); 755 DCHECK(left->representation().IsTagged());
756 ASSERT(right->representation().IsTagged()); 756 DCHECK(right->representation().IsTagged());
757 LOperand* context = UseFixed(instr->context(), cp); 757 LOperand* context = UseFixed(instr->context(), cp);
758 LOperand* left_operand = UseFixed(left, a1); 758 LOperand* left_operand = UseFixed(left, a1);
759 LOperand* right_operand = UseFixed(right, a0); 759 LOperand* right_operand = UseFixed(right, a0);
760 LArithmeticT* result = 760 LArithmeticT* result =
761 new(zone()) LArithmeticT(op, context, left_operand, right_operand); 761 new(zone()) LArithmeticT(op, context, left_operand, right_operand);
762 return MarkAsCall(DefineFixed(result, v0), instr); 762 return MarkAsCall(DefineFixed(result, v0), instr);
763 } 763 }
764 764
765 765
766 void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) { 766 void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) {
767 ASSERT(is_building()); 767 DCHECK(is_building());
768 current_block_ = block; 768 current_block_ = block;
769 next_block_ = next_block; 769 next_block_ = next_block;
770 if (block->IsStartBlock()) { 770 if (block->IsStartBlock()) {
771 block->UpdateEnvironment(graph_->start_environment()); 771 block->UpdateEnvironment(graph_->start_environment());
772 argument_count_ = 0; 772 argument_count_ = 0;
773 } else if (block->predecessors()->length() == 1) { 773 } else if (block->predecessors()->length() == 1) {
774 // We have a single predecessor => copy environment and outgoing 774 // We have a single predecessor => copy environment and outgoing
775 // argument count from the predecessor. 775 // argument count from the predecessor.
776 ASSERT(block->phis()->length() == 0); 776 DCHECK(block->phis()->length() == 0);
777 HBasicBlock* pred = block->predecessors()->at(0); 777 HBasicBlock* pred = block->predecessors()->at(0);
778 HEnvironment* last_environment = pred->last_environment(); 778 HEnvironment* last_environment = pred->last_environment();
779 ASSERT(last_environment != NULL); 779 DCHECK(last_environment != NULL);
780 // Only copy the environment, if it is later used again. 780 // Only copy the environment, if it is later used again.
781 if (pred->end()->SecondSuccessor() == NULL) { 781 if (pred->end()->SecondSuccessor() == NULL) {
782 ASSERT(pred->end()->FirstSuccessor() == block); 782 DCHECK(pred->end()->FirstSuccessor() == block);
783 } else { 783 } else {
784 if (pred->end()->FirstSuccessor()->block_id() > block->block_id() || 784 if (pred->end()->FirstSuccessor()->block_id() > block->block_id() ||
785 pred->end()->SecondSuccessor()->block_id() > block->block_id()) { 785 pred->end()->SecondSuccessor()->block_id() > block->block_id()) {
786 last_environment = last_environment->Copy(); 786 last_environment = last_environment->Copy();
787 } 787 }
788 } 788 }
789 block->UpdateEnvironment(last_environment); 789 block->UpdateEnvironment(last_environment);
790 ASSERT(pred->argument_count() >= 0); 790 DCHECK(pred->argument_count() >= 0);
791 argument_count_ = pred->argument_count(); 791 argument_count_ = pred->argument_count();
792 } else { 792 } else {
793 // We are at a state join => process phis. 793 // We are at a state join => process phis.
794 HBasicBlock* pred = block->predecessors()->at(0); 794 HBasicBlock* pred = block->predecessors()->at(0);
795 // No need to copy the environment, it cannot be used later. 795 // No need to copy the environment, it cannot be used later.
796 HEnvironment* last_environment = pred->last_environment(); 796 HEnvironment* last_environment = pred->last_environment();
797 for (int i = 0; i < block->phis()->length(); ++i) { 797 for (int i = 0; i < block->phis()->length(); ++i) {
798 HPhi* phi = block->phis()->at(i); 798 HPhi* phi = block->phis()->at(i);
799 if (phi->HasMergedIndex()) { 799 if (phi->HasMergedIndex()) {
800 last_environment->SetValueAt(phi->merged_index(), phi); 800 last_environment->SetValueAt(phi->merged_index(), phi);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 832
833 void LChunkBuilder::VisitInstruction(HInstruction* current) { 833 void LChunkBuilder::VisitInstruction(HInstruction* current) {
834 HInstruction* old_current = current_instruction_; 834 HInstruction* old_current = current_instruction_;
835 current_instruction_ = current; 835 current_instruction_ = current;
836 836
837 LInstruction* instr = NULL; 837 LInstruction* instr = NULL;
838 if (current->CanReplaceWithDummyUses()) { 838 if (current->CanReplaceWithDummyUses()) {
839 if (current->OperandCount() == 0) { 839 if (current->OperandCount() == 0) {
840 instr = DefineAsRegister(new(zone()) LDummy()); 840 instr = DefineAsRegister(new(zone()) LDummy());
841 } else { 841 } else {
842 ASSERT(!current->OperandAt(0)->IsControlInstruction()); 842 DCHECK(!current->OperandAt(0)->IsControlInstruction());
843 instr = DefineAsRegister(new(zone()) 843 instr = DefineAsRegister(new(zone())
844 LDummyUse(UseAny(current->OperandAt(0)))); 844 LDummyUse(UseAny(current->OperandAt(0))));
845 } 845 }
846 for (int i = 1; i < current->OperandCount(); ++i) { 846 for (int i = 1; i < current->OperandCount(); ++i) {
847 if (current->OperandAt(i)->IsControlInstruction()) continue; 847 if (current->OperandAt(i)->IsControlInstruction()) continue;
848 LInstruction* dummy = 848 LInstruction* dummy =
849 new(zone()) LDummyUse(UseAny(current->OperandAt(i))); 849 new(zone()) LDummyUse(UseAny(current->OperandAt(i)));
850 dummy->set_hydrogen_value(current); 850 dummy->set_hydrogen_value(current);
851 chunk_->AddInstruction(dummy, current_block_); 851 chunk_->AddInstruction(dummy, current_block_);
852 } 852 }
853 } else { 853 } else {
854 HBasicBlock* successor; 854 HBasicBlock* successor;
855 if (current->IsControlInstruction() && 855 if (current->IsControlInstruction() &&
856 HControlInstruction::cast(current)->KnownSuccessorBlock(&successor) && 856 HControlInstruction::cast(current)->KnownSuccessorBlock(&successor) &&
857 successor != NULL) { 857 successor != NULL) {
858 instr = new(zone()) LGoto(successor); 858 instr = new(zone()) LGoto(successor);
859 } else { 859 } else {
860 instr = current->CompileToLithium(this); 860 instr = current->CompileToLithium(this);
861 } 861 }
862 } 862 }
863 863
864 argument_count_ += current->argument_delta(); 864 argument_count_ += current->argument_delta();
865 ASSERT(argument_count_ >= 0); 865 DCHECK(argument_count_ >= 0);
866 866
867 if (instr != NULL) { 867 if (instr != NULL) {
868 AddInstruction(instr, current); 868 AddInstruction(instr, current);
869 } 869 }
870 870
871 current_instruction_ = old_current; 871 current_instruction_ = old_current;
872 } 872 }
873 873
874 874
875 void LChunkBuilder::AddInstruction(LInstruction* instr, 875 void LChunkBuilder::AddInstruction(LInstruction* instr,
(...skipping 21 matching lines...) Expand all
897 LUnallocated* operand = LUnallocated::cast(it.Current()); 897 LUnallocated* operand = LUnallocated::cast(it.Current());
898 if (operand->IsUsedAtStart()) ++used_at_start; 898 if (operand->IsUsedAtStart()) ++used_at_start;
899 } 899 }
900 if (instr->Output() != NULL) { 900 if (instr->Output() != NULL) {
901 if (LUnallocated::cast(instr->Output())->HasFixedPolicy()) ++fixed; 901 if (LUnallocated::cast(instr->Output())->HasFixedPolicy()) ++fixed;
902 } 902 }
903 for (TempIterator it(instr); !it.Done(); it.Advance()) { 903 for (TempIterator it(instr); !it.Done(); it.Advance()) {
904 LUnallocated* operand = LUnallocated::cast(it.Current()); 904 LUnallocated* operand = LUnallocated::cast(it.Current());
905 if (operand->HasFixedPolicy()) ++fixed; 905 if (operand->HasFixedPolicy()) ++fixed;
906 } 906 }
907 ASSERT(fixed == 0 || used_at_start == 0); 907 DCHECK(fixed == 0 || used_at_start == 0);
908 } 908 }
909 #endif 909 #endif
910 910
911 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { 911 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) {
912 instr = AssignPointerMap(instr); 912 instr = AssignPointerMap(instr);
913 } 913 }
914 if (FLAG_stress_environments && !instr->HasEnvironment()) { 914 if (FLAG_stress_environments && !instr->HasEnvironment()) {
915 instr = AssignEnvironment(instr); 915 instr = AssignEnvironment(instr);
916 } 916 }
917 chunk_->AddInstruction(instr, current_block_); 917 chunk_->AddInstruction(instr, current_block_);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 if (!easy_case && 956 if (!easy_case &&
957 ((!expected.Contains(ToBooleanStub::SMI) && expected.NeedsMap()) || 957 ((!expected.Contains(ToBooleanStub::SMI) && expected.NeedsMap()) ||
958 !expected.IsGeneric())) { 958 !expected.IsGeneric())) {
959 branch = AssignEnvironment(branch); 959 branch = AssignEnvironment(branch);
960 } 960 }
961 return branch; 961 return branch;
962 } 962 }
963 963
964 964
965 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { 965 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) {
966 ASSERT(instr->value()->representation().IsTagged()); 966 DCHECK(instr->value()->representation().IsTagged());
967 LOperand* value = UseRegisterAtStart(instr->value()); 967 LOperand* value = UseRegisterAtStart(instr->value());
968 LOperand* temp = TempRegister(); 968 LOperand* temp = TempRegister();
969 return new(zone()) LCmpMapAndBranch(value, temp); 969 return new(zone()) LCmpMapAndBranch(value, temp);
970 } 970 }
971 971
972 972
973 LInstruction* LChunkBuilder::DoArgumentsLength(HArgumentsLength* length) { 973 LInstruction* LChunkBuilder::DoArgumentsLength(HArgumentsLength* length) {
974 info()->MarkAsRequiresFrame(); 974 info()->MarkAsRequiresFrame();
975 return DefineAsRegister( 975 return DefineAsRegister(
976 new(zone()) LArgumentsLength(UseRegister(length->value()))); 976 new(zone()) LArgumentsLength(UseRegister(length->value())));
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 case kMathClz32: 1133 case kMathClz32:
1134 return DoMathClz32(instr); 1134 return DoMathClz32(instr);
1135 default: 1135 default:
1136 UNREACHABLE(); 1136 UNREACHABLE();
1137 return NULL; 1137 return NULL;
1138 } 1138 }
1139 } 1139 }
1140 1140
1141 1141
1142 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) { 1142 LInstruction* LChunkBuilder::DoMathLog(HUnaryMathOperation* instr) {
1143 ASSERT(instr->representation().IsDouble()); 1143 DCHECK(instr->representation().IsDouble());
1144 ASSERT(instr->value()->representation().IsDouble()); 1144 DCHECK(instr->value()->representation().IsDouble());
1145 LOperand* input = UseFixedDouble(instr->value(), f4); 1145 LOperand* input = UseFixedDouble(instr->value(), f4);
1146 return MarkAsCall(DefineFixedDouble(new(zone()) LMathLog(input), f4), instr); 1146 return MarkAsCall(DefineFixedDouble(new(zone()) LMathLog(input), f4), instr);
1147 } 1147 }
1148 1148
1149 1149
1150 LInstruction* LChunkBuilder::DoMathClz32(HUnaryMathOperation* instr) { 1150 LInstruction* LChunkBuilder::DoMathClz32(HUnaryMathOperation* instr) {
1151 LOperand* input = UseRegisterAtStart(instr->value()); 1151 LOperand* input = UseRegisterAtStart(instr->value());
1152 LMathClz32* result = new(zone()) LMathClz32(input); 1152 LMathClz32* result = new(zone()) LMathClz32(input);
1153 return DefineAsRegister(result); 1153 return DefineAsRegister(result);
1154 } 1154 }
1155 1155
1156 1156
1157 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) { 1157 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) {
1158 ASSERT(instr->representation().IsDouble()); 1158 DCHECK(instr->representation().IsDouble());
1159 ASSERT(instr->value()->representation().IsDouble()); 1159 DCHECK(instr->value()->representation().IsDouble());
1160 LOperand* input = UseRegister(instr->value()); 1160 LOperand* input = UseRegister(instr->value());
1161 LOperand* temp1 = TempRegister(); 1161 LOperand* temp1 = TempRegister();
1162 LOperand* temp2 = TempRegister(); 1162 LOperand* temp2 = TempRegister();
1163 LOperand* double_temp = TempDoubleRegister(); 1163 LOperand* double_temp = TempDoubleRegister();
1164 LMathExp* result = new(zone()) LMathExp(input, double_temp, temp1, temp2); 1164 LMathExp* result = new(zone()) LMathExp(input, double_temp, temp1, temp2);
1165 return DefineAsRegister(result); 1165 return DefineAsRegister(result);
1166 } 1166 }
1167 1167
1168 1168
1169 LInstruction* LChunkBuilder::DoMathPowHalf(HUnaryMathOperation* instr) { 1169 LInstruction* LChunkBuilder::DoMathPowHalf(HUnaryMathOperation* instr) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
1264 } 1264 }
1265 1265
1266 1266
1267 LInstruction* LChunkBuilder::DoShl(HShl* instr) { 1267 LInstruction* LChunkBuilder::DoShl(HShl* instr) {
1268 return DoShift(Token::SHL, instr); 1268 return DoShift(Token::SHL, instr);
1269 } 1269 }
1270 1270
1271 1271
1272 LInstruction* LChunkBuilder::DoBitwise(HBitwise* instr) { 1272 LInstruction* LChunkBuilder::DoBitwise(HBitwise* instr) {
1273 if (instr->representation().IsSmiOrInteger32()) { 1273 if (instr->representation().IsSmiOrInteger32()) {
1274 ASSERT(instr->left()->representation().Equals(instr->representation())); 1274 DCHECK(instr->left()->representation().Equals(instr->representation()));
1275 ASSERT(instr->right()->representation().Equals(instr->representation())); 1275 DCHECK(instr->right()->representation().Equals(instr->representation()));
1276 ASSERT(instr->CheckFlag(HValue::kTruncatingToInt32)); 1276 DCHECK(instr->CheckFlag(HValue::kTruncatingToInt32));
1277 1277
1278 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); 1278 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand());
1279 LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand()); 1279 LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand());
1280 return DefineAsRegister(new(zone()) LBitI(left, right)); 1280 return DefineAsRegister(new(zone()) LBitI(left, right));
1281 } else { 1281 } else {
1282 return DoArithmeticT(instr->op(), instr); 1282 return DoArithmeticT(instr->op(), instr);
1283 } 1283 }
1284 } 1284 }
1285 1285
1286 1286
1287 LInstruction* LChunkBuilder::DoDivByPowerOf2I(HDiv* instr) { 1287 LInstruction* LChunkBuilder::DoDivByPowerOf2I(HDiv* instr) {
1288 ASSERT(instr->representation().IsSmiOrInteger32()); 1288 DCHECK(instr->representation().IsSmiOrInteger32());
1289 ASSERT(instr->left()->representation().Equals(instr->representation())); 1289 DCHECK(instr->left()->representation().Equals(instr->representation()));
1290 ASSERT(instr->right()->representation().Equals(instr->representation())); 1290 DCHECK(instr->right()->representation().Equals(instr->representation()));
1291 LOperand* dividend = UseRegister(instr->left()); 1291 LOperand* dividend = UseRegister(instr->left());
1292 int32_t divisor = instr->right()->GetInteger32Constant(); 1292 int32_t divisor = instr->right()->GetInteger32Constant();
1293 LInstruction* result = DefineAsRegister(new(zone()) LDivByPowerOf2I( 1293 LInstruction* result = DefineAsRegister(new(zone()) LDivByPowerOf2I(
1294 dividend, divisor)); 1294 dividend, divisor));
1295 if ((instr->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) || 1295 if ((instr->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) ||
1296 (instr->CheckFlag(HValue::kCanOverflow) && divisor == -1) || 1296 (instr->CheckFlag(HValue::kCanOverflow) && divisor == -1) ||
1297 (!instr->CheckFlag(HInstruction::kAllUsesTruncatingToInt32) && 1297 (!instr->CheckFlag(HInstruction::kAllUsesTruncatingToInt32) &&
1298 divisor != 1 && divisor != -1)) { 1298 divisor != 1 && divisor != -1)) {
1299 result = AssignEnvironment(result); 1299 result = AssignEnvironment(result);
1300 } 1300 }
1301 return result; 1301 return result;
1302 } 1302 }
1303 1303
1304 1304
1305 LInstruction* LChunkBuilder::DoDivByConstI(HDiv* instr) { 1305 LInstruction* LChunkBuilder::DoDivByConstI(HDiv* instr) {
1306 ASSERT(instr->representation().IsInteger32()); 1306 DCHECK(instr->representation().IsInteger32());
1307 ASSERT(instr->left()->representation().Equals(instr->representation())); 1307 DCHECK(instr->left()->representation().Equals(instr->representation()));
1308 ASSERT(instr->right()->representation().Equals(instr->representation())); 1308 DCHECK(instr->right()->representation().Equals(instr->representation()));
1309 LOperand* dividend = UseRegister(instr->left()); 1309 LOperand* dividend = UseRegister(instr->left());
1310 int32_t divisor = instr->right()->GetInteger32Constant(); 1310 int32_t divisor = instr->right()->GetInteger32Constant();
1311 LInstruction* result = DefineAsRegister(new(zone()) LDivByConstI( 1311 LInstruction* result = DefineAsRegister(new(zone()) LDivByConstI(
1312 dividend, divisor)); 1312 dividend, divisor));
1313 if (divisor == 0 || 1313 if (divisor == 0 ||
1314 (instr->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) || 1314 (instr->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) ||
1315 !instr->CheckFlag(HInstruction::kAllUsesTruncatingToInt32)) { 1315 !instr->CheckFlag(HInstruction::kAllUsesTruncatingToInt32)) {
1316 result = AssignEnvironment(result); 1316 result = AssignEnvironment(result);
1317 } 1317 }
1318 return result; 1318 return result;
1319 } 1319 }
1320 1320
1321 1321
1322 LInstruction* LChunkBuilder::DoDivI(HDiv* instr) { 1322 LInstruction* LChunkBuilder::DoDivI(HDiv* instr) {
1323 ASSERT(instr->representation().IsSmiOrInteger32()); 1323 DCHECK(instr->representation().IsSmiOrInteger32());
1324 ASSERT(instr->left()->representation().Equals(instr->representation())); 1324 DCHECK(instr->left()->representation().Equals(instr->representation()));
1325 ASSERT(instr->right()->representation().Equals(instr->representation())); 1325 DCHECK(instr->right()->representation().Equals(instr->representation()));
1326 LOperand* dividend = UseRegister(instr->left()); 1326 LOperand* dividend = UseRegister(instr->left());
1327 LOperand* divisor = UseRegister(instr->right()); 1327 LOperand* divisor = UseRegister(instr->right());
1328 LOperand* temp = instr->CheckFlag(HInstruction::kAllUsesTruncatingToInt32) 1328 LOperand* temp = instr->CheckFlag(HInstruction::kAllUsesTruncatingToInt32)
1329 ? NULL : TempRegister(); 1329 ? NULL : TempRegister();
1330 LInstruction* result = 1330 LInstruction* result =
1331 DefineAsRegister(new(zone()) LDivI(dividend, divisor, temp)); 1331 DefineAsRegister(new(zone()) LDivI(dividend, divisor, temp));
1332 if (instr->CheckFlag(HValue::kCanBeDivByZero) || 1332 if (instr->CheckFlag(HValue::kCanBeDivByZero) ||
1333 instr->CheckFlag(HValue::kBailoutOnMinusZero) || 1333 instr->CheckFlag(HValue::kBailoutOnMinusZero) ||
1334 (instr->CheckFlag(HValue::kCanOverflow) && 1334 (instr->CheckFlag(HValue::kCanOverflow) &&
1335 !instr->CheckFlag(HValue::kAllUsesTruncatingToInt32)) || 1335 !instr->CheckFlag(HValue::kAllUsesTruncatingToInt32)) ||
(...skipping 29 matching lines...) Expand all
1365 dividend, divisor)); 1365 dividend, divisor));
1366 if ((instr->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) || 1366 if ((instr->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0) ||
1367 (instr->CheckFlag(HValue::kLeftCanBeMinInt) && divisor == -1)) { 1367 (instr->CheckFlag(HValue::kLeftCanBeMinInt) && divisor == -1)) {
1368 result = AssignEnvironment(result); 1368 result = AssignEnvironment(result);
1369 } 1369 }
1370 return result; 1370 return result;
1371 } 1371 }
1372 1372
1373 1373
1374 LInstruction* LChunkBuilder::DoFlooringDivByConstI(HMathFloorOfDiv* instr) { 1374 LInstruction* LChunkBuilder::DoFlooringDivByConstI(HMathFloorOfDiv* instr) {
1375 ASSERT(instr->representation().IsInteger32()); 1375 DCHECK(instr->representation().IsInteger32());
1376 ASSERT(instr->left()->representation().Equals(instr->representation())); 1376 DCHECK(instr->left()->representation().Equals(instr->representation()));
1377 ASSERT(instr->right()->representation().Equals(instr->representation())); 1377 DCHECK(instr->right()->representation().Equals(instr->representation()));
1378 LOperand* dividend = UseRegister(instr->left()); 1378 LOperand* dividend = UseRegister(instr->left());
1379 int32_t divisor = instr->right()->GetInteger32Constant(); 1379 int32_t divisor = instr->right()->GetInteger32Constant();
1380 LOperand* temp = 1380 LOperand* temp =
1381 ((divisor > 0 && !instr->CheckFlag(HValue::kLeftCanBeNegative)) || 1381 ((divisor > 0 && !instr->CheckFlag(HValue::kLeftCanBeNegative)) ||
1382 (divisor < 0 && !instr->CheckFlag(HValue::kLeftCanBePositive))) ? 1382 (divisor < 0 && !instr->CheckFlag(HValue::kLeftCanBePositive))) ?
1383 NULL : TempRegister(); 1383 NULL : TempRegister();
1384 LInstruction* result = DefineAsRegister( 1384 LInstruction* result = DefineAsRegister(
1385 new(zone()) LFlooringDivByConstI(dividend, divisor, temp)); 1385 new(zone()) LFlooringDivByConstI(dividend, divisor, temp));
1386 if (divisor == 0 || 1386 if (divisor == 0 ||
1387 (instr->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0)) { 1387 (instr->CheckFlag(HValue::kBailoutOnMinusZero) && divisor < 0)) {
1388 result = AssignEnvironment(result); 1388 result = AssignEnvironment(result);
1389 } 1389 }
1390 return result; 1390 return result;
1391 } 1391 }
1392 1392
1393 1393
1394 LInstruction* LChunkBuilder::DoFlooringDivI(HMathFloorOfDiv* instr) { 1394 LInstruction* LChunkBuilder::DoFlooringDivI(HMathFloorOfDiv* instr) {
1395 ASSERT(instr->representation().IsSmiOrInteger32()); 1395 DCHECK(instr->representation().IsSmiOrInteger32());
1396 ASSERT(instr->left()->representation().Equals(instr->representation())); 1396 DCHECK(instr->left()->representation().Equals(instr->representation()));
1397 ASSERT(instr->right()->representation().Equals(instr->representation())); 1397 DCHECK(instr->right()->representation().Equals(instr->representation()));
1398 LOperand* dividend = UseRegister(instr->left()); 1398 LOperand* dividend = UseRegister(instr->left());
1399 LOperand* divisor = UseRegister(instr->right()); 1399 LOperand* divisor = UseRegister(instr->right());
1400 LFlooringDivI* div = new(zone()) LFlooringDivI(dividend, divisor); 1400 LFlooringDivI* div = new(zone()) LFlooringDivI(dividend, divisor);
1401 return AssignEnvironment(DefineAsRegister(div)); 1401 return AssignEnvironment(DefineAsRegister(div));
1402 } 1402 }
1403 1403
1404 1404
1405 LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) { 1405 LInstruction* LChunkBuilder::DoMathFloorOfDiv(HMathFloorOfDiv* instr) {
1406 if (instr->RightIsPowerOf2()) { 1406 if (instr->RightIsPowerOf2()) {
1407 return DoFlooringDivByPowerOf2I(instr); 1407 return DoFlooringDivByPowerOf2I(instr);
1408 } else if (instr->right()->IsConstant()) { 1408 } else if (instr->right()->IsConstant()) {
1409 return DoFlooringDivByConstI(instr); 1409 return DoFlooringDivByConstI(instr);
1410 } else { 1410 } else {
1411 return DoFlooringDivI(instr); 1411 return DoFlooringDivI(instr);
1412 } 1412 }
1413 } 1413 }
1414 1414
1415 1415
1416 LInstruction* LChunkBuilder::DoModByPowerOf2I(HMod* instr) { 1416 LInstruction* LChunkBuilder::DoModByPowerOf2I(HMod* instr) {
1417 ASSERT(instr->representation().IsSmiOrInteger32()); 1417 DCHECK(instr->representation().IsSmiOrInteger32());
1418 ASSERT(instr->left()->representation().Equals(instr->representation())); 1418 DCHECK(instr->left()->representation().Equals(instr->representation()));
1419 ASSERT(instr->right()->representation().Equals(instr->representation())); 1419 DCHECK(instr->right()->representation().Equals(instr->representation()));
1420 LOperand* dividend = UseRegisterAtStart(instr->left()); 1420 LOperand* dividend = UseRegisterAtStart(instr->left());
1421 int32_t divisor = instr->right()->GetInteger32Constant(); 1421 int32_t divisor = instr->right()->GetInteger32Constant();
1422 LInstruction* result = DefineSameAsFirst(new(zone()) LModByPowerOf2I( 1422 LInstruction* result = DefineSameAsFirst(new(zone()) LModByPowerOf2I(
1423 dividend, divisor)); 1423 dividend, divisor));
1424 if (instr->CheckFlag(HValue::kLeftCanBeNegative) && 1424 if (instr->CheckFlag(HValue::kLeftCanBeNegative) &&
1425 instr->CheckFlag(HValue::kBailoutOnMinusZero)) { 1425 instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
1426 result = AssignEnvironment(result); 1426 result = AssignEnvironment(result);
1427 } 1427 }
1428 return result; 1428 return result;
1429 } 1429 }
1430 1430
1431 1431
1432 LInstruction* LChunkBuilder::DoModByConstI(HMod* instr) { 1432 LInstruction* LChunkBuilder::DoModByConstI(HMod* instr) {
1433 ASSERT(instr->representation().IsSmiOrInteger32()); 1433 DCHECK(instr->representation().IsSmiOrInteger32());
1434 ASSERT(instr->left()->representation().Equals(instr->representation())); 1434 DCHECK(instr->left()->representation().Equals(instr->representation()));
1435 ASSERT(instr->right()->representation().Equals(instr->representation())); 1435 DCHECK(instr->right()->representation().Equals(instr->representation()));
1436 LOperand* dividend = UseRegister(instr->left()); 1436 LOperand* dividend = UseRegister(instr->left());
1437 int32_t divisor = instr->right()->GetInteger32Constant(); 1437 int32_t divisor = instr->right()->GetInteger32Constant();
1438 LInstruction* result = DefineAsRegister(new(zone()) LModByConstI( 1438 LInstruction* result = DefineAsRegister(new(zone()) LModByConstI(
1439 dividend, divisor)); 1439 dividend, divisor));
1440 if (divisor == 0 || instr->CheckFlag(HValue::kBailoutOnMinusZero)) { 1440 if (divisor == 0 || instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
1441 result = AssignEnvironment(result); 1441 result = AssignEnvironment(result);
1442 } 1442 }
1443 return result; 1443 return result;
1444 } 1444 }
1445 1445
1446 1446
1447 LInstruction* LChunkBuilder::DoModI(HMod* instr) { 1447 LInstruction* LChunkBuilder::DoModI(HMod* instr) {
1448 ASSERT(instr->representation().IsSmiOrInteger32()); 1448 DCHECK(instr->representation().IsSmiOrInteger32());
1449 ASSERT(instr->left()->representation().Equals(instr->representation())); 1449 DCHECK(instr->left()->representation().Equals(instr->representation()));
1450 ASSERT(instr->right()->representation().Equals(instr->representation())); 1450 DCHECK(instr->right()->representation().Equals(instr->representation()));
1451 LOperand* dividend = UseRegister(instr->left()); 1451 LOperand* dividend = UseRegister(instr->left());
1452 LOperand* divisor = UseRegister(instr->right()); 1452 LOperand* divisor = UseRegister(instr->right());
1453 LInstruction* result = DefineAsRegister(new(zone()) LModI( 1453 LInstruction* result = DefineAsRegister(new(zone()) LModI(
1454 dividend, divisor)); 1454 dividend, divisor));
1455 if (instr->CheckFlag(HValue::kCanBeDivByZero) || 1455 if (instr->CheckFlag(HValue::kCanBeDivByZero) ||
1456 instr->CheckFlag(HValue::kBailoutOnMinusZero)) { 1456 instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
1457 result = AssignEnvironment(result); 1457 result = AssignEnvironment(result);
1458 } 1458 }
1459 return result; 1459 return result;
1460 } 1460 }
1461 1461
1462 1462
1463 LInstruction* LChunkBuilder::DoMod(HMod* instr) { 1463 LInstruction* LChunkBuilder::DoMod(HMod* instr) {
1464 if (instr->representation().IsSmiOrInteger32()) { 1464 if (instr->representation().IsSmiOrInteger32()) {
1465 return instr->RightIsPowerOf2() ? DoModByPowerOf2I(instr) : DoModI(instr); 1465 return instr->RightIsPowerOf2() ? DoModByPowerOf2I(instr) : DoModI(instr);
1466 } else if (instr->representation().IsDouble()) { 1466 } else if (instr->representation().IsDouble()) {
1467 return DoArithmeticD(Token::MOD, instr); 1467 return DoArithmeticD(Token::MOD, instr);
1468 } else { 1468 } else {
1469 return DoArithmeticT(Token::MOD, instr); 1469 return DoArithmeticT(Token::MOD, instr);
1470 } 1470 }
1471 } 1471 }
1472 1472
1473 1473
1474 LInstruction* LChunkBuilder::DoMul(HMul* instr) { 1474 LInstruction* LChunkBuilder::DoMul(HMul* instr) {
1475 if (instr->representation().IsSmiOrInteger32()) { 1475 if (instr->representation().IsSmiOrInteger32()) {
1476 ASSERT(instr->left()->representation().Equals(instr->representation())); 1476 DCHECK(instr->left()->representation().Equals(instr->representation()));
1477 ASSERT(instr->right()->representation().Equals(instr->representation())); 1477 DCHECK(instr->right()->representation().Equals(instr->representation()));
1478 HValue* left = instr->BetterLeftOperand(); 1478 HValue* left = instr->BetterLeftOperand();
1479 HValue* right = instr->BetterRightOperand(); 1479 HValue* right = instr->BetterRightOperand();
1480 LOperand* left_op; 1480 LOperand* left_op;
1481 LOperand* right_op; 1481 LOperand* right_op;
1482 bool can_overflow = instr->CheckFlag(HValue::kCanOverflow); 1482 bool can_overflow = instr->CheckFlag(HValue::kCanOverflow);
1483 bool bailout_on_minus_zero = instr->CheckFlag(HValue::kBailoutOnMinusZero); 1483 bool bailout_on_minus_zero = instr->CheckFlag(HValue::kBailoutOnMinusZero);
1484 1484
1485 if (right->IsConstant()) { 1485 if (right->IsConstant()) {
1486 HConstant* constant = HConstant::cast(right); 1486 HConstant* constant = HConstant::cast(right);
1487 int32_t constant_value = constant->Integer32Value(); 1487 int32_t constant_value = constant->Integer32Value();
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1530 } 1530 }
1531 return DoArithmeticD(Token::MUL, instr); 1531 return DoArithmeticD(Token::MUL, instr);
1532 } else { 1532 } else {
1533 return DoArithmeticT(Token::MUL, instr); 1533 return DoArithmeticT(Token::MUL, instr);
1534 } 1534 }
1535 } 1535 }
1536 1536
1537 1537
1538 LInstruction* LChunkBuilder::DoSub(HSub* instr) { 1538 LInstruction* LChunkBuilder::DoSub(HSub* instr) {
1539 if (instr->representation().IsSmiOrInteger32()) { 1539 if (instr->representation().IsSmiOrInteger32()) {
1540 ASSERT(instr->left()->representation().Equals(instr->representation())); 1540 DCHECK(instr->left()->representation().Equals(instr->representation()));
1541 ASSERT(instr->right()->representation().Equals(instr->representation())); 1541 DCHECK(instr->right()->representation().Equals(instr->representation()));
1542 LOperand* left = UseRegisterAtStart(instr->left()); 1542 LOperand* left = UseRegisterAtStart(instr->left());
1543 LOperand* right = UseOrConstantAtStart(instr->right()); 1543 LOperand* right = UseOrConstantAtStart(instr->right());
1544 LSubI* sub = new(zone()) LSubI(left, right); 1544 LSubI* sub = new(zone()) LSubI(left, right);
1545 LInstruction* result = DefineAsRegister(sub); 1545 LInstruction* result = DefineAsRegister(sub);
1546 if (instr->CheckFlag(HValue::kCanOverflow)) { 1546 if (instr->CheckFlag(HValue::kCanOverflow)) {
1547 result = AssignEnvironment(result); 1547 result = AssignEnvironment(result);
1548 } 1548 }
1549 return result; 1549 return result;
1550 } else if (instr->representation().IsDouble()) { 1550 } else if (instr->representation().IsDouble()) {
1551 return DoArithmeticD(Token::SUB, instr); 1551 return DoArithmeticD(Token::SUB, instr);
1552 } else { 1552 } else {
1553 return DoArithmeticT(Token::SUB, instr); 1553 return DoArithmeticT(Token::SUB, instr);
1554 } 1554 }
1555 } 1555 }
1556 1556
1557 1557
1558 LInstruction* LChunkBuilder::DoMultiplyAdd(HMul* mul, HValue* addend) { 1558 LInstruction* LChunkBuilder::DoMultiplyAdd(HMul* mul, HValue* addend) {
1559 LOperand* multiplier_op = UseRegisterAtStart(mul->left()); 1559 LOperand* multiplier_op = UseRegisterAtStart(mul->left());
1560 LOperand* multiplicand_op = UseRegisterAtStart(mul->right()); 1560 LOperand* multiplicand_op = UseRegisterAtStart(mul->right());
1561 LOperand* addend_op = UseRegisterAtStart(addend); 1561 LOperand* addend_op = UseRegisterAtStart(addend);
1562 return DefineSameAsFirst(new(zone()) LMultiplyAddD(addend_op, multiplier_op, 1562 return DefineSameAsFirst(new(zone()) LMultiplyAddD(addend_op, multiplier_op,
1563 multiplicand_op)); 1563 multiplicand_op));
1564 } 1564 }
1565 1565
1566 1566
1567 LInstruction* LChunkBuilder::DoAdd(HAdd* instr) { 1567 LInstruction* LChunkBuilder::DoAdd(HAdd* instr) {
1568 if (instr->representation().IsSmiOrInteger32()) { 1568 if (instr->representation().IsSmiOrInteger32()) {
1569 ASSERT(instr->left()->representation().Equals(instr->representation())); 1569 DCHECK(instr->left()->representation().Equals(instr->representation()));
1570 ASSERT(instr->right()->representation().Equals(instr->representation())); 1570 DCHECK(instr->right()->representation().Equals(instr->representation()));
1571 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand()); 1571 LOperand* left = UseRegisterAtStart(instr->BetterLeftOperand());
1572 LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand()); 1572 LOperand* right = UseOrConstantAtStart(instr->BetterRightOperand());
1573 LAddI* add = new(zone()) LAddI(left, right); 1573 LAddI* add = new(zone()) LAddI(left, right);
1574 LInstruction* result = DefineAsRegister(add); 1574 LInstruction* result = DefineAsRegister(add);
1575 if (instr->CheckFlag(HValue::kCanOverflow)) { 1575 if (instr->CheckFlag(HValue::kCanOverflow)) {
1576 result = AssignEnvironment(result); 1576 result = AssignEnvironment(result);
1577 } 1577 }
1578 return result; 1578 return result;
1579 } else if (instr->representation().IsExternal()) { 1579 } else if (instr->representation().IsExternal()) {
1580 ASSERT(instr->left()->representation().IsExternal()); 1580 DCHECK(instr->left()->representation().IsExternal());
1581 ASSERT(instr->right()->representation().IsInteger32()); 1581 DCHECK(instr->right()->representation().IsInteger32());
1582 ASSERT(!instr->CheckFlag(HValue::kCanOverflow)); 1582 DCHECK(!instr->CheckFlag(HValue::kCanOverflow));
1583 LOperand* left = UseRegisterAtStart(instr->left()); 1583 LOperand* left = UseRegisterAtStart(instr->left());
1584 LOperand* right = UseOrConstantAtStart(instr->right()); 1584 LOperand* right = UseOrConstantAtStart(instr->right());
1585 LAddI* add = new(zone()) LAddI(left, right); 1585 LAddI* add = new(zone()) LAddI(left, right);
1586 LInstruction* result = DefineAsRegister(add); 1586 LInstruction* result = DefineAsRegister(add);
1587 return result; 1587 return result;
1588 } else if (instr->representation().IsDouble()) { 1588 } else if (instr->representation().IsDouble()) {
1589 if (kArchVariant == kMips64r2) { 1589 if (kArchVariant == kMips64r2) {
1590 if (instr->left()->IsMul()) 1590 if (instr->left()->IsMul())
1591 return DoMultiplyAdd(HMul::cast(instr->left()), instr->right()); 1591 return DoMultiplyAdd(HMul::cast(instr->left()), instr->right());
1592 1592
1593 if (instr->right()->IsMul()) { 1593 if (instr->right()->IsMul()) {
1594 ASSERT(!instr->left()->IsMul()); 1594 DCHECK(!instr->left()->IsMul());
1595 return DoMultiplyAdd(HMul::cast(instr->right()), instr->left()); 1595 return DoMultiplyAdd(HMul::cast(instr->right()), instr->left());
1596 } 1596 }
1597 } 1597 }
1598 return DoArithmeticD(Token::ADD, instr); 1598 return DoArithmeticD(Token::ADD, instr);
1599 } else { 1599 } else {
1600 return DoArithmeticT(Token::ADD, instr); 1600 return DoArithmeticT(Token::ADD, instr);
1601 } 1601 }
1602 } 1602 }
1603 1603
1604 1604
1605 LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) { 1605 LInstruction* LChunkBuilder::DoMathMinMax(HMathMinMax* instr) {
1606 LOperand* left = NULL; 1606 LOperand* left = NULL;
1607 LOperand* right = NULL; 1607 LOperand* right = NULL;
1608 if (instr->representation().IsSmiOrInteger32()) { 1608 if (instr->representation().IsSmiOrInteger32()) {
1609 ASSERT(instr->left()->representation().Equals(instr->representation())); 1609 DCHECK(instr->left()->representation().Equals(instr->representation()));
1610 ASSERT(instr->right()->representation().Equals(instr->representation())); 1610 DCHECK(instr->right()->representation().Equals(instr->representation()));
1611 left = UseRegisterAtStart(instr->BetterLeftOperand()); 1611 left = UseRegisterAtStart(instr->BetterLeftOperand());
1612 right = UseOrConstantAtStart(instr->BetterRightOperand()); 1612 right = UseOrConstantAtStart(instr->BetterRightOperand());
1613 } else { 1613 } else {
1614 ASSERT(instr->representation().IsDouble()); 1614 DCHECK(instr->representation().IsDouble());
1615 ASSERT(instr->left()->representation().IsDouble()); 1615 DCHECK(instr->left()->representation().IsDouble());
1616 ASSERT(instr->right()->representation().IsDouble()); 1616 DCHECK(instr->right()->representation().IsDouble());
1617 left = UseRegisterAtStart(instr->left()); 1617 left = UseRegisterAtStart(instr->left());
1618 right = UseRegisterAtStart(instr->right()); 1618 right = UseRegisterAtStart(instr->right());
1619 } 1619 }
1620 return DefineAsRegister(new(zone()) LMathMinMax(left, right)); 1620 return DefineAsRegister(new(zone()) LMathMinMax(left, right));
1621 } 1621 }
1622 1622
1623 1623
1624 LInstruction* LChunkBuilder::DoPower(HPower* instr) { 1624 LInstruction* LChunkBuilder::DoPower(HPower* instr) {
1625 ASSERT(instr->representation().IsDouble()); 1625 DCHECK(instr->representation().IsDouble());
1626 // We call a C function for double power. It can't trigger a GC. 1626 // We call a C function for double power. It can't trigger a GC.
1627 // We need to use fixed result register for the call. 1627 // We need to use fixed result register for the call.
1628 Representation exponent_type = instr->right()->representation(); 1628 Representation exponent_type = instr->right()->representation();
1629 ASSERT(instr->left()->representation().IsDouble()); 1629 DCHECK(instr->left()->representation().IsDouble());
1630 LOperand* left = UseFixedDouble(instr->left(), f2); 1630 LOperand* left = UseFixedDouble(instr->left(), f2);
1631 LOperand* right = exponent_type.IsDouble() ? 1631 LOperand* right = exponent_type.IsDouble() ?
1632 UseFixedDouble(instr->right(), f4) : 1632 UseFixedDouble(instr->right(), f4) :
1633 UseFixed(instr->right(), a2); 1633 UseFixed(instr->right(), a2);
1634 LPower* result = new(zone()) LPower(left, right); 1634 LPower* result = new(zone()) LPower(left, right);
1635 return MarkAsCall(DefineFixedDouble(result, f0), 1635 return MarkAsCall(DefineFixedDouble(result, f0),
1636 instr, 1636 instr,
1637 CAN_DEOPTIMIZE_EAGERLY); 1637 CAN_DEOPTIMIZE_EAGERLY);
1638 } 1638 }
1639 1639
1640 1640
1641 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { 1641 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) {
1642 ASSERT(instr->left()->representation().IsTagged()); 1642 DCHECK(instr->left()->representation().IsTagged());
1643 ASSERT(instr->right()->representation().IsTagged()); 1643 DCHECK(instr->right()->representation().IsTagged());
1644 LOperand* context = UseFixed(instr->context(), cp); 1644 LOperand* context = UseFixed(instr->context(), cp);
1645 LOperand* left = UseFixed(instr->left(), a1); 1645 LOperand* left = UseFixed(instr->left(), a1);
1646 LOperand* right = UseFixed(instr->right(), a0); 1646 LOperand* right = UseFixed(instr->right(), a0);
1647 LCmpT* result = new(zone()) LCmpT(context, left, right); 1647 LCmpT* result = new(zone()) LCmpT(context, left, right);
1648 return MarkAsCall(DefineFixed(result, v0), instr); 1648 return MarkAsCall(DefineFixed(result, v0), instr);
1649 } 1649 }
1650 1650
1651 1651
1652 LInstruction* LChunkBuilder::DoCompareNumericAndBranch( 1652 LInstruction* LChunkBuilder::DoCompareNumericAndBranch(
1653 HCompareNumericAndBranch* instr) { 1653 HCompareNumericAndBranch* instr) {
1654 Representation r = instr->representation(); 1654 Representation r = instr->representation();
1655 if (r.IsSmiOrInteger32()) { 1655 if (r.IsSmiOrInteger32()) {
1656 ASSERT(instr->left()->representation().Equals(r)); 1656 DCHECK(instr->left()->representation().Equals(r));
1657 ASSERT(instr->right()->representation().Equals(r)); 1657 DCHECK(instr->right()->representation().Equals(r));
1658 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); 1658 LOperand* left = UseRegisterOrConstantAtStart(instr->left());
1659 LOperand* right = UseRegisterOrConstantAtStart(instr->right()); 1659 LOperand* right = UseRegisterOrConstantAtStart(instr->right());
1660 return new(zone()) LCompareNumericAndBranch(left, right); 1660 return new(zone()) LCompareNumericAndBranch(left, right);
1661 } else { 1661 } else {
1662 ASSERT(r.IsDouble()); 1662 DCHECK(r.IsDouble());
1663 ASSERT(instr->left()->representation().IsDouble()); 1663 DCHECK(instr->left()->representation().IsDouble());
1664 ASSERT(instr->right()->representation().IsDouble()); 1664 DCHECK(instr->right()->representation().IsDouble());
1665 LOperand* left = UseRegisterAtStart(instr->left()); 1665 LOperand* left = UseRegisterAtStart(instr->left());
1666 LOperand* right = UseRegisterAtStart(instr->right()); 1666 LOperand* right = UseRegisterAtStart(instr->right());
1667 return new(zone()) LCompareNumericAndBranch(left, right); 1667 return new(zone()) LCompareNumericAndBranch(left, right);
1668 } 1668 }
1669 } 1669 }
1670 1670
1671 1671
1672 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch( 1672 LInstruction* LChunkBuilder::DoCompareObjectEqAndBranch(
1673 HCompareObjectEqAndBranch* instr) { 1673 HCompareObjectEqAndBranch* instr) {
1674 LOperand* left = UseRegisterAtStart(instr->left()); 1674 LOperand* left = UseRegisterAtStart(instr->left());
(...skipping 11 matching lines...) Expand all
1686 1686
1687 LInstruction* LChunkBuilder::DoCompareMinusZeroAndBranch( 1687 LInstruction* LChunkBuilder::DoCompareMinusZeroAndBranch(
1688 HCompareMinusZeroAndBranch* instr) { 1688 HCompareMinusZeroAndBranch* instr) {
1689 LOperand* value = UseRegister(instr->value()); 1689 LOperand* value = UseRegister(instr->value());
1690 LOperand* scratch = TempRegister(); 1690 LOperand* scratch = TempRegister();
1691 return new(zone()) LCompareMinusZeroAndBranch(value, scratch); 1691 return new(zone()) LCompareMinusZeroAndBranch(value, scratch);
1692 } 1692 }
1693 1693
1694 1694
1695 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) { 1695 LInstruction* LChunkBuilder::DoIsObjectAndBranch(HIsObjectAndBranch* instr) {
1696 ASSERT(instr->value()->representation().IsTagged()); 1696 DCHECK(instr->value()->representation().IsTagged());
1697 LOperand* temp = TempRegister(); 1697 LOperand* temp = TempRegister();
1698 return new(zone()) LIsObjectAndBranch(UseRegisterAtStart(instr->value()), 1698 return new(zone()) LIsObjectAndBranch(UseRegisterAtStart(instr->value()),
1699 temp); 1699 temp);
1700 } 1700 }
1701 1701
1702 1702
1703 LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) { 1703 LInstruction* LChunkBuilder::DoIsStringAndBranch(HIsStringAndBranch* instr) {
1704 ASSERT(instr->value()->representation().IsTagged()); 1704 DCHECK(instr->value()->representation().IsTagged());
1705 LOperand* temp = TempRegister(); 1705 LOperand* temp = TempRegister();
1706 return new(zone()) LIsStringAndBranch(UseRegisterAtStart(instr->value()), 1706 return new(zone()) LIsStringAndBranch(UseRegisterAtStart(instr->value()),
1707 temp); 1707 temp);
1708 } 1708 }
1709 1709
1710 1710
1711 LInstruction* LChunkBuilder::DoIsSmiAndBranch(HIsSmiAndBranch* instr) { 1711 LInstruction* LChunkBuilder::DoIsSmiAndBranch(HIsSmiAndBranch* instr) {
1712 ASSERT(instr->value()->representation().IsTagged()); 1712 DCHECK(instr->value()->representation().IsTagged());
1713 return new(zone()) LIsSmiAndBranch(Use(instr->value())); 1713 return new(zone()) LIsSmiAndBranch(Use(instr->value()));
1714 } 1714 }
1715 1715
1716 1716
1717 LInstruction* LChunkBuilder::DoIsUndetectableAndBranch( 1717 LInstruction* LChunkBuilder::DoIsUndetectableAndBranch(
1718 HIsUndetectableAndBranch* instr) { 1718 HIsUndetectableAndBranch* instr) {
1719 ASSERT(instr->value()->representation().IsTagged()); 1719 DCHECK(instr->value()->representation().IsTagged());
1720 return new(zone()) LIsUndetectableAndBranch( 1720 return new(zone()) LIsUndetectableAndBranch(
1721 UseRegisterAtStart(instr->value()), TempRegister()); 1721 UseRegisterAtStart(instr->value()), TempRegister());
1722 } 1722 }
1723 1723
1724 1724
1725 LInstruction* LChunkBuilder::DoStringCompareAndBranch( 1725 LInstruction* LChunkBuilder::DoStringCompareAndBranch(
1726 HStringCompareAndBranch* instr) { 1726 HStringCompareAndBranch* instr) {
1727 ASSERT(instr->left()->representation().IsTagged()); 1727 DCHECK(instr->left()->representation().IsTagged());
1728 ASSERT(instr->right()->representation().IsTagged()); 1728 DCHECK(instr->right()->representation().IsTagged());
1729 LOperand* context = UseFixed(instr->context(), cp); 1729 LOperand* context = UseFixed(instr->context(), cp);
1730 LOperand* left = UseFixed(instr->left(), a1); 1730 LOperand* left = UseFixed(instr->left(), a1);
1731 LOperand* right = UseFixed(instr->right(), a0); 1731 LOperand* right = UseFixed(instr->right(), a0);
1732 LStringCompareAndBranch* result = 1732 LStringCompareAndBranch* result =
1733 new(zone()) LStringCompareAndBranch(context, left, right); 1733 new(zone()) LStringCompareAndBranch(context, left, right);
1734 return MarkAsCall(result, instr); 1734 return MarkAsCall(result, instr);
1735 } 1735 }
1736 1736
1737 1737
1738 LInstruction* LChunkBuilder::DoHasInstanceTypeAndBranch( 1738 LInstruction* LChunkBuilder::DoHasInstanceTypeAndBranch(
1739 HHasInstanceTypeAndBranch* instr) { 1739 HHasInstanceTypeAndBranch* instr) {
1740 ASSERT(instr->value()->representation().IsTagged()); 1740 DCHECK(instr->value()->representation().IsTagged());
1741 LOperand* value = UseRegisterAtStart(instr->value()); 1741 LOperand* value = UseRegisterAtStart(instr->value());
1742 return new(zone()) LHasInstanceTypeAndBranch(value); 1742 return new(zone()) LHasInstanceTypeAndBranch(value);
1743 } 1743 }
1744 1744
1745 1745
1746 LInstruction* LChunkBuilder::DoGetCachedArrayIndex( 1746 LInstruction* LChunkBuilder::DoGetCachedArrayIndex(
1747 HGetCachedArrayIndex* instr) { 1747 HGetCachedArrayIndex* instr) {
1748 ASSERT(instr->value()->representation().IsTagged()); 1748 DCHECK(instr->value()->representation().IsTagged());
1749 LOperand* value = UseRegisterAtStart(instr->value()); 1749 LOperand* value = UseRegisterAtStart(instr->value());
1750 1750
1751 return DefineAsRegister(new(zone()) LGetCachedArrayIndex(value)); 1751 return DefineAsRegister(new(zone()) LGetCachedArrayIndex(value));
1752 } 1752 }
1753 1753
1754 1754
1755 LInstruction* LChunkBuilder::DoHasCachedArrayIndexAndBranch( 1755 LInstruction* LChunkBuilder::DoHasCachedArrayIndexAndBranch(
1756 HHasCachedArrayIndexAndBranch* instr) { 1756 HHasCachedArrayIndexAndBranch* instr) {
1757 ASSERT(instr->value()->representation().IsTagged()); 1757 DCHECK(instr->value()->representation().IsTagged());
1758 return new(zone()) LHasCachedArrayIndexAndBranch( 1758 return new(zone()) LHasCachedArrayIndexAndBranch(
1759 UseRegisterAtStart(instr->value())); 1759 UseRegisterAtStart(instr->value()));
1760 } 1760 }
1761 1761
1762 1762
1763 LInstruction* LChunkBuilder::DoClassOfTestAndBranch( 1763 LInstruction* LChunkBuilder::DoClassOfTestAndBranch(
1764 HClassOfTestAndBranch* instr) { 1764 HClassOfTestAndBranch* instr) {
1765 ASSERT(instr->value()->representation().IsTagged()); 1765 DCHECK(instr->value()->representation().IsTagged());
1766 return new(zone()) LClassOfTestAndBranch(UseRegister(instr->value()), 1766 return new(zone()) LClassOfTestAndBranch(UseRegister(instr->value()),
1767 TempRegister()); 1767 TempRegister());
1768 } 1768 }
1769 1769
1770 1770
1771 LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) { 1771 LInstruction* LChunkBuilder::DoMapEnumLength(HMapEnumLength* instr) {
1772 LOperand* map = UseRegisterAtStart(instr->value()); 1772 LOperand* map = UseRegisterAtStart(instr->value());
1773 return DefineAsRegister(new(zone()) LMapEnumLength(map)); 1773 return DefineAsRegister(new(zone()) LMapEnumLength(map));
1774 } 1774 }
1775 1775
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
1858 LInstruction* result = DefineAsRegister(new(zone()) LNumberUntagD(value)); 1858 LInstruction* result = DefineAsRegister(new(zone()) LNumberUntagD(value));
1859 if (!val->representation().IsSmi()) result = AssignEnvironment(result); 1859 if (!val->representation().IsSmi()) result = AssignEnvironment(result);
1860 return result; 1860 return result;
1861 } else if (to.IsSmi()) { 1861 } else if (to.IsSmi()) {
1862 LOperand* value = UseRegister(val); 1862 LOperand* value = UseRegister(val);
1863 if (val->type().IsSmi()) { 1863 if (val->type().IsSmi()) {
1864 return DefineSameAsFirst(new(zone()) LDummyUse(value)); 1864 return DefineSameAsFirst(new(zone()) LDummyUse(value));
1865 } 1865 }
1866 return AssignEnvironment(DefineSameAsFirst(new(zone()) LCheckSmi(value))); 1866 return AssignEnvironment(DefineSameAsFirst(new(zone()) LCheckSmi(value)));
1867 } else { 1867 } else {
1868 ASSERT(to.IsInteger32()); 1868 DCHECK(to.IsInteger32());
1869 if (val->type().IsSmi() || val->representation().IsSmi()) { 1869 if (val->type().IsSmi() || val->representation().IsSmi()) {
1870 LOperand* value = UseRegisterAtStart(val); 1870 LOperand* value = UseRegisterAtStart(val);
1871 return DefineAsRegister(new(zone()) LSmiUntag(value, false)); 1871 return DefineAsRegister(new(zone()) LSmiUntag(value, false));
1872 } else { 1872 } else {
1873 LOperand* value = UseRegister(val); 1873 LOperand* value = UseRegister(val);
1874 LOperand* temp1 = TempRegister(); 1874 LOperand* temp1 = TempRegister();
1875 LOperand* temp2 = TempDoubleRegister(); 1875 LOperand* temp2 = TempDoubleRegister();
1876 LInstruction* result = 1876 LInstruction* result =
1877 DefineSameAsFirst(new(zone()) LTaggedToI(value, temp1, temp2)); 1877 DefineSameAsFirst(new(zone()) LTaggedToI(value, temp1, temp2));
1878 if (!val->representation().IsSmi()) result = AssignEnvironment(result); 1878 if (!val->representation().IsSmi()) result = AssignEnvironment(result);
1879 return result; 1879 return result;
1880 } 1880 }
1881 } 1881 }
1882 } else if (from.IsDouble()) { 1882 } else if (from.IsDouble()) {
1883 if (to.IsTagged()) { 1883 if (to.IsTagged()) {
1884 info()->MarkAsDeferredCalling(); 1884 info()->MarkAsDeferredCalling();
1885 LOperand* value = UseRegister(val); 1885 LOperand* value = UseRegister(val);
1886 LOperand* temp1 = TempRegister(); 1886 LOperand* temp1 = TempRegister();
1887 LOperand* temp2 = TempRegister(); 1887 LOperand* temp2 = TempRegister();
1888 1888
1889 LUnallocated* result_temp = TempRegister(); 1889 LUnallocated* result_temp = TempRegister();
1890 LNumberTagD* result = new(zone()) LNumberTagD(value, temp1, temp2); 1890 LNumberTagD* result = new(zone()) LNumberTagD(value, temp1, temp2);
1891 return AssignPointerMap(Define(result, result_temp)); 1891 return AssignPointerMap(Define(result, result_temp));
1892 } else if (to.IsSmi()) { 1892 } else if (to.IsSmi()) {
1893 LOperand* value = UseRegister(val); 1893 LOperand* value = UseRegister(val);
1894 return AssignEnvironment( 1894 return AssignEnvironment(
1895 DefineAsRegister(new(zone()) LDoubleToSmi(value))); 1895 DefineAsRegister(new(zone()) LDoubleToSmi(value)));
1896 } else { 1896 } else {
1897 ASSERT(to.IsInteger32()); 1897 DCHECK(to.IsInteger32());
1898 LOperand* value = UseRegister(val); 1898 LOperand* value = UseRegister(val);
1899 LInstruction* result = DefineAsRegister(new(zone()) LDoubleToI(value)); 1899 LInstruction* result = DefineAsRegister(new(zone()) LDoubleToI(value));
1900 if (!instr->CanTruncateToInt32()) result = AssignEnvironment(result); 1900 if (!instr->CanTruncateToInt32()) result = AssignEnvironment(result);
1901 return result; 1901 return result;
1902 } 1902 }
1903 } else if (from.IsInteger32()) { 1903 } else if (from.IsInteger32()) {
1904 info()->MarkAsDeferredCalling(); 1904 info()->MarkAsDeferredCalling();
1905 if (to.IsTagged()) { 1905 if (to.IsTagged()) {
1906 if (val->CheckFlag(HInstruction::kUint32)) { 1906 if (val->CheckFlag(HInstruction::kUint32)) {
1907 LOperand* value = UseRegisterAtStart(val); 1907 LOperand* value = UseRegisterAtStart(val);
1908 LOperand* temp1 = TempRegister(); 1908 LOperand* temp1 = TempRegister();
1909 LOperand* temp2 = TempRegister(); 1909 LOperand* temp2 = TempRegister();
1910 LNumberTagU* result = new(zone()) LNumberTagU(value, temp1, temp2); 1910 LNumberTagU* result = new(zone()) LNumberTagU(value, temp1, temp2);
1911 return AssignPointerMap(DefineAsRegister(result)); 1911 return AssignPointerMap(DefineAsRegister(result));
1912 } else { 1912 } else {
1913 STATIC_ASSERT((kMinInt == Smi::kMinValue) && 1913 STATIC_ASSERT((kMinInt == Smi::kMinValue) &&
1914 (kMaxInt == Smi::kMaxValue)); 1914 (kMaxInt == Smi::kMaxValue));
1915 LOperand* value = UseRegisterAtStart(val); 1915 LOperand* value = UseRegisterAtStart(val);
1916 return DefineAsRegister(new(zone()) LSmiTag(value)); 1916 return DefineAsRegister(new(zone()) LSmiTag(value));
1917 } 1917 }
1918 } else if (to.IsSmi()) { 1918 } else if (to.IsSmi()) {
1919 LOperand* value = UseRegister(val); 1919 LOperand* value = UseRegister(val);
1920 LInstruction* result = DefineAsRegister(new(zone()) LSmiTag(value)); 1920 LInstruction* result = DefineAsRegister(new(zone()) LSmiTag(value));
1921 if (instr->CheckFlag(HValue::kCanOverflow)) { 1921 if (instr->CheckFlag(HValue::kCanOverflow)) {
1922 result = AssignEnvironment(result); 1922 result = AssignEnvironment(result);
1923 } 1923 }
1924 return result; 1924 return result;
1925 } else { 1925 } else {
1926 ASSERT(to.IsDouble()); 1926 DCHECK(to.IsDouble());
1927 if (val->CheckFlag(HInstruction::kUint32)) { 1927 if (val->CheckFlag(HInstruction::kUint32)) {
1928 return DefineAsRegister(new(zone()) LUint32ToDouble(UseRegister(val))); 1928 return DefineAsRegister(new(zone()) LUint32ToDouble(UseRegister(val)));
1929 } else { 1929 } else {
1930 return DefineAsRegister(new(zone()) LInteger32ToDouble(Use(val))); 1930 return DefineAsRegister(new(zone()) LInteger32ToDouble(Use(val)));
1931 } 1931 }
1932 } 1932 }
1933 } 1933 }
1934 UNREACHABLE(); 1934 UNREACHABLE();
1935 return NULL; 1935 return NULL;
1936 } 1936 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1981 HValue* value = instr->value(); 1981 HValue* value = instr->value();
1982 Representation input_rep = value->representation(); 1982 Representation input_rep = value->representation();
1983 LOperand* reg = UseRegister(value); 1983 LOperand* reg = UseRegister(value);
1984 if (input_rep.IsDouble()) { 1984 if (input_rep.IsDouble()) {
1985 // Revisit this decision, here and 8 lines below. 1985 // Revisit this decision, here and 8 lines below.
1986 return DefineAsRegister(new(zone()) LClampDToUint8(reg, 1986 return DefineAsRegister(new(zone()) LClampDToUint8(reg,
1987 TempDoubleRegister())); 1987 TempDoubleRegister()));
1988 } else if (input_rep.IsInteger32()) { 1988 } else if (input_rep.IsInteger32()) {
1989 return DefineAsRegister(new(zone()) LClampIToUint8(reg)); 1989 return DefineAsRegister(new(zone()) LClampIToUint8(reg));
1990 } else { 1990 } else {
1991 ASSERT(input_rep.IsSmiOrTagged()); 1991 DCHECK(input_rep.IsSmiOrTagged());
1992 LClampTToUint8* result = 1992 LClampTToUint8* result =
1993 new(zone()) LClampTToUint8(reg, TempDoubleRegister()); 1993 new(zone()) LClampTToUint8(reg, TempDoubleRegister());
1994 return AssignEnvironment(DefineAsRegister(result)); 1994 return AssignEnvironment(DefineAsRegister(result));
1995 } 1995 }
1996 } 1996 }
1997 1997
1998 1998
1999 LInstruction* LChunkBuilder::DoDoubleBits(HDoubleBits* instr) { 1999 LInstruction* LChunkBuilder::DoDoubleBits(HDoubleBits* instr) {
2000 HValue* value = instr->value(); 2000 HValue* value = instr->value();
2001 ASSERT(value->representation().IsDouble()); 2001 DCHECK(value->representation().IsDouble());
2002 return DefineAsRegister(new(zone()) LDoubleBits(UseRegister(value))); 2002 return DefineAsRegister(new(zone()) LDoubleBits(UseRegister(value)));
2003 } 2003 }
2004 2004
2005 2005
2006 LInstruction* LChunkBuilder::DoConstructDouble(HConstructDouble* instr) { 2006 LInstruction* LChunkBuilder::DoConstructDouble(HConstructDouble* instr) {
2007 LOperand* lo = UseRegister(instr->lo()); 2007 LOperand* lo = UseRegister(instr->lo());
2008 LOperand* hi = UseRegister(instr->hi()); 2008 LOperand* hi = UseRegister(instr->hi());
2009 return DefineAsRegister(new(zone()) LConstructDouble(hi, lo)); 2009 return DefineAsRegister(new(zone()) LConstructDouble(hi, lo));
2010 } 2010 }
2011 2011
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
2126 new(zone()) LLoadFunctionPrototype(UseRegister(instr->function())))); 2126 new(zone()) LLoadFunctionPrototype(UseRegister(instr->function()))));
2127 } 2127 }
2128 2128
2129 2129
2130 LInstruction* LChunkBuilder::DoLoadRoot(HLoadRoot* instr) { 2130 LInstruction* LChunkBuilder::DoLoadRoot(HLoadRoot* instr) {
2131 return DefineAsRegister(new(zone()) LLoadRoot); 2131 return DefineAsRegister(new(zone()) LLoadRoot);
2132 } 2132 }
2133 2133
2134 2134
2135 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { 2135 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) {
2136 ASSERT(instr->key()->representation().IsSmiOrInteger32()); 2136 DCHECK(instr->key()->representation().IsSmiOrInteger32());
2137 ElementsKind elements_kind = instr->elements_kind(); 2137 ElementsKind elements_kind = instr->elements_kind();
2138 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); 2138 LOperand* key = UseRegisterOrConstantAtStart(instr->key());
2139 LInstruction* result = NULL; 2139 LInstruction* result = NULL;
2140 2140
2141 if (!instr->is_typed_elements()) { 2141 if (!instr->is_typed_elements()) {
2142 LOperand* obj = NULL; 2142 LOperand* obj = NULL;
2143 if (instr->representation().IsDouble()) { 2143 if (instr->representation().IsDouble()) {
2144 obj = UseRegister(instr->elements()); 2144 obj = UseRegister(instr->elements());
2145 } else { 2145 } else {
2146 ASSERT(instr->representation().IsSmiOrTagged() || 2146 DCHECK(instr->representation().IsSmiOrTagged() ||
2147 instr->representation().IsInteger32()); 2147 instr->representation().IsInteger32());
2148 obj = UseRegisterAtStart(instr->elements()); 2148 obj = UseRegisterAtStart(instr->elements());
2149 } 2149 }
2150 result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key)); 2150 result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key));
2151 } else { 2151 } else {
2152 ASSERT( 2152 DCHECK(
2153 (instr->representation().IsInteger32() && 2153 (instr->representation().IsInteger32() &&
2154 !IsDoubleOrFloatElementsKind(elements_kind)) || 2154 !IsDoubleOrFloatElementsKind(elements_kind)) ||
2155 (instr->representation().IsDouble() && 2155 (instr->representation().IsDouble() &&
2156 IsDoubleOrFloatElementsKind(elements_kind))); 2156 IsDoubleOrFloatElementsKind(elements_kind)));
2157 LOperand* backing_store = UseRegister(instr->elements()); 2157 LOperand* backing_store = UseRegister(instr->elements());
2158 result = DefineAsRegister(new(zone()) LLoadKeyed(backing_store, key)); 2158 result = DefineAsRegister(new(zone()) LLoadKeyed(backing_store, key));
2159 } 2159 }
2160 2160
2161 if ((instr->is_external() || instr->is_fixed_typed_array()) ? 2161 if ((instr->is_external() || instr->is_fixed_typed_array()) ?
2162 // see LCodeGen::DoLoadKeyedExternalArray 2162 // see LCodeGen::DoLoadKeyedExternalArray
(...skipping 20 matching lines...) Expand all
2183 2183
2184 LInstruction* result = 2184 LInstruction* result =
2185 DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key, vector), 2185 DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key, vector),
2186 v0); 2186 v0);
2187 return MarkAsCall(result, instr); 2187 return MarkAsCall(result, instr);
2188 } 2188 }
2189 2189
2190 2190
2191 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { 2191 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
2192 if (!instr->is_typed_elements()) { 2192 if (!instr->is_typed_elements()) {
2193 ASSERT(instr->elements()->representation().IsTagged()); 2193 DCHECK(instr->elements()->representation().IsTagged());
2194 bool needs_write_barrier = instr->NeedsWriteBarrier(); 2194 bool needs_write_barrier = instr->NeedsWriteBarrier();
2195 LOperand* object = NULL; 2195 LOperand* object = NULL;
2196 LOperand* val = NULL; 2196 LOperand* val = NULL;
2197 LOperand* key = NULL; 2197 LOperand* key = NULL;
2198 2198
2199 if (instr->value()->representation().IsDouble()) { 2199 if (instr->value()->representation().IsDouble()) {
2200 object = UseRegisterAtStart(instr->elements()); 2200 object = UseRegisterAtStart(instr->elements());
2201 key = UseRegisterOrConstantAtStart(instr->key()); 2201 key = UseRegisterOrConstantAtStart(instr->key());
2202 val = UseRegister(instr->value()); 2202 val = UseRegister(instr->value());
2203 } else { 2203 } else {
2204 ASSERT(instr->value()->representation().IsSmiOrTagged() || 2204 DCHECK(instr->value()->representation().IsSmiOrTagged() ||
2205 instr->value()->representation().IsInteger32()); 2205 instr->value()->representation().IsInteger32());
2206 if (needs_write_barrier) { 2206 if (needs_write_barrier) {
2207 object = UseTempRegister(instr->elements()); 2207 object = UseTempRegister(instr->elements());
2208 val = UseTempRegister(instr->value()); 2208 val = UseTempRegister(instr->value());
2209 key = UseTempRegister(instr->key()); 2209 key = UseTempRegister(instr->key());
2210 } else { 2210 } else {
2211 object = UseRegisterAtStart(instr->elements()); 2211 object = UseRegisterAtStart(instr->elements());
2212 val = UseRegisterAtStart(instr->value()); 2212 val = UseRegisterAtStart(instr->value());
2213 key = UseRegisterOrConstantAtStart(instr->key()); 2213 key = UseRegisterOrConstantAtStart(instr->key());
2214 } 2214 }
2215 } 2215 }
2216 2216
2217 return new(zone()) LStoreKeyed(object, key, val); 2217 return new(zone()) LStoreKeyed(object, key, val);
2218 } 2218 }
2219 2219
2220 ASSERT( 2220 DCHECK(
2221 (instr->value()->representation().IsInteger32() && 2221 (instr->value()->representation().IsInteger32() &&
2222 !IsDoubleOrFloatElementsKind(instr->elements_kind())) || 2222 !IsDoubleOrFloatElementsKind(instr->elements_kind())) ||
2223 (instr->value()->representation().IsDouble() && 2223 (instr->value()->representation().IsDouble() &&
2224 IsDoubleOrFloatElementsKind(instr->elements_kind()))); 2224 IsDoubleOrFloatElementsKind(instr->elements_kind())));
2225 ASSERT((instr->is_fixed_typed_array() && 2225 DCHECK((instr->is_fixed_typed_array() &&
2226 instr->elements()->representation().IsTagged()) || 2226 instr->elements()->representation().IsTagged()) ||
2227 (instr->is_external() && 2227 (instr->is_external() &&
2228 instr->elements()->representation().IsExternal())); 2228 instr->elements()->representation().IsExternal()));
2229 LOperand* val = UseRegister(instr->value()); 2229 LOperand* val = UseRegister(instr->value());
2230 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); 2230 LOperand* key = UseRegisterOrConstantAtStart(instr->key());
2231 LOperand* backing_store = UseRegister(instr->elements()); 2231 LOperand* backing_store = UseRegister(instr->elements());
2232 return new(zone()) LStoreKeyed(backing_store, key, val); 2232 return new(zone()) LStoreKeyed(backing_store, key, val);
2233 } 2233 }
2234 2234
2235 2235
2236 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { 2236 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) {
2237 LOperand* context = UseFixed(instr->context(), cp); 2237 LOperand* context = UseFixed(instr->context(), cp);
2238 LOperand* obj = UseFixed(instr->object(), KeyedStoreIC::ReceiverRegister()); 2238 LOperand* obj = UseFixed(instr->object(), KeyedStoreIC::ReceiverRegister());
2239 LOperand* key = UseFixed(instr->key(), KeyedStoreIC::NameRegister()); 2239 LOperand* key = UseFixed(instr->key(), KeyedStoreIC::NameRegister());
2240 LOperand* val = UseFixed(instr->value(), KeyedStoreIC::ValueRegister()); 2240 LOperand* val = UseFixed(instr->value(), KeyedStoreIC::ValueRegister());
2241 2241
2242 ASSERT(instr->object()->representation().IsTagged()); 2242 DCHECK(instr->object()->representation().IsTagged());
2243 ASSERT(instr->key()->representation().IsTagged()); 2243 DCHECK(instr->key()->representation().IsTagged());
2244 ASSERT(instr->value()->representation().IsTagged()); 2244 DCHECK(instr->value()->representation().IsTagged());
2245 2245
2246 return MarkAsCall( 2246 return MarkAsCall(
2247 new(zone()) LStoreKeyedGeneric(context, obj, key, val), instr); 2247 new(zone()) LStoreKeyedGeneric(context, obj, key, val), instr);
2248 } 2248 }
2249 2249
2250 2250
2251 LInstruction* LChunkBuilder::DoTransitionElementsKind( 2251 LInstruction* LChunkBuilder::DoTransitionElementsKind(
2252 HTransitionElementsKind* instr) { 2252 HTransitionElementsKind* instr) {
2253 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { 2253 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) {
2254 LOperand* object = UseRegister(instr->object()); 2254 LOperand* object = UseRegister(instr->object());
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
2367 2367
2368 2368
2369 LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) { 2369 LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) {
2370 LOperand* context = UseFixed(instr->context(), cp); 2370 LOperand* context = UseFixed(instr->context(), cp);
2371 return MarkAsCall( 2371 return MarkAsCall(
2372 DefineFixed(new(zone()) LFunctionLiteral(context), v0), instr); 2372 DefineFixed(new(zone()) LFunctionLiteral(context), v0), instr);
2373 } 2373 }
2374 2374
2375 2375
2376 LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) { 2376 LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) {
2377 ASSERT(argument_count_ == 0); 2377 DCHECK(argument_count_ == 0);
2378 allocator_->MarkAsOsrEntry(); 2378 allocator_->MarkAsOsrEntry();
2379 current_block_->last_environment()->set_ast_id(instr->ast_id()); 2379 current_block_->last_environment()->set_ast_id(instr->ast_id());
2380 return AssignEnvironment(new(zone()) LOsrEntry); 2380 return AssignEnvironment(new(zone()) LOsrEntry);
2381 } 2381 }
2382 2382
2383 2383
2384 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) { 2384 LInstruction* LChunkBuilder::DoParameter(HParameter* instr) {
2385 LParameter* result = new(zone()) LParameter; 2385 LParameter* result = new(zone()) LParameter;
2386 if (instr->kind() == HParameter::STACK_PARAMETER) { 2386 if (instr->kind() == HParameter::STACK_PARAMETER) {
2387 int spill_index = chunk()->GetParameterStackSlot(instr->index()); 2387 int spill_index = chunk()->GetParameterStackSlot(instr->index());
2388 return DefineAsSpilled(result, spill_index); 2388 return DefineAsSpilled(result, spill_index);
2389 } else { 2389 } else {
2390 ASSERT(info()->IsStub()); 2390 DCHECK(info()->IsStub());
2391 CodeStubInterfaceDescriptor* descriptor = 2391 CodeStubInterfaceDescriptor* descriptor =
2392 info()->code_stub()->GetInterfaceDescriptor(); 2392 info()->code_stub()->GetInterfaceDescriptor();
2393 int index = static_cast<int>(instr->index()); 2393 int index = static_cast<int>(instr->index());
2394 Register reg = descriptor->GetEnvironmentParameterRegister(index); 2394 Register reg = descriptor->GetEnvironmentParameterRegister(index);
2395 return DefineFixed(result, reg); 2395 return DefineFixed(result, reg);
2396 } 2396 }
2397 } 2397 }
2398 2398
2399 2399
2400 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) { 2400 LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
2476 instr->ReplayEnvironment(current_block_->last_environment()); 2476 instr->ReplayEnvironment(current_block_->last_environment());
2477 return NULL; 2477 return NULL;
2478 } 2478 }
2479 2479
2480 2480
2481 LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) { 2481 LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) {
2482 if (instr->is_function_entry()) { 2482 if (instr->is_function_entry()) {
2483 LOperand* context = UseFixed(instr->context(), cp); 2483 LOperand* context = UseFixed(instr->context(), cp);
2484 return MarkAsCall(new(zone()) LStackCheck(context), instr); 2484 return MarkAsCall(new(zone()) LStackCheck(context), instr);
2485 } else { 2485 } else {
2486 ASSERT(instr->is_backwards_branch()); 2486 DCHECK(instr->is_backwards_branch());
2487 LOperand* context = UseAny(instr->context()); 2487 LOperand* context = UseAny(instr->context());
2488 return AssignEnvironment( 2488 return AssignEnvironment(
2489 AssignPointerMap(new(zone()) LStackCheck(context))); 2489 AssignPointerMap(new(zone()) LStackCheck(context)));
2490 } 2490 }
2491 } 2491 }
2492 2492
2493 2493
2494 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { 2494 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
2495 HEnvironment* outer = current_block_->last_environment(); 2495 HEnvironment* outer = current_block_->last_environment();
2496 outer->set_ast_id(instr->ReturnId()); 2496 outer->set_ast_id(instr->ReturnId());
(...skipping 15 matching lines...) Expand all
2512 2512
2513 2513
2514 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { 2514 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
2515 LInstruction* pop = NULL; 2515 LInstruction* pop = NULL;
2516 2516
2517 HEnvironment* env = current_block_->last_environment(); 2517 HEnvironment* env = current_block_->last_environment();
2518 2518
2519 if (env->entry()->arguments_pushed()) { 2519 if (env->entry()->arguments_pushed()) {
2520 int argument_count = env->arguments_environment()->parameter_count(); 2520 int argument_count = env->arguments_environment()->parameter_count();
2521 pop = new(zone()) LDrop(argument_count); 2521 pop = new(zone()) LDrop(argument_count);
2522 ASSERT(instr->argument_delta() == -argument_count); 2522 DCHECK(instr->argument_delta() == -argument_count);
2523 } 2523 }
2524 2524
2525 HEnvironment* outer = current_block_->last_environment()-> 2525 HEnvironment* outer = current_block_->last_environment()->
2526 DiscardInlined(false); 2526 DiscardInlined(false);
2527 current_block_->UpdateEnvironment(outer); 2527 current_block_->UpdateEnvironment(outer);
2528 2528
2529 return pop; 2529 return pop;
2530 } 2530 }
2531 2531
2532 2532
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
2572 LOperand* function = UseRegisterAtStart(instr->function()); 2572 LOperand* function = UseRegisterAtStart(instr->function());
2573 LAllocateBlockContext* result = 2573 LAllocateBlockContext* result =
2574 new(zone()) LAllocateBlockContext(context, function); 2574 new(zone()) LAllocateBlockContext(context, function);
2575 return MarkAsCall(DefineFixed(result, cp), instr); 2575 return MarkAsCall(DefineFixed(result, cp), instr);
2576 } 2576 }
2577 2577
2578 2578
2579 } } // namespace v8::internal 2579 } } // namespace v8::internal
2580 2580
2581 #endif // V8_TARGET_ARCH_MIPS64 2581 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/lithium-mips64.h ('k') | src/mips64/macro-assembler-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698