| 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 21 matching lines...) Expand all Loading... |
| 32 #include "x64/lithium-codegen-x64.h" | 32 #include "x64/lithium-codegen-x64.h" |
| 33 #include "code-stubs.h" | 33 #include "code-stubs.h" |
| 34 #include "stub-cache.h" | 34 #include "stub-cache.h" |
| 35 | 35 |
| 36 namespace v8 { | 36 namespace v8 { |
| 37 namespace internal { | 37 namespace internal { |
| 38 | 38 |
| 39 | 39 |
| 40 // When invoking builtins, we need to record the safepoint in the middle of | 40 // When invoking builtins, we need to record the safepoint in the middle of |
| 41 // the invoke instruction sequence generated by the macro assembler. | 41 // the invoke instruction sequence generated by the macro assembler. |
| 42 class SafepointGenerator : public PostCallGenerator { | 42 class SafepointGenerator : public CallWrapper { |
| 43 public: | 43 public: |
| 44 SafepointGenerator(LCodeGen* codegen, | 44 SafepointGenerator(LCodeGen* codegen, |
| 45 LPointerMap* pointers, | 45 LPointerMap* pointers, |
| 46 int deoptimization_index, | 46 int deoptimization_index, |
| 47 bool ensure_reloc_space = false) | 47 bool ensure_reloc_space = false) |
| 48 : codegen_(codegen), | 48 : codegen_(codegen), |
| 49 pointers_(pointers), | 49 pointers_(pointers), |
| 50 deoptimization_index_(deoptimization_index), | 50 deoptimization_index_(deoptimization_index), |
| 51 ensure_reloc_space_(ensure_reloc_space), | 51 ensure_reloc_space_(ensure_reloc_space) { } |
| 52 previous_safepoint_position_(-kMinSafepointSize) { } | |
| 53 virtual ~SafepointGenerator() { } | 52 virtual ~SafepointGenerator() { } |
| 54 | 53 |
| 55 virtual void Generate() { | 54 virtual void BeforeCall(int call_size) { |
| 55 ASSERT(call_size >= 0); |
| 56 // Ensure that we have enough space after the previous safepoint position | 56 // Ensure that we have enough space after the previous safepoint position |
| 57 // for the generated code there. | 57 // for the jump generated there. |
| 58 int position = codegen_->masm()->pc_offset(); | 58 int call_end = codegen_->masm()->pc_offset() + call_size; |
| 59 ASSERT(position > previous_safepoint_position_); | 59 int prev_jump_end = codegen_->LastSafepointEnd() + kMinSafepointSize; |
| 60 if (position < previous_safepoint_position_ + kMinSafepointSize) { | 60 if (call_end < prev_jump_end) { |
| 61 int padding_size = | 61 int padding_size = prev_jump_end - call_end; |
| 62 previous_safepoint_position_ + kMinSafepointSize - position; | |
| 63 STATIC_ASSERT(kMinSafepointSize <= 9); // One multibyte nop is enough. | 62 STATIC_ASSERT(kMinSafepointSize <= 9); // One multibyte nop is enough. |
| 64 codegen_->masm()->nop(padding_size); | 63 codegen_->masm()->nop(padding_size); |
| 65 position += padding_size; | |
| 66 } | 64 } |
| 65 } |
| 66 |
| 67 virtual void AfterCall() { |
| 67 // Ensure that we have enough space in the reloc info to patch | 68 // Ensure that we have enough space in the reloc info to patch |
| 68 // this with calls when doing deoptimization. | 69 // this with calls when doing deoptimization. |
| 69 if (ensure_reloc_space_) { | 70 if (ensure_reloc_space_) { |
| 70 codegen_->masm()->RecordComment(RelocInfo::kFillerCommentString, true); | 71 codegen_->masm()->RecordComment(RelocInfo::kFillerCommentString, true); |
| 71 } | 72 } |
| 72 codegen_->RecordSafepoint(pointers_, deoptimization_index_); | 73 codegen_->RecordSafepoint(pointers_, deoptimization_index_); |
| 73 previous_safepoint_position_ = position; | |
| 74 } | 74 } |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 static const int kMinSafepointSize = | 77 static const int kMinSafepointSize = |
| 78 MacroAssembler::kShortCallInstructionLength; | 78 MacroAssembler::kShortCallInstructionLength; |
| 79 LCodeGen* codegen_; | 79 LCodeGen* codegen_; |
| 80 LPointerMap* pointers_; | 80 LPointerMap* pointers_; |
| 81 int deoptimization_index_; | 81 int deoptimization_index_; |
| 82 bool ensure_reloc_space_; | 82 bool ensure_reloc_space_; |
| 83 int previous_safepoint_position_; | |
| 84 }; | 83 }; |
| 85 | 84 |
| 86 | 85 |
| 87 #define __ masm()-> | 86 #define __ masm()-> |
| 88 | 87 |
| 89 bool LCodeGen::GenerateCode() { | 88 bool LCodeGen::GenerateCode() { |
| 90 HPhase phase("Code generation", chunk()); | 89 HPhase phase("Code generation", chunk()); |
| 91 ASSERT(is_unused()); | 90 ASSERT(is_unused()); |
| 92 status_ = GENERATING; | 91 status_ = GENERATING; |
| 93 return GeneratePrologue() && | 92 return GeneratePrologue() && |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 if (current_instruction_ < instructions_->length() - 1) { | 251 if (current_instruction_ < instructions_->length() - 1) { |
| 253 return instructions_->at(current_instruction_ + 1); | 252 return instructions_->at(current_instruction_ + 1); |
| 254 } else { | 253 } else { |
| 255 return NULL; | 254 return NULL; |
| 256 } | 255 } |
| 257 } | 256 } |
| 258 | 257 |
| 259 | 258 |
| 260 bool LCodeGen::GenerateJumpTable() { | 259 bool LCodeGen::GenerateJumpTable() { |
| 261 for (int i = 0; i < jump_table_.length(); i++) { | 260 for (int i = 0; i < jump_table_.length(); i++) { |
| 262 JumpTableEntry* info = jump_table_[i]; | 261 __ bind(&jump_table_[i].label); |
| 263 __ bind(&(info->label_)); | 262 __ Jump(jump_table_[i].address, RelocInfo::RUNTIME_ENTRY); |
| 264 __ Jump(info->address_, RelocInfo::RUNTIME_ENTRY); | |
| 265 } | 263 } |
| 266 return !is_aborted(); | 264 return !is_aborted(); |
| 267 } | 265 } |
| 268 | 266 |
| 269 | 267 |
| 270 bool LCodeGen::GenerateDeferredCode() { | 268 bool LCodeGen::GenerateDeferredCode() { |
| 271 ASSERT(is_generating()); | 269 ASSERT(is_generating()); |
| 272 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { | 270 for (int i = 0; !is_aborted() && i < deferred_.length(); i++) { |
| 273 LDeferredCode* code = deferred_[i]; | 271 LDeferredCode* code = deferred_[i]; |
| 274 __ bind(code->entry()); | 272 __ bind(code->entry()); |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 Address entry = Deoptimizer::GetDeoptimizationEntry(id, Deoptimizer::EAGER); | 530 Address entry = Deoptimizer::GetDeoptimizationEntry(id, Deoptimizer::EAGER); |
| 533 ASSERT(entry != NULL); | 531 ASSERT(entry != NULL); |
| 534 if (entry == NULL) { | 532 if (entry == NULL) { |
| 535 Abort("bailout was not prepared"); | 533 Abort("bailout was not prepared"); |
| 536 return; | 534 return; |
| 537 } | 535 } |
| 538 | 536 |
| 539 if (cc == no_condition) { | 537 if (cc == no_condition) { |
| 540 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); | 538 __ Jump(entry, RelocInfo::RUNTIME_ENTRY); |
| 541 } else { | 539 } else { |
| 542 JumpTableEntry* jump_info = NULL; | |
| 543 // We often have several deopts to the same entry, reuse the last | 540 // We often have several deopts to the same entry, reuse the last |
| 544 // jump entry if this is the case. | 541 // jump entry if this is the case. |
| 545 if (jump_table_.length() > 0 && | 542 if (jump_table_.is_empty() || |
| 546 jump_table_[jump_table_.length() - 1]->address_ == entry) { | 543 jump_table_.last().address != entry) { |
| 547 jump_info = jump_table_[jump_table_.length() - 1]; | 544 jump_table_.Add(entry); |
| 548 } else { | |
| 549 jump_info = new JumpTableEntry(entry); | |
| 550 jump_table_.Add(jump_info); | |
| 551 } | 545 } |
| 552 __ j(cc, &jump_info->label_); | 546 __ j(cc, &jump_table_.last().label); |
| 553 } | 547 } |
| 554 } | 548 } |
| 555 | 549 |
| 556 | 550 |
| 557 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { | 551 void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) { |
| 558 int length = deoptimizations_.length(); | 552 int length = deoptimizations_.length(); |
| 559 if (length == 0) return; | 553 if (length == 0) return; |
| 560 ASSERT(FLAG_deopt); | 554 ASSERT(FLAG_deopt); |
| 561 Handle<DeoptimizationInputData> data = | 555 Handle<DeoptimizationInputData> data = |
| 562 FACTORY->NewDeoptimizationInputData(length, TENURED); | 556 FACTORY->NewDeoptimizationInputData(length, TENURED); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 case CodeStub::SubString: { | 712 case CodeStub::SubString: { |
| 719 SubStringStub stub; | 713 SubStringStub stub; |
| 720 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 714 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 721 break; | 715 break; |
| 722 } | 716 } |
| 723 case CodeStub::StringCharAt: { | 717 case CodeStub::StringCharAt: { |
| 724 StringCharAtStub stub; | 718 StringCharAtStub stub; |
| 725 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 719 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 726 break; | 720 break; |
| 727 } | 721 } |
| 728 case CodeStub::MathPow: { | |
| 729 MathPowStub stub; | |
| 730 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | |
| 731 break; | |
| 732 } | |
| 733 case CodeStub::NumberToString: { | 722 case CodeStub::NumberToString: { |
| 734 NumberToStringStub stub; | 723 NumberToStringStub stub; |
| 735 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 724 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 736 break; | 725 break; |
| 737 } | 726 } |
| 738 case CodeStub::StringAdd: { | 727 case CodeStub::StringAdd: { |
| 739 StringAddStub stub(NO_STRING_ADD_FLAGS); | 728 StringAddStub stub(NO_STRING_ADD_FLAGS); |
| 740 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 729 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 741 break; | 730 break; |
| 742 } | 731 } |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1060 } | 1049 } |
| 1061 | 1050 |
| 1062 | 1051 |
| 1063 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) { | 1052 void LCodeGen::DoFixedArrayLength(LFixedArrayLength* instr) { |
| 1064 Register result = ToRegister(instr->result()); | 1053 Register result = ToRegister(instr->result()); |
| 1065 Register array = ToRegister(instr->InputAt(0)); | 1054 Register array = ToRegister(instr->InputAt(0)); |
| 1066 __ movq(result, FieldOperand(array, FixedArray::kLengthOffset)); | 1055 __ movq(result, FieldOperand(array, FixedArray::kLengthOffset)); |
| 1067 } | 1056 } |
| 1068 | 1057 |
| 1069 | 1058 |
| 1070 void LCodeGen::DoPixelArrayLength(LPixelArrayLength* instr) { | 1059 void LCodeGen::DoExternalArrayLength(LExternalArrayLength* instr) { |
| 1071 Register result = ToRegister(instr->result()); | 1060 Register result = ToRegister(instr->result()); |
| 1072 Register array = ToRegister(instr->InputAt(0)); | 1061 Register array = ToRegister(instr->InputAt(0)); |
| 1073 __ movq(result, FieldOperand(array, PixelArray::kLengthOffset)); | 1062 __ movq(result, FieldOperand(array, ExternalPixelArray::kLengthOffset)); |
| 1074 } | 1063 } |
| 1075 | 1064 |
| 1076 | 1065 |
| 1077 void LCodeGen::DoValueOf(LValueOf* instr) { | 1066 void LCodeGen::DoValueOf(LValueOf* instr) { |
| 1078 Register input = ToRegister(instr->InputAt(0)); | 1067 Register input = ToRegister(instr->InputAt(0)); |
| 1079 Register result = ToRegister(instr->result()); | 1068 Register result = ToRegister(instr->result()); |
| 1080 ASSERT(input.is(result)); | 1069 ASSERT(input.is(result)); |
| 1081 NearLabel done; | 1070 NearLabel done; |
| 1082 // If the object is a smi return the object. | 1071 // If the object is a smi return the object. |
| 1083 __ JumpIfSmi(input, &done); | 1072 __ JumpIfSmi(input, &done); |
| (...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1827 } | 1816 } |
| 1828 | 1817 |
| 1829 | 1818 |
| 1830 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { | 1819 void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { |
| 1831 class DeferredInstanceOfKnownGlobal: public LDeferredCode { | 1820 class DeferredInstanceOfKnownGlobal: public LDeferredCode { |
| 1832 public: | 1821 public: |
| 1833 DeferredInstanceOfKnownGlobal(LCodeGen* codegen, | 1822 DeferredInstanceOfKnownGlobal(LCodeGen* codegen, |
| 1834 LInstanceOfKnownGlobal* instr) | 1823 LInstanceOfKnownGlobal* instr) |
| 1835 : LDeferredCode(codegen), instr_(instr) { } | 1824 : LDeferredCode(codegen), instr_(instr) { } |
| 1836 virtual void Generate() { | 1825 virtual void Generate() { |
| 1837 codegen()->DoDeferredLInstanceOfKnownGlobal(instr_); | 1826 codegen()->DoDeferredLInstanceOfKnownGlobal(instr_, &map_check_); |
| 1838 } | 1827 } |
| 1839 | 1828 |
| 1829 Label* map_check() { return &map_check_; } |
| 1830 |
| 1840 private: | 1831 private: |
| 1841 LInstanceOfKnownGlobal* instr_; | 1832 LInstanceOfKnownGlobal* instr_; |
| 1833 Label map_check_; |
| 1842 }; | 1834 }; |
| 1843 | 1835 |
| 1844 | 1836 |
| 1845 DeferredInstanceOfKnownGlobal* deferred; | 1837 DeferredInstanceOfKnownGlobal* deferred; |
| 1846 deferred = new DeferredInstanceOfKnownGlobal(this, instr); | 1838 deferred = new DeferredInstanceOfKnownGlobal(this, instr); |
| 1847 | 1839 |
| 1848 Label false_result; | 1840 Label done, false_result; |
| 1849 Register object = ToRegister(instr->InputAt(0)); | 1841 Register object = ToRegister(instr->InputAt(0)); |
| 1850 | 1842 |
| 1851 // A Smi is not an instance of anything. | 1843 // A Smi is not an instance of anything. |
| 1852 __ JumpIfSmi(object, &false_result); | 1844 __ JumpIfSmi(object, &false_result); |
| 1853 | 1845 |
| 1854 // Null is not an instance of anything. | 1846 // This is the inlined call site instanceof cache. The two occurences of the |
| 1847 // hole value will be patched to the last map/result pair generated by the |
| 1848 // instanceof stub. |
| 1849 NearLabel cache_miss; |
| 1850 // Use a temp register to avoid memory operands with variable lengths. |
| 1851 Register map = ToRegister(instr->TempAt(0)); |
| 1852 __ movq(map, FieldOperand(object, HeapObject::kMapOffset)); |
| 1853 __ bind(deferred->map_check()); // Label for calculating code patching. |
| 1854 __ Move(kScratchRegister, Factory::the_hole_value()); |
| 1855 __ cmpq(map, kScratchRegister); // Patched to cached map. |
| 1856 __ j(not_equal, &cache_miss); |
| 1857 // Patched to load either true or false. |
| 1858 __ LoadRoot(ToRegister(instr->result()), Heap::kTheHoleValueRootIndex); |
| 1859 #ifdef DEBUG |
| 1860 // Check that the code size between patch label and patch sites is invariant. |
| 1861 Label end_of_patched_code; |
| 1862 __ bind(&end_of_patched_code); |
| 1863 ASSERT(true); |
| 1864 #endif |
| 1865 __ jmp(&done); |
| 1866 |
| 1867 // The inlined call site cache did not match. Check for null and string |
| 1868 // before calling the deferred code. |
| 1869 __ bind(&cache_miss); // Null is not an instance of anything. |
| 1855 __ CompareRoot(object, Heap::kNullValueRootIndex); | 1870 __ CompareRoot(object, Heap::kNullValueRootIndex); |
| 1856 __ j(equal, &false_result); | 1871 __ j(equal, &false_result); |
| 1857 | 1872 |
| 1858 // String values are not instances of anything. | 1873 // String values are not instances of anything. |
| 1859 __ JumpIfNotString(object, kScratchRegister, deferred->entry()); | 1874 __ JumpIfNotString(object, kScratchRegister, deferred->entry()); |
| 1860 | 1875 |
| 1861 __ bind(&false_result); | 1876 __ bind(&false_result); |
| 1862 __ LoadRoot(ToRegister(instr->result()), Heap::kFalseValueRootIndex); | 1877 __ LoadRoot(ToRegister(instr->result()), Heap::kFalseValueRootIndex); |
| 1863 | 1878 |
| 1864 __ bind(deferred->exit()); | 1879 __ bind(deferred->exit()); |
| 1880 __ bind(&done); |
| 1865 } | 1881 } |
| 1866 | 1882 |
| 1867 | 1883 |
| 1868 void LCodeGen::DoDeferredLInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { | 1884 void LCodeGen::DoDeferredLInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, |
| 1885 Label* map_check) { |
| 1869 __ PushSafepointRegisters(); | 1886 __ PushSafepointRegisters(); |
| 1870 | 1887 InstanceofStub::Flags flags = static_cast<InstanceofStub::Flags>( |
| 1871 InstanceofStub stub(InstanceofStub::kNoFlags); | 1888 InstanceofStub::kNoFlags | InstanceofStub::kCallSiteInlineCheck); |
| 1889 InstanceofStub stub(flags); |
| 1872 | 1890 |
| 1873 __ push(ToRegister(instr->InputAt(0))); | 1891 __ push(ToRegister(instr->InputAt(0))); |
| 1874 __ Push(instr->function()); | 1892 __ Push(instr->function()); |
| 1875 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 1893 Register temp = ToRegister(instr->TempAt(0)); |
| 1894 ASSERT(temp.is(rdi)); |
| 1895 static const int kAdditionalDelta = 16; |
| 1896 int delta = |
| 1897 masm_->SizeOfCodeGeneratedSince(map_check) + kAdditionalDelta; |
| 1898 __ movq(temp, Immediate(delta)); |
| 1899 __ push(temp); |
| 1876 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 1900 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 1877 __ movq(kScratchRegister, rax); | 1901 __ movq(kScratchRegister, rax); |
| 1878 __ PopSafepointRegisters(); | 1902 __ PopSafepointRegisters(); |
| 1879 __ testq(kScratchRegister, kScratchRegister); | 1903 __ testq(kScratchRegister, kScratchRegister); |
| 1880 Label load_false; | 1904 Label load_false; |
| 1881 Label done; | 1905 Label done; |
| 1882 __ j(not_zero, &load_false); | 1906 __ j(not_zero, &load_false); |
| 1883 __ LoadRoot(rax, Heap::kTrueValueRootIndex); | 1907 __ LoadRoot(rax, Heap::kTrueValueRootIndex); |
| 1884 __ jmp(&done); | 1908 __ jmp(&done); |
| 1885 __ bind(&load_false); | 1909 __ bind(&load_false); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2065 void LCodeGen::DoLoadElements(LLoadElements* instr) { | 2089 void LCodeGen::DoLoadElements(LLoadElements* instr) { |
| 2066 Register result = ToRegister(instr->result()); | 2090 Register result = ToRegister(instr->result()); |
| 2067 Register input = ToRegister(instr->InputAt(0)); | 2091 Register input = ToRegister(instr->InputAt(0)); |
| 2068 __ movq(result, FieldOperand(input, JSObject::kElementsOffset)); | 2092 __ movq(result, FieldOperand(input, JSObject::kElementsOffset)); |
| 2069 if (FLAG_debug_code) { | 2093 if (FLAG_debug_code) { |
| 2070 NearLabel done; | 2094 NearLabel done; |
| 2071 __ Cmp(FieldOperand(result, HeapObject::kMapOffset), | 2095 __ Cmp(FieldOperand(result, HeapObject::kMapOffset), |
| 2072 FACTORY->fixed_array_map()); | 2096 FACTORY->fixed_array_map()); |
| 2073 __ j(equal, &done); | 2097 __ j(equal, &done); |
| 2074 __ Cmp(FieldOperand(result, HeapObject::kMapOffset), | 2098 __ Cmp(FieldOperand(result, HeapObject::kMapOffset), |
| 2075 FACTORY->pixel_array_map()); | 2099 FACTORY->external_pixel_array_map()); |
| 2076 __ j(equal, &done); | 2100 __ j(equal, &done); |
| 2077 __ Cmp(FieldOperand(result, HeapObject::kMapOffset), | 2101 __ Cmp(FieldOperand(result, HeapObject::kMapOffset), |
| 2078 FACTORY->fixed_cow_array_map()); | 2102 FACTORY->fixed_cow_array_map()); |
| 2079 __ Check(equal, "Check for fast elements failed."); | 2103 __ Check(equal, "Check for fast elements failed."); |
| 2080 __ bind(&done); | 2104 __ bind(&done); |
| 2081 } | 2105 } |
| 2082 } | 2106 } |
| 2083 | 2107 |
| 2084 | 2108 |
| 2085 void LCodeGen::DoLoadPixelArrayExternalPointer( | 2109 void LCodeGen::DoLoadExternalArrayPointer( |
| 2086 LLoadPixelArrayExternalPointer* instr) { | 2110 LLoadExternalArrayPointer* instr) { |
| 2087 Register result = ToRegister(instr->result()); | 2111 Register result = ToRegister(instr->result()); |
| 2088 Register input = ToRegister(instr->InputAt(0)); | 2112 Register input = ToRegister(instr->InputAt(0)); |
| 2089 __ movq(result, FieldOperand(input, PixelArray::kExternalPointerOffset)); | 2113 __ movq(result, FieldOperand(input, |
| 2114 ExternalPixelArray::kExternalPointerOffset)); |
| 2090 } | 2115 } |
| 2091 | 2116 |
| 2092 | 2117 |
| 2093 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { | 2118 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { |
| 2094 Register arguments = ToRegister(instr->arguments()); | 2119 Register arguments = ToRegister(instr->arguments()); |
| 2095 Register length = ToRegister(instr->length()); | 2120 Register length = ToRegister(instr->length()); |
| 2096 Register result = ToRegister(instr->result()); | 2121 Register result = ToRegister(instr->result()); |
| 2097 | 2122 |
| 2098 if (instr->index()->IsRegister()) { | 2123 if (instr->index()->IsRegister()) { |
| 2099 __ subl(length, ToRegister(instr->index())); | 2124 __ subl(length, ToRegister(instr->index())); |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2567 | 2592 |
| 2568 __ bind(&call); | 2593 __ bind(&call); |
| 2569 __ PrepareCallCFunction(2); | 2594 __ PrepareCallCFunction(2); |
| 2570 // Move arguments to correct registers xmm0 and xmm1. | 2595 // Move arguments to correct registers xmm0 and xmm1. |
| 2571 __ movsd(xmm0, left_reg); | 2596 __ movsd(xmm0, left_reg); |
| 2572 // Right argument is already in xmm1. | 2597 // Right argument is already in xmm1. |
| 2573 __ CallCFunction(ExternalReference::power_double_double_function(), 2); | 2598 __ CallCFunction(ExternalReference::power_double_double_function(), 2); |
| 2574 } | 2599 } |
| 2575 // Return value is in xmm0. | 2600 // Return value is in xmm0. |
| 2576 __ movsd(result_reg, xmm0); | 2601 __ movsd(result_reg, xmm0); |
| 2602 // Restore context register. |
| 2603 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
| 2577 } | 2604 } |
| 2578 | 2605 |
| 2579 | 2606 |
| 2580 void LCodeGen::DoMathLog(LUnaryMathOperation* instr) { | 2607 void LCodeGen::DoMathLog(LUnaryMathOperation* instr) { |
| 2581 ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); | 2608 ASSERT(ToDoubleRegister(instr->result()).is(xmm1)); |
| 2582 TranscendentalCacheStub stub(TranscendentalCache::LOG, | 2609 TranscendentalCacheStub stub(TranscendentalCache::LOG, |
| 2583 TranscendentalCacheStub::UNTAGGED); | 2610 TranscendentalCacheStub::UNTAGGED); |
| 2584 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 2611 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 2585 } | 2612 } |
| 2586 | 2613 |
| (...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3669 RegisterEnvironmentForDeoptimization(environment); | 3696 RegisterEnvironmentForDeoptimization(environment); |
| 3670 ASSERT(osr_pc_offset_ == -1); | 3697 ASSERT(osr_pc_offset_ == -1); |
| 3671 osr_pc_offset_ = masm()->pc_offset(); | 3698 osr_pc_offset_ = masm()->pc_offset(); |
| 3672 } | 3699 } |
| 3673 | 3700 |
| 3674 #undef __ | 3701 #undef __ |
| 3675 | 3702 |
| 3676 } } // namespace v8::internal | 3703 } } // namespace v8::internal |
| 3677 | 3704 |
| 3678 #endif // V8_TARGET_ARCH_X64 | 3705 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |