| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
| 8 | 8 |
| 9 #include "src/ic/call-optimization.h" | 9 #include "src/ic/call-optimization.h" |
| 10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | 219 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); |
| 220 __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()), | 220 __ CallExternalReference(ExternalReference(IC_Utility(id), masm->isolate()), |
| 221 NamedLoadHandlerCompiler::kInterceptorArgsLength); | 221 NamedLoadHandlerCompiler::kInterceptorArgsLength); |
| 222 } | 222 } |
| 223 | 223 |
| 224 | 224 |
| 225 // Generate call to api function. | 225 // Generate call to api function. |
| 226 void PropertyHandlerCompiler::GenerateApiAccessorCall( | 226 void PropertyHandlerCompiler::GenerateApiAccessorCall( |
| 227 MacroAssembler* masm, const CallOptimization& optimization, | 227 MacroAssembler* masm, const CallOptimization& optimization, |
| 228 Handle<Map> receiver_map, Register receiver, Register scratch_in, | 228 Handle<Map> receiver_map, Register receiver, Register scratch_in, |
| 229 bool is_store, Register store_parameter) { | 229 bool is_store, Register store_parameter, Register accessor_holder, |
| 230 int accessor_index) { |
| 231 DCHECK(!accessor_holder.is(scratch_in)); |
| 230 DCHECK(!receiver.is(scratch_in)); | 232 DCHECK(!receiver.is(scratch_in)); |
| 231 __ push(receiver); | 233 __ push(receiver); |
| 232 // Write the arguments to stack frame. | 234 // Write the arguments to stack frame. |
| 233 if (is_store) { | 235 if (is_store) { |
| 234 DCHECK(!receiver.is(store_parameter)); | 236 DCHECK(!receiver.is(store_parameter)); |
| 235 DCHECK(!scratch_in.is(store_parameter)); | 237 DCHECK(!scratch_in.is(store_parameter)); |
| 236 __ push(store_parameter); | 238 __ push(store_parameter); |
| 237 } | 239 } |
| 238 DCHECK(optimization.is_simple_api_call()); | 240 DCHECK(optimization.is_simple_api_call()); |
| 239 | 241 |
| 240 // Abi for CallApiFunctionStub. | 242 // Abi for CallApiFunctionStub. |
| 241 Register callee = a0; | 243 Register callee = a0; |
| 242 Register call_data = a4; | 244 Register call_data = a4; |
| 243 Register holder = a2; | 245 Register holder = a2; |
| 244 Register api_function_address = a1; | 246 Register api_function_address = a1; |
| 245 | 247 |
| 248 // Put callee in place. |
| 249 __ LoadAccessor(callee, holder, accessor_index, |
| 250 is_store ? ACCESSOR_SETTER : ACCESSOR_GETTER); |
| 251 |
| 246 // Put holder in place. | 252 // Put holder in place. |
| 247 CallOptimization::HolderLookup holder_lookup; | 253 CallOptimization::HolderLookup holder_lookup; |
| 248 Handle<JSObject> api_holder = | 254 Handle<JSObject> api_holder = |
| 249 optimization.LookupHolderOfExpectedType(receiver_map, &holder_lookup); | 255 optimization.LookupHolderOfExpectedType(receiver_map, &holder_lookup); |
| 250 switch (holder_lookup) { | 256 switch (holder_lookup) { |
| 251 case CallOptimization::kHolderIsReceiver: | 257 case CallOptimization::kHolderIsReceiver: |
| 252 __ Move(holder, receiver); | 258 __ Move(holder, receiver); |
| 253 break; | 259 break; |
| 254 case CallOptimization::kHolderFound: | 260 case CallOptimization::kHolderFound: |
| 255 __ li(holder, api_holder); | 261 __ li(holder, api_holder); |
| 256 break; | 262 break; |
| 257 case CallOptimization::kHolderNotFound: | 263 case CallOptimization::kHolderNotFound: |
| 258 UNREACHABLE(); | 264 UNREACHABLE(); |
| 259 break; | 265 break; |
| 260 } | 266 } |
| 261 | 267 |
| 262 Isolate* isolate = masm->isolate(); | 268 Isolate* isolate = masm->isolate(); |
| 263 Handle<JSFunction> function = optimization.constant_function(); | |
| 264 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); | 269 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); |
| 265 Handle<Object> call_data_obj(api_call_info->data(), isolate); | 270 Handle<Object> call_data_obj(api_call_info->data(), isolate); |
| 266 | 271 |
| 267 // Put callee in place. | |
| 268 __ li(callee, function); | |
| 269 | |
| 270 bool call_data_undefined = false; | 272 bool call_data_undefined = false; |
| 271 // Put call_data in place. | 273 // Put call_data in place. |
| 272 if (isolate->heap()->InNewSpace(*call_data_obj)) { | 274 if (isolate->heap()->InNewSpace(*call_data_obj)) { |
| 273 __ li(call_data, api_call_info); | 275 __ li(call_data, api_call_info); |
| 274 __ ld(call_data, FieldMemOperand(call_data, CallHandlerInfo::kDataOffset)); | 276 __ ld(call_data, FieldMemOperand(call_data, CallHandlerInfo::kDataOffset)); |
| 275 } else if (call_data_obj->IsUndefined()) { | 277 } else if (call_data_obj->IsUndefined()) { |
| 276 call_data_undefined = true; | 278 call_data_undefined = true; |
| 277 __ LoadRoot(call_data, Heap::kUndefinedValueRootIndex); | 279 __ LoadRoot(call_data, Heap::kUndefinedValueRootIndex); |
| 278 } else { | 280 } else { |
| 279 __ li(call_data, call_data_obj); | 281 __ li(call_data, call_data_obj); |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 // Return the generated code. | 727 // Return the generated code. |
| 726 return GetCode(kind(), Code::NORMAL, name); | 728 return GetCode(kind(), Code::NORMAL, name); |
| 727 } | 729 } |
| 728 | 730 |
| 729 | 731 |
| 730 #undef __ | 732 #undef __ |
| 731 } | 733 } |
| 732 } // namespace v8::internal | 734 } // namespace v8::internal |
| 733 | 735 |
| 734 #endif // V8_TARGET_ARCH_MIPS64 | 736 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |