| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 Isolate* isolate, | 54 Isolate* isolate, |
| 55 CodeStubInterfaceDescriptor* descriptor) { | 55 CodeStubInterfaceDescriptor* descriptor) { |
| 56 // x0: value | 56 // x0: value |
| 57 static Register registers[] = { x0 }; | 57 static Register registers[] = { x0 }; |
| 58 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 58 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); |
| 59 descriptor->register_params_ = registers; | 59 descriptor->register_params_ = registers; |
| 60 descriptor->deoptimization_handler_ = NULL; | 60 descriptor->deoptimization_handler_ = NULL; |
| 61 } | 61 } |
| 62 | 62 |
| 63 | 63 |
| 64 void NumberToStringStub::InitializeInterfaceDescriptor( |
| 65 Isolate* isolate, |
| 66 CodeStubInterfaceDescriptor* descriptor) { |
| 67 // x0: value |
| 68 static Register registers[] = { x0 }; |
| 69 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); |
| 70 descriptor->register_params_ = registers; |
| 71 descriptor->deoptimization_handler_ = NULL; |
| 72 } |
| 73 |
| 74 |
| 64 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( | 75 void FastCloneShallowArrayStub::InitializeInterfaceDescriptor( |
| 65 Isolate* isolate, | 76 Isolate* isolate, |
| 66 CodeStubInterfaceDescriptor* descriptor) { | 77 CodeStubInterfaceDescriptor* descriptor) { |
| 67 // x3: array literals array | 78 // x3: array literals array |
| 68 // x2: array literal index | 79 // x2: array literal index |
| 69 // x1: constant elements | 80 // x1: constant elements |
| 70 static Register registers[] = { x3, x2, x1 }; | 81 static Register registers[] = { x3, x2, x1 }; |
| 71 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); | 82 descriptor->register_param_count_ = sizeof(registers) / sizeof(registers[0]); |
| 72 descriptor->register_params_ = registers; | 83 descriptor->register_params_ = registers; |
| 73 descriptor->deoptimization_handler_ = | 84 descriptor->deoptimization_handler_ = |
| (...skipping 4031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4105 __ Bind(&slow); | 4116 __ Bind(&slow); |
| 4106 __ Push(length_smi, index_smi, input); | 4117 __ Push(length_smi, index_smi, input); |
| 4107 __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1); | 4118 __ TailCallRuntime(Runtime::kRegExpConstructResult, 3, 1); |
| 4108 } | 4119 } |
| 4109 | 4120 |
| 4110 | 4121 |
| 4111 // TODO(jbramley): Don't use static registers here, but take them as arguments. | 4122 // TODO(jbramley): Don't use static registers here, but take them as arguments. |
| 4112 static void GenerateRecordCallTarget(MacroAssembler* masm) { | 4123 static void GenerateRecordCallTarget(MacroAssembler* masm) { |
| 4113 // Cache the called function in a global property cell. Cache states are | 4124 // Cache the called function in a global property cell. Cache states are |
| 4114 // uninitialized, monomorphic (indicated by a JSFunction), and megamorphic. | 4125 // uninitialized, monomorphic (indicated by a JSFunction), and megamorphic. |
| 4126 // x0 : number of arguments to the construct function |
| 4115 // x1 : the function to call | 4127 // x1 : the function to call |
| 4116 // x2 : cache cell for the call target | 4128 // x2 : cache cell for the call target |
| 4117 Label initialize, done, miss, megamorphic, not_array_function; | 4129 Label initialize, done, miss, megamorphic, not_array_function; |
| 4118 | 4130 |
| 4119 ASSERT_EQ(*TypeFeedbackCells::MegamorphicSentinel(masm->isolate()), | 4131 ASSERT_EQ(*TypeFeedbackCells::MegamorphicSentinel(masm->isolate()), |
| 4120 masm->isolate()->heap()->undefined_value()); | 4132 masm->isolate()->heap()->undefined_value()); |
| 4121 ASSERT_EQ(*TypeFeedbackCells::UninitializedSentinel(masm->isolate()), | 4133 ASSERT_EQ(*TypeFeedbackCells::UninitializedSentinel(masm->isolate()), |
| 4122 masm->isolate()->heap()->the_hole_value()); | 4134 masm->isolate()->heap()->the_hole_value()); |
| 4123 | 4135 |
| 4124 // Load the cache state. | 4136 // Load the cache state. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4161 __ LoadArrayFunction(x3); | 4173 __ LoadArrayFunction(x3); |
| 4162 __ Cmp(x1, x3); | 4174 __ Cmp(x1, x3); |
| 4163 __ B(ne, ¬_array_function); | 4175 __ B(ne, ¬_array_function); |
| 4164 | 4176 |
| 4165 // The target function is the Array constructor, | 4177 // The target function is the Array constructor, |
| 4166 // Create an AllocationSite if we don't already have it, store it in the cell | 4178 // Create an AllocationSite if we don't already have it, store it in the cell |
| 4167 { | 4179 { |
| 4168 FrameScope scope(masm, StackFrame::INTERNAL); | 4180 FrameScope scope(masm, StackFrame::INTERNAL); |
| 4169 CreateAllocationSiteStub create_stub; | 4181 CreateAllocationSiteStub create_stub; |
| 4170 | 4182 |
| 4183 // Arguments register must be smi-tagged to call out. |
| 4171 __ SmiTag(x0); | 4184 __ SmiTag(x0); |
| 4172 __ Push(x0, x1, x2); | 4185 __ Push(x0, x1, x2); |
| 4173 | 4186 |
| 4174 __ CallStub(&create_stub); | 4187 __ CallStub(&create_stub); |
| 4175 | 4188 |
| 4176 __ Pop(x2, x1, x0); | 4189 __ Pop(x2, x1, x0); |
| 4177 __ SmiUntag(x0); | 4190 __ SmiUntag(x0); |
| 4178 } | 4191 } |
| 4179 __ B(&done); | 4192 __ B(&done); |
| 4180 | 4193 |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4782 __ Add(stub_entry, x0, Code::kHeaderSize - kHeapObjectTag); | 4795 __ Add(stub_entry, x0, Code::kHeaderSize - kHeapObjectTag); |
| 4783 // Restore caller-saved registers. | 4796 // Restore caller-saved registers. |
| 4784 __ Pop(lr, x0, x1); | 4797 __ Pop(lr, x0, x1); |
| 4785 } | 4798 } |
| 4786 | 4799 |
| 4787 // Tail-call to the new stub. | 4800 // Tail-call to the new stub. |
| 4788 __ Jump(stub_entry); | 4801 __ Jump(stub_entry); |
| 4789 } | 4802 } |
| 4790 | 4803 |
| 4791 | 4804 |
| 4792 void NumberToStringStub::Generate(MacroAssembler* masm) { | |
| 4793 Register result = x0; | |
| 4794 Register object = x1; | |
| 4795 Label runtime; | |
| 4796 | |
| 4797 __ Pop(object); | |
| 4798 | |
| 4799 // Generate code to lookup number in the number string cache. | |
| 4800 __ LookupNumberStringCache(object, result, x2, x3, x4, &runtime); | |
| 4801 __ Ret(); | |
| 4802 | |
| 4803 // Handle number to string in the runtime system if not found in the cache. | |
| 4804 __ Bind(&runtime); | |
| 4805 __ Push(object); | |
| 4806 __ TailCallRuntime(Runtime::kNumberToStringSkipCache, 1, 1); | |
| 4807 } | |
| 4808 | |
| 4809 | |
| 4810 void StringHelper::GenerateTwoCharacterStringTableProbe(MacroAssembler* masm, | 4805 void StringHelper::GenerateTwoCharacterStringTableProbe(MacroAssembler* masm, |
| 4811 Register c1, | 4806 Register c1, |
| 4812 Register c2, | 4807 Register c2, |
| 4813 Register scratch1, | 4808 Register scratch1, |
| 4814 Register scratch2, | 4809 Register scratch2, |
| 4815 Register scratch3, | 4810 Register scratch3, |
| 4816 Register scratch4, | 4811 Register scratch4, |
| 4817 Register scratch5, | 4812 Register scratch5, |
| 4818 Label* not_found) { | 4813 Label* not_found) { |
| 4819 ASSERT(!AreAliased(c1, c2, scratch1, scratch2, scratch3, scratch4, scratch5)); | 4814 ASSERT(!AreAliased(c1, c2, scratch1, scratch2, scratch3, scratch4, scratch5)); |
| (...skipping 2034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6854 __ Bind(&fast_elements_case); | 6849 __ Bind(&fast_elements_case); |
| 6855 GenerateCase(masm, FAST_ELEMENTS); | 6850 GenerateCase(masm, FAST_ELEMENTS); |
| 6856 } | 6851 } |
| 6857 | 6852 |
| 6858 | 6853 |
| 6859 #undef __ | 6854 #undef __ |
| 6860 | 6855 |
| 6861 } } // namespace v8::internal | 6856 } } // namespace v8::internal |
| 6862 | 6857 |
| 6863 #endif // V8_TARGET_ARCH_A64 | 6858 #endif // V8_TARGET_ARCH_A64 |
| OLD | NEW |