OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/ic/call-optimization.h" | 7 #include "src/ic/call-optimization.h" |
8 #include "src/ic/handler-compiler.h" | 8 #include "src/ic/handler-compiler.h" |
9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 } | 174 } |
175 | 175 |
176 Isolate* isolate = masm->isolate(); | 176 Isolate* isolate = masm->isolate(); |
177 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); | 177 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); |
178 bool call_data_undefined = false; | 178 bool call_data_undefined = false; |
179 // Put call data in place. | 179 // Put call data in place. |
180 if (api_call_info->data()->IsUndefined()) { | 180 if (api_call_info->data()->IsUndefined()) { |
181 call_data_undefined = true; | 181 call_data_undefined = true; |
182 __ LoadRoot(data, Heap::kUndefinedValueRootIndex); | 182 __ LoadRoot(data, Heap::kUndefinedValueRootIndex); |
183 } else { | 183 } else { |
184 if (optimization.is_constant_call()) { | 184 __ movp(data, FieldOperand(callee, JSFunction::kSharedFunctionInfoOffset)); |
185 __ movp(data, | 185 __ movp(data, FieldOperand(data, SharedFunctionInfo::kFunctionDataOffset)); |
186 FieldOperand(callee, JSFunction::kSharedFunctionInfoOffset)); | 186 __ movp(data, FieldOperand(data, FunctionTemplateInfo::kCallCodeOffset)); |
187 __ movp(data, | |
188 FieldOperand(data, SharedFunctionInfo::kFunctionDataOffset)); | |
189 __ movp(data, FieldOperand(data, FunctionTemplateInfo::kCallCodeOffset)); | |
190 } else { | |
191 __ movp(data, | |
192 FieldOperand(callee, FunctionTemplateInfo::kCallCodeOffset)); | |
193 } | |
194 __ movp(data, FieldOperand(data, CallHandlerInfo::kDataOffset)); | 187 __ movp(data, FieldOperand(data, CallHandlerInfo::kDataOffset)); |
195 } | 188 } |
196 | 189 |
197 if (api_call_info->fast_handler()->IsCode()) { | 190 if (api_call_info->fast_handler()->IsCode()) { |
198 // Just tail call into the fast handler if present. | 191 // Just tail call into the fast handler if present. |
199 __ Jump(handle(Code::cast(api_call_info->fast_handler())), | 192 __ Jump(handle(Code::cast(api_call_info->fast_handler())), |
200 RelocInfo::CODE_TARGET); | 193 RelocInfo::CODE_TARGET); |
201 return; | 194 return; |
202 } | 195 } |
203 | 196 |
204 // Put api_function_address in place. | 197 // Put api_function_address in place. |
205 Address function_address = v8::ToCData<Address>(api_call_info->callback()); | 198 Address function_address = v8::ToCData<Address>(api_call_info->callback()); |
206 __ Move(api_function_address, function_address, | 199 __ Move(api_function_address, function_address, |
207 RelocInfo::EXTERNAL_REFERENCE); | 200 RelocInfo::EXTERNAL_REFERENCE); |
208 | 201 |
209 // Jump to stub. | 202 // Jump to stub. |
210 CallApiAccessorStub stub(isolate, is_store, call_data_undefined, | 203 CallApiAccessorStub stub(isolate, is_store, call_data_undefined); |
211 !optimization.is_constant_call()); | |
212 __ TailCallStub(&stub); | 204 __ TailCallStub(&stub); |
213 } | 205 } |
214 | 206 |
215 | 207 |
216 void PropertyHandlerCompiler::GenerateCheckPropertyCell( | 208 void PropertyHandlerCompiler::GenerateCheckPropertyCell( |
217 MacroAssembler* masm, Handle<JSGlobalObject> global, Handle<Name> name, | 209 MacroAssembler* masm, Handle<JSGlobalObject> global, Handle<Name> name, |
218 Register scratch, Label* miss) { | 210 Register scratch, Label* miss) { |
219 Handle<PropertyCell> cell = JSGlobalObject::EnsurePropertyCell(global, name); | 211 Handle<PropertyCell> cell = JSGlobalObject::EnsurePropertyCell(global, name); |
220 DCHECK(cell->value()->IsTheHole()); | 212 DCHECK(cell->value()->IsTheHole()); |
221 Factory* factory = masm->isolate()->factory(); | 213 Factory* factory = masm->isolate()->factory(); |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 // Return the generated code. | 800 // Return the generated code. |
809 return GetCode(kind(), Code::NORMAL, name); | 801 return GetCode(kind(), Code::NORMAL, name); |
810 } | 802 } |
811 | 803 |
812 | 804 |
813 #undef __ | 805 #undef __ |
814 } // namespace internal | 806 } // namespace internal |
815 } // namespace v8 | 807 } // namespace v8 |
816 | 808 |
817 #endif // V8_TARGET_ARCH_X64 | 809 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |