| 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 6 | 6 |
| 7 #include "src/ic/handler-compiler.h" | 7 #include "src/ic/handler-compiler.h" |
| 8 | 8 |
| 9 #include "src/api-arguments.h" | 9 #include "src/api-arguments.h" |
| 10 #include "src/field-type.h" | 10 #include "src/field-type.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 __ Ld(holder, FieldMemOperand(holder, Map::kPrototypeOffset)); | 203 __ Ld(holder, FieldMemOperand(holder, Map::kPrototypeOffset)); |
| 204 } | 204 } |
| 205 break; | 205 break; |
| 206 case CallOptimization::kHolderNotFound: | 206 case CallOptimization::kHolderNotFound: |
| 207 UNREACHABLE(); | 207 UNREACHABLE(); |
| 208 break; | 208 break; |
| 209 } | 209 } |
| 210 | 210 |
| 211 Isolate* isolate = masm->isolate(); | 211 Isolate* isolate = masm->isolate(); |
| 212 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); | 212 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); |
| 213 bool call_data_undefined = false; | |
| 214 // Put call data in place. | 213 // Put call data in place. |
| 215 if (api_call_info->data()->IsUndefined(isolate)) { | 214 if (api_call_info->data()->IsUndefined(isolate)) { |
| 216 call_data_undefined = true; | |
| 217 __ LoadRoot(data, Heap::kUndefinedValueRootIndex); | 215 __ LoadRoot(data, Heap::kUndefinedValueRootIndex); |
| 218 } else { | 216 } else { |
| 219 if (optimization.is_constant_call()) { | 217 if (optimization.is_constant_call()) { |
| 220 __ Ld(data, | 218 __ Ld(data, |
| 221 FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); | 219 FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); |
| 222 __ Ld(data, | 220 __ Ld(data, |
| 223 FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); | 221 FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); |
| 224 __ Ld(data, FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); | 222 __ Ld(data, FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); |
| 225 } else { | 223 } else { |
| 226 __ Ld(data, | 224 __ Ld(data, |
| 227 FieldMemOperand(callee, FunctionTemplateInfo::kCallCodeOffset)); | 225 FieldMemOperand(callee, FunctionTemplateInfo::kCallCodeOffset)); |
| 228 } | 226 } |
| 229 __ Ld(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset)); | 227 __ Ld(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset)); |
| 230 } | 228 } |
| 231 | 229 |
| 232 // Put api_function_address in place. | 230 // Put api_function_address in place. |
| 233 Address function_address = v8::ToCData<Address>(api_call_info->callback()); | 231 Address function_address = v8::ToCData<Address>(api_call_info->callback()); |
| 234 ApiFunction fun(function_address); | 232 ApiFunction fun(function_address); |
| 235 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; | 233 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; |
| 236 ExternalReference ref = ExternalReference(&fun, type, masm->isolate()); | 234 ExternalReference ref = ExternalReference(&fun, type, masm->isolate()); |
| 237 __ li(api_function_address, Operand(ref)); | 235 __ li(api_function_address, Operand(ref)); |
| 238 | 236 |
| 239 // Jump to stub. | 237 // Jump to stub. |
| 240 CallApiCallbackStub stub(isolate, is_store, call_data_undefined, | 238 CallApiCallbackStub stub(isolate, is_store, !optimization.is_constant_call()); |
| 241 !optimization.is_constant_call()); | |
| 242 __ TailCallStub(&stub); | 239 __ TailCallStub(&stub); |
| 243 } | 240 } |
| 244 | 241 |
| 245 #undef __ | 242 #undef __ |
| 246 #define __ ACCESS_MASM(masm()) | 243 #define __ ACCESS_MASM(masm()) |
| 247 | 244 |
| 248 | 245 |
| 249 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, | 246 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, |
| 250 Handle<Name> name) { | 247 Handle<Name> name) { |
| 251 if (!label->is_unused()) { | 248 if (!label->is_unused()) { |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 Register NamedStoreHandlerCompiler::value() { | 408 Register NamedStoreHandlerCompiler::value() { |
| 412 return StoreDescriptor::ValueRegister(); | 409 return StoreDescriptor::ValueRegister(); |
| 413 } | 410 } |
| 414 | 411 |
| 415 | 412 |
| 416 #undef __ | 413 #undef __ |
| 417 } // namespace internal | 414 } // namespace internal |
| 418 } // namespace v8 | 415 } // namespace v8 |
| 419 | 416 |
| 420 #endif // V8_TARGET_ARCH_MIPS64 | 417 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |