Chromium Code Reviews| 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 253 // representable as an Operand. | 253 // representable as an Operand. |
| 254 ASSERT(op->IsStackSlot() || op->IsDoubleStackSlot()); | 254 ASSERT(op->IsStackSlot() || op->IsDoubleStackSlot()); |
| 255 int index = op->index(); | 255 int index = op->index(); |
| 256 if (index >= 0) { | 256 if (index >= 0) { |
| 257 // Local or spill slot. Skip the frame pointer, function, and | 257 // Local or spill slot. Skip the frame pointer, function, and |
| 258 // context in the fixed part of the frame. | 258 // context in the fixed part of the frame. |
| 259 return Operand(rbp, -(index + 3) * kPointerSize); | 259 return Operand(rbp, -(index + 3) * kPointerSize); |
| 260 } else { | 260 } else { |
| 261 // Incoming parameter. Skip the return address. | 261 // Incoming parameter. Skip the return address. |
| 262 return Operand(rbp, -(index - 1) * kPointerSize); | 262 return Operand(rbp, -(index - 1) * kPointerSize); |
| 263 } | 263 } |
|
William Hesse
2011/02/04 14:37:12
Indentation fixed.
| |
| 264 } | 264 } |
| 265 | 265 |
| 266 | 266 |
| 267 void LCodeGen::WriteTranslation(LEnvironment* environment, | 267 void LCodeGen::WriteTranslation(LEnvironment* environment, |
| 268 Translation* translation) { | 268 Translation* translation) { |
| 269 if (environment == NULL) return; | 269 if (environment == NULL) return; |
| 270 | 270 |
| 271 // The translation includes one command per value in the environment. | 271 // The translation includes one command per value in the environment. |
| 272 int translation_size = environment->values()->length(); | 272 int translation_size = environment->values()->length(); |
| 273 // The output frame height does not include the parameters. | 273 // The output frame height does not include the parameters. |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 426 Address entry = Deoptimizer::GetDeoptimizationEntry(id, Deoptimizer::EAGER); | 426 Address entry = Deoptimizer::GetDeoptimizationEntry(id, Deoptimizer::EAGER); |
| 427 ASSERT(entry != NULL); | 427 ASSERT(entry != NULL); |
| 428 if (entry == NULL) { | 428 if (entry == NULL) { |
| 429 Abort("bailout was not prepared"); | 429 Abort("bailout was not prepared"); |
| 430 return; | 430 return; |
| 431 } | 431 } |
| 432 | 432 |
| 433 if (cc == no_condition) { | 433 if (cc == no_condition) { |
| 434 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); | 434 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); |
| 435 } else { | 435 } else { |
| 436 NearLabel done; | 436 NearLabel done; |
| 437 __ j(NegateCondition(cc), &done); | 437 __ j(NegateCondition(cc), &done); |
| 438 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); | 438 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); |
| 439 __ bind(&done); | 439 __ bind(&done); |
| 440 } | 440 } |
| 441 } | 441 } |
| 442 | 442 |
| 443 | 443 |
| 444 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { | 444 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { |
| 445 int length = deoptimizations_.length(); | 445 int length = deoptimizations_.length(); |
| 446 if (length == 0) return; | 446 if (length == 0) return; |
| 447 ASSERT(FLAG_deopt); | 447 ASSERT(FLAG_deopt); |
| 448 Handle<DeoptimizationInputData> data = | 448 Handle<DeoptimizationInputData> data = |
| 449 Factory::NewDeoptimizationInputData(length, TENURED); | 449 Factory::NewDeoptimizationInputData(length, TENURED); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 598 | 598 |
| 599 void LCodeGen::DoDivI(LDivI* instr) { | 599 void LCodeGen::DoDivI(LDivI* instr) { |
| 600 Abort("Unimplemented: %s", "DoDivI");} | 600 Abort("Unimplemented: %s", "DoDivI");} |
| 601 | 601 |
| 602 | 602 |
| 603 void LCodeGen::DoMulI(LMulI* instr) { | 603 void LCodeGen::DoMulI(LMulI* instr) { |
| 604 Abort("Unimplemented: %s", "DoMultI");} | 604 Abort("Unimplemented: %s", "DoMultI");} |
| 605 | 605 |
| 606 | 606 |
| 607 void LCodeGen::DoBitI(LBitI* instr) { | 607 void LCodeGen::DoBitI(LBitI* instr) { |
| 608 Abort("Unimplemented: %s", "DoBitI");} | 608 LOperand* left = instr->InputAt(0); |
| 609 LOperand* right = instr->InputAt(1); | |
| 610 ASSERT(left->Equals(instr->result())); | |
| 611 ASSERT(left->IsRegister()); | |
| 612 | |
| 613 if (right->IsConstantOperand()) { | |
| 614 int right_operand = ToInteger32(LConstantOperand::cast(right)); | |
| 615 switch (instr->op()) { | |
| 616 case Token::BIT_AND: | |
| 617 __ andl(ToRegister(left), Immediate(right_operand)); | |
| 618 break; | |
| 619 case Token::BIT_OR: | |
| 620 __ orl(ToRegister(left), Immediate(right_operand)); | |
| 621 break; | |
| 622 case Token::BIT_XOR: | |
| 623 __ xorl(ToRegister(left), Immediate(right_operand)); | |
| 624 break; | |
| 625 default: | |
| 626 UNREACHABLE(); | |
| 627 break; | |
| 628 } | |
| 629 } else if (right->IsStackSlot()) { | |
| 630 switch (instr->op()) { | |
| 631 case Token::BIT_AND: | |
| 632 __ andl(ToRegister(left), ToOperand(right)); | |
| 633 break; | |
| 634 case Token::BIT_OR: | |
| 635 __ orl(ToRegister(left), ToOperand(right)); | |
| 636 break; | |
| 637 case Token::BIT_XOR: | |
| 638 __ xorl(ToRegister(left), ToOperand(right)); | |
| 639 break; | |
| 640 default: | |
| 641 UNREACHABLE(); | |
| 642 break; | |
| 643 } | |
| 644 } else { | |
| 645 ASSERT(right->IsRegister()); | |
| 646 switch (instr->op()) { | |
| 647 case Token::BIT_AND: | |
| 648 __ andl(ToRegister(left), ToRegister(right)); | |
| 649 break; | |
| 650 case Token::BIT_OR: | |
| 651 __ orl(ToRegister(left), ToRegister(right)); | |
| 652 break; | |
| 653 case Token::BIT_XOR: | |
| 654 __ xorl(ToRegister(left), ToRegister(right)); | |
| 655 break; | |
| 656 default: | |
| 657 UNREACHABLE(); | |
| 658 break; | |
| 659 } | |
| 660 } | |
| 661 } | |
| 609 | 662 |
| 610 | 663 |
| 611 void LCodeGen::DoShiftI(LShiftI* instr) { | 664 void LCodeGen::DoShiftI(LShiftI* instr) { |
| 612 Abort("Unimplemented: %s", "DoShiftI"); | 665 LOperand* left = instr->InputAt(0); |
| 666 LOperand* right = instr->InputAt(1); | |
| 667 ASSERT(left->Equals(instr->result())); | |
| 668 ASSERT(left->IsRegister()); | |
| 669 if (right->IsRegister()) { | |
| 670 ASSERT(ToRegister(right).is(rcx)); | |
| 671 | |
| 672 switch (instr->op()) { | |
| 673 case Token::SAR: | |
| 674 __ sarl_cl(ToRegister(left)); | |
| 675 break; | |
| 676 case Token::SHR: | |
| 677 __ shrl_cl(ToRegister(left)); | |
| 678 if (instr->can_deopt()) { | |
| 679 __ testl(ToRegister(left), Immediate(0x80000000)); | |
| 680 DeoptimizeIf(not_zero, instr->environment()); | |
| 681 } | |
| 682 break; | |
| 683 case Token::SHL: | |
| 684 __ shll_cl(ToRegister(left)); | |
| 685 break; | |
| 686 default: | |
| 687 UNREACHABLE(); | |
| 688 break; | |
| 689 } | |
| 690 } else { | |
| 691 int value = ToInteger32(LConstantOperand::cast(right)); | |
| 692 uint8_t shift_count = static_cast<uint8_t>(value & 0x1F); | |
| 693 switch (instr->op()) { | |
| 694 case Token::SAR: | |
| 695 if (shift_count != 0) { | |
| 696 __ sarl(ToRegister(left), Immediate(shift_count)); | |
| 697 } | |
| 698 break; | |
| 699 case Token::SHR: | |
| 700 if (shift_count == 0 && instr->can_deopt()) { | |
| 701 __ testl(ToRegister(left), Immediate(0x80000000)); | |
| 702 DeoptimizeIf(not_zero, instr->environment()); | |
| 703 } else { | |
| 704 __ shrl(ToRegister(left), Immediate(shift_count)); | |
| 705 } | |
| 706 break; | |
| 707 case Token::SHL: | |
| 708 if (shift_count != 0) { | |
| 709 __ shll(ToRegister(left), Immediate(shift_count)); | |
| 710 } | |
| 711 break; | |
| 712 default: | |
| 713 UNREACHABLE(); | |
| 714 break; | |
| 715 } | |
| 716 } | |
| 613 } | 717 } |
| 614 | 718 |
| 615 | 719 |
| 616 void LCodeGen::DoSubI(LSubI* instr) { | 720 void LCodeGen::DoSubI(LSubI* instr) { |
| 617 LOperand* left = instr->InputAt(0); | 721 LOperand* left = instr->InputAt(0); |
| 618 LOperand* right = instr->InputAt(1); | 722 LOperand* right = instr->InputAt(1); |
| 619 ASSERT(left->Equals(instr->result())); | 723 ASSERT(left->Equals(instr->result())); |
| 620 | 724 |
| 621 if (right->IsConstantOperand()) { | 725 if (right->IsConstantOperand()) { |
| 622 __ subl(ToRegister(left), | 726 __ subl(ToRegister(left), |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 656 } else { | 760 } else { |
| 657 uint64_t int_val = BitCast<uint64_t, double>(v); | 761 uint64_t int_val = BitCast<uint64_t, double>(v); |
| 658 __ Set(tmp, int_val); | 762 __ Set(tmp, int_val); |
| 659 __ movd(res, tmp); | 763 __ movd(res, tmp); |
| 660 } | 764 } |
| 661 } | 765 } |
| 662 } | 766 } |
| 663 | 767 |
| 664 | 768 |
| 665 void LCodeGen::DoConstantT(LConstantT* instr) { | 769 void LCodeGen::DoConstantT(LConstantT* instr) { |
| 666 ASSERT(instr->result()->IsRegister()); | 770 ASSERT(instr->result()->IsRegister()); |
| 667 __ Move(ToRegister(instr->result()), instr->value()); | 771 __ Move(ToRegister(instr->result()), instr->value()); |
| 668 } | 772 } |
| 669 | 773 |
| 670 | 774 |
| 671 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { | 775 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { |
| 672 Abort("Unimplemented: %s", "DoJSArrayLength"); | 776 Abort("Unimplemented: %s", "DoJSArrayLength"); |
| 673 } | 777 } |
| 674 | 778 |
| 675 | 779 |
| 676 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) { | 780 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) { |
| 677 Register result = ToRegister(instr->result()); | 781 Register result = ToRegister(instr->result()); |
| 678 Register array = ToRegister(instr->InputAt(0)); | 782 Register array = ToRegister(instr->InputAt(0)); |
| 679 __ movq(result, FieldOperand(array, FixedArray::kLengthOffset)); | 783 __ movq(result, FieldOperand(array, FixedArray::kLengthOffset)); |
| 680 } | 784 } |
| 681 | 785 |
| 682 | 786 |
| 683 void LCodeGen::DoValueOf(LValueOf* instr) { | 787 void LCodeGen::DoValueOf(LValueOf* instr) { |
| 684 Abort("Unimplemented: %s", "DoValueOf"); | 788 Abort("Unimplemented: %s", "DoValueOf"); |
| 685 } | 789 } |
| 686 | 790 |
| 687 | 791 |
| 688 void LCodeGen::DoBitNotI(LBitNotI* instr) { | 792 void LCodeGen::DoBitNotI(LBitNotI* instr) { |
| 689 Abort("Unimplemented: %s", "DoBitNotI"); | 793 LOperand* input = instr->InputAt(0); |
| 794 ASSERT(input->Equals(instr->result())); | |
| 795 __ not_(ToRegister(input)); | |
| 690 } | 796 } |
| 691 | 797 |
| 692 | 798 |
| 693 void LCodeGen::DoThrow(LThrow* instr) { | 799 void LCodeGen::DoThrow(LThrow* instr) { |
| 694 Abort("Unimplemented: %s", "DoThrow"); | 800 Abort("Unimplemented: %s", "DoThrow"); |
| 695 } | 801 } |
| 696 | 802 |
| 697 | 803 |
| 698 void LCodeGen::DoAddI(LAddI* instr) { | 804 void LCodeGen::DoAddI(LAddI* instr) { |
| 699 LOperand* left = instr->InputAt(0); | 805 LOperand* left = instr->InputAt(0); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 747 | 853 |
| 748 if (right_block == left_block) { | 854 if (right_block == left_block) { |
| 749 EmitGoto(left_block); | 855 EmitGoto(left_block); |
| 750 } else if (left_block == next_block) { | 856 } else if (left_block == next_block) { |
| 751 __ j(NegateCondition(cc), chunk_->GetAssemblyLabel(right_block)); | 857 __ j(NegateCondition(cc), chunk_->GetAssemblyLabel(right_block)); |
| 752 } else if (right_block == next_block) { | 858 } else if (right_block == next_block) { |
| 753 __ j(cc, chunk_->GetAssemblyLabel(left_block)); | 859 __ j(cc, chunk_->GetAssemblyLabel(left_block)); |
| 754 } else { | 860 } else { |
| 755 __ j(cc, chunk_->GetAssemblyLabel(left_block)); | 861 __ j(cc, chunk_->GetAssemblyLabel(left_block)); |
| 756 if (cc != always) { | 862 if (cc != always) { |
| 757 __ jmp(chunk_->GetAssemblyLabel(right_block)); | 863 __ jmp(chunk_->GetAssemblyLabel(right_block)); |
| 758 } | |
| 759 } | 864 } |
| 760 } | 865 } |
| 866 } | |
| 761 | 867 |
| 762 | 868 |
| 763 void LCodeGen::DoBranch(LBranch* instr) { | 869 void LCodeGen::DoBranch(LBranch* instr) { |
| 764 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 870 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
| 765 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 871 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
| 766 | 872 |
| 767 Representation r = instr->hydrogen()->representation(); | 873 Representation r = instr->hydrogen()->representation(); |
| 768 if (r.IsInteger32()) { | 874 if (r.IsInteger32()) { |
| 769 Register reg = ToRegister(instr->InputAt(0)); | 875 Register reg = ToRegister(instr->InputAt(0)); |
| 770 __ testl(reg, reg); | 876 __ testl(reg, reg); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 892 } | 998 } |
| 893 return cond; | 999 return cond; |
| 894 } | 1000 } |
| 895 | 1001 |
| 896 | 1002 |
| 897 void LCodeGen::EmitCmpI(LOperand* left, LOperand* right) { | 1003 void LCodeGen::EmitCmpI(LOperand* left, LOperand* right) { |
| 898 if (right->IsConstantOperand()) { | 1004 if (right->IsConstantOperand()) { |
| 899 int32_t value = ToInteger32(LConstantOperand::cast(right)); | 1005 int32_t value = ToInteger32(LConstantOperand::cast(right)); |
| 900 if (left->IsRegister()) { | 1006 if (left->IsRegister()) { |
| 901 __ cmpl(ToRegister(left), Immediate(value)); | 1007 __ cmpl(ToRegister(left), Immediate(value)); |
| 902 } else { | 1008 } else { |
| 903 __ cmpl(ToOperand(left), Immediate(value)); | 1009 __ cmpl(ToOperand(left), Immediate(value)); |
| 904 } | 1010 } |
| 905 } else if (right->IsRegister()) { | 1011 } else if (right->IsRegister()) { |
| 906 __ cmpq(ToRegister(left), ToRegister(right)); | 1012 __ cmpq(ToRegister(left), ToRegister(right)); |
| 907 } else { | 1013 } else { |
| 908 __ cmpq(ToRegister(left), ToOperand(right)); | 1014 __ cmpq(ToRegister(left), ToOperand(right)); |
| 909 } | 1015 } |
| 910 } | 1016 } |
| 911 | 1017 |
| 912 | 1018 |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1194 } | 1300 } |
| 1195 | 1301 |
| 1196 | 1302 |
| 1197 void LCodeGen::DoHasCachedArrayIndex(LHasCachedArrayIndex* instr) { | 1303 void LCodeGen::DoHasCachedArrayIndex(LHasCachedArrayIndex* instr) { |
| 1198 Abort("Unimplemented: %s", "DoHasCachedArrayIndex"); | 1304 Abort("Unimplemented: %s", "DoHasCachedArrayIndex"); |
| 1199 } | 1305 } |
| 1200 | 1306 |
| 1201 | 1307 |
| 1202 void LCodeGen::DoHasCachedArrayIndexAndBranch( | 1308 void LCodeGen::DoHasCachedArrayIndexAndBranch( |
| 1203 LHasCachedArrayIndexAndBranch* instr) { | 1309 LHasCachedArrayIndexAndBranch* instr) { |
| 1204 Register input = ToRegister(instr->InputAt(0)); | 1310 Register input = ToRegister(instr->InputAt(0)); |
| 1205 | 1311 |
| 1206 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 1312 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
| 1207 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 1313 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
| 1208 | 1314 |
| 1209 __ testl(FieldOperand(input, String::kHashFieldOffset), | 1315 __ testl(FieldOperand(input, String::kHashFieldOffset), |
| 1210 Immediate(String::kContainsCachedArrayIndexMask)); | 1316 Immediate(String::kContainsCachedArrayIndexMask)); |
| 1211 EmitBranch(true_block, false_block, not_equal); | 1317 EmitBranch(true_block, false_block, not_equal); |
| 1212 } | 1318 } |
| 1213 | 1319 |
| 1214 | 1320 |
| 1215 // Branches to a label or falls through with the answer in the z flag. | 1321 // Branches to a label or falls through with the answer in the z flag. |
| 1216 // Trashes the temp register and possibly input (if it and temp are aliased). | 1322 // Trashes the temp register and possibly input (if it and temp are aliased). |
| 1217 void LCodeGen::EmitClassOfTest(Label* is_true, | 1323 void LCodeGen::EmitClassOfTest(Label* is_true, |
| 1218 Label* is_false, | 1324 Label* is_false, |
| 1219 Handle<String> class_name, | 1325 Handle<String>class_name, |
| 1220 Register input, | 1326 Register input, |
| 1221 Register temp) { | 1327 Register temp) { |
| 1222 __ JumpIfSmi(input, is_false); | 1328 __ JumpIfSmi(input, is_false); |
| 1223 __ CmpObjectType(input, FIRST_JS_OBJECT_TYPE, temp); | 1329 __ CmpObjectType(input, FIRST_JS_OBJECT_TYPE, temp); |
| 1224 __ j(below, is_false); | 1330 __ j(below, is_false); |
| 1225 | 1331 |
| 1226 // Map is now in temp. | 1332 // Map is now in temp. |
| 1227 // Functions have class 'Function'. | 1333 // Functions have class 'Function'. |
| 1228 __ CmpInstanceType(temp, JS_FUNCTION_TYPE); | 1334 __ CmpInstanceType(temp, JS_FUNCTION_TYPE); |
| 1229 if (class_name->IsEqualTo(CStrVector("Function"))) { | 1335 if (class_name->IsEqualTo(CStrVector("Function"))) { |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 1246 if (class_name->IsEqualTo(CStrVector("Object"))) { | 1352 if (class_name->IsEqualTo(CStrVector("Object"))) { |
| 1247 __ j(not_equal, is_true); | 1353 __ j(not_equal, is_true); |
| 1248 } else { | 1354 } else { |
| 1249 __ j(not_equal, is_false); | 1355 __ j(not_equal, is_false); |
| 1250 } | 1356 } |
| 1251 | 1357 |
| 1252 // temp now contains the constructor function. Grab the | 1358 // temp now contains the constructor function. Grab the |
| 1253 // instance class name from there. | 1359 // instance class name from there. |
| 1254 __ movq(temp, FieldOperand(temp, JSFunction::kSharedFunctionInfoOffset)); | 1360 __ movq(temp, FieldOperand(temp, JSFunction::kSharedFunctionInfoOffset)); |
| 1255 __ movq(temp, FieldOperand(temp, | 1361 __ movq(temp, FieldOperand(temp, |
| 1256 SharedFunctionInfo::kInstanceClassNameOffset)); | 1362 SharedFunctionInfo::kInstanceClassNameOffset)); |
| 1257 // The class name we are testing against is a symbol because it's a literal. | 1363 // The class name we are testing against is a symbol because it's a literal. |
| 1258 // The name in the constructor is a symbol because of the way the context is | 1364 // The name in the constructor is a symbol because of the way the context is |
| 1259 // booted. This routine isn't expected to work for random API-created | 1365 // booted. This routine isn't expected to work for random API-created |
| 1260 // classes and it doesn't have to because you can't access it with natives | 1366 // classes and it doesn't have to because you can't access it with natives |
| 1261 // syntax. Since both sides are symbols it is sufficient to use an identity | 1367 // syntax. Since both sides are symbols it is sufficient to use an identity |
| 1262 // comparison. | 1368 // comparison. |
| 1263 ASSERT(class_name->IsSymbol()); | 1369 ASSERT(class_name->IsSymbol()); |
| 1264 __ Cmp(temp, class_name); | 1370 __ Cmp(temp, class_name); |
| 1265 // End with the answer in the z flag. | 1371 // End with the answer in the z flag. |
| 1266 } | 1372 } |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1517 LOperand* argument = instr->InputAt(0); | 1623 LOperand* argument = instr->InputAt(0); |
| 1518 if (argument->IsConstantOperand()) { | 1624 if (argument->IsConstantOperand()) { |
| 1519 LConstantOperand* const_op = LConstantOperand::cast(argument); | 1625 LConstantOperand* const_op = LConstantOperand::cast(argument); |
| 1520 Handle<Object> literal = chunk_->LookupLiteral(const_op); | 1626 Handle<Object> literal = chunk_->LookupLiteral(const_op); |
| 1521 Representation r = chunk_->LookupLiteralRepresentation(const_op); | 1627 Representation r = chunk_->LookupLiteralRepresentation(const_op); |
| 1522 if (r.IsInteger32()) { | 1628 if (r.IsInteger32()) { |
| 1523 ASSERT(literal->IsNumber()); | 1629 ASSERT(literal->IsNumber()); |
| 1524 __ push(Immediate(static_cast<int32_t>(literal->Number()))); | 1630 __ push(Immediate(static_cast<int32_t>(literal->Number()))); |
| 1525 } else if (r.IsDouble()) { | 1631 } else if (r.IsDouble()) { |
| 1526 Abort("unsupported double immediate"); | 1632 Abort("unsupported double immediate"); |
| 1527 } else { | 1633 } else { |
| 1528 ASSERT(r.IsTagged()); | 1634 ASSERT(r.IsTagged()); |
| 1529 __ Push(literal); | 1635 __ Push(literal); |
| 1530 } | 1636 } |
| 1531 } else if (argument->IsRegister()) { | 1637 } else if (argument->IsRegister()) { |
| 1532 __ push(ToRegister(argument)); | 1638 __ push(ToRegister(argument)); |
| 1533 } else { | 1639 } else { |
| 1534 ASSERT(!argument->IsDoubleRegister()); | 1640 ASSERT(!argument->IsDoubleRegister()); |
| 1535 __ push(ToOperand(argument)); | 1641 __ push(ToOperand(argument)); |
| 1536 } | 1642 } |
| 1537 } | 1643 } |
| 1538 | 1644 |
| 1539 | 1645 |
| 1540 void LCodeGen::DoGlobalObject(LGlobalObject* instr) { | 1646 void LCodeGen::DoGlobalObject(LGlobalObject* instr) { |
| 1541 Register result = ToRegister(instr->result()); | 1647 Register result = ToRegister(instr->result()); |
| 1542 __ movq(result, GlobalObjectOperand()); | 1648 __ movq(result, GlobalObjectOperand()); |
| 1543 } | 1649 } |
| 1544 | 1650 |
| 1545 | 1651 |
| 1546 void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) { | 1652 void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) { |
| (...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2123 | 2229 |
| 2124 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 2230 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
| 2125 Abort("Unimplemented: %s", "DoOsrEntry"); | 2231 Abort("Unimplemented: %s", "DoOsrEntry"); |
| 2126 } | 2232 } |
| 2127 | 2233 |
| 2128 #undef __ | 2234 #undef __ |
| 2129 | 2235 |
| 2130 } } // namespace v8::internal | 2236 } } // namespace v8::internal |
| 2131 | 2237 |
| 2132 #endif // V8_TARGET_ARCH_X64 | 2238 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |