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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 190 } |
191 | 191 |
192 Isolate* isolate = masm->isolate(); | 192 Isolate* isolate = masm->isolate(); |
193 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); | 193 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); |
194 bool call_data_undefined = false; | 194 bool call_data_undefined = false; |
195 // Put call data in place. | 195 // Put call data in place. |
196 if (api_call_info->data()->IsUndefined()) { | 196 if (api_call_info->data()->IsUndefined()) { |
197 call_data_undefined = true; | 197 call_data_undefined = true; |
198 __ mov(data, Immediate(isolate->factory()->undefined_value())); | 198 __ mov(data, Immediate(isolate->factory()->undefined_value())); |
199 } else { | 199 } else { |
200 __ mov(data, FieldOperand(callee, JSFunction::kSharedFunctionInfoOffset)); | 200 if (optimization.is_constant_call()) { |
201 __ mov(data, FieldOperand(data, SharedFunctionInfo::kFunctionDataOffset)); | 201 __ mov(data, FieldOperand(callee, JSFunction::kSharedFunctionInfoOffset)); |
202 __ mov(data, FieldOperand(data, FunctionTemplateInfo::kCallCodeOffset)); | 202 __ mov(data, FieldOperand(data, SharedFunctionInfo::kFunctionDataOffset)); |
| 203 __ mov(data, FieldOperand(data, FunctionTemplateInfo::kCallCodeOffset)); |
| 204 } else { |
| 205 __ mov(data, FieldOperand(callee, FunctionTemplateInfo::kCallCodeOffset)); |
| 206 } |
203 __ mov(data, FieldOperand(data, CallHandlerInfo::kDataOffset)); | 207 __ mov(data, FieldOperand(data, CallHandlerInfo::kDataOffset)); |
204 } | 208 } |
205 | 209 |
206 if (api_call_info->fast_handler()->IsCode()) { | 210 if (api_call_info->fast_handler()->IsCode()) { |
207 // Just tail call into the code. | 211 // Just tail call into the code. |
208 __ Jump(handle(Code::cast(api_call_info->fast_handler())), | 212 __ Jump(handle(Code::cast(api_call_info->fast_handler())), |
209 RelocInfo::CODE_TARGET); | 213 RelocInfo::CODE_TARGET); |
210 return; | 214 return; |
211 } | 215 } |
212 // Put api_function_address in place. | 216 // Put api_function_address in place. |
213 Address function_address = v8::ToCData<Address>(api_call_info->callback()); | 217 Address function_address = v8::ToCData<Address>(api_call_info->callback()); |
214 __ mov(api_function_address, Immediate(function_address)); | 218 __ mov(api_function_address, Immediate(function_address)); |
215 | 219 |
216 // Jump to stub. | 220 // Jump to stub. |
217 CallApiAccessorStub stub(isolate, is_store, call_data_undefined); | 221 CallApiAccessorStub stub(isolate, is_store, call_data_undefined, |
| 222 !optimization.is_constant_call()); |
218 __ TailCallStub(&stub); | 223 __ TailCallStub(&stub); |
219 } | 224 } |
220 | 225 |
221 | 226 |
222 // Generate code to check that a global property cell is empty. Create | 227 // Generate code to check that a global property cell is empty. Create |
223 // the property cell at compilation time if no cell exists for the | 228 // the property cell at compilation time if no cell exists for the |
224 // property. | 229 // property. |
225 void PropertyHandlerCompiler::GenerateCheckPropertyCell( | 230 void PropertyHandlerCompiler::GenerateCheckPropertyCell( |
226 MacroAssembler* masm, Handle<JSGlobalObject> global, Handle<Name> name, | 231 MacroAssembler* masm, Handle<JSGlobalObject> global, Handle<Name> name, |
227 Register scratch, Label* miss) { | 232 Register scratch, Label* miss) { |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 // Return the generated code. | 812 // Return the generated code. |
808 return GetCode(kind(), Code::NORMAL, name); | 813 return GetCode(kind(), Code::NORMAL, name); |
809 } | 814 } |
810 | 815 |
811 | 816 |
812 #undef __ | 817 #undef __ |
813 } // namespace internal | 818 } // namespace internal |
814 } // namespace v8 | 819 } // namespace v8 |
815 | 820 |
816 #endif // V8_TARGET_ARCH_IA32 | 821 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |