| 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
| 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/arm64/assembler-arm64-inl.h" | 10 #include "src/arm64/assembler-arm64-inl.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 __ Ldr(holder, FieldMemOperand(holder, Map::kPrototypeOffset)); | 149 __ Ldr(holder, FieldMemOperand(holder, Map::kPrototypeOffset)); |
| 150 } | 150 } |
| 151 break; | 151 break; |
| 152 case CallOptimization::kHolderNotFound: | 152 case CallOptimization::kHolderNotFound: |
| 153 UNREACHABLE(); | 153 UNREACHABLE(); |
| 154 break; | 154 break; |
| 155 } | 155 } |
| 156 | 156 |
| 157 Isolate* isolate = masm->isolate(); | 157 Isolate* isolate = masm->isolate(); |
| 158 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); | 158 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); |
| 159 bool call_data_undefined = false; | |
| 160 // Put call data in place. | 159 // Put call data in place. |
| 161 if (api_call_info->data()->IsUndefined(isolate)) { | 160 if (api_call_info->data()->IsUndefined(isolate)) { |
| 162 call_data_undefined = true; | |
| 163 __ LoadRoot(data, Heap::kUndefinedValueRootIndex); | 161 __ LoadRoot(data, Heap::kUndefinedValueRootIndex); |
| 164 } else { | 162 } else { |
| 165 if (optimization.is_constant_call()) { | 163 if (optimization.is_constant_call()) { |
| 166 __ Ldr(data, | 164 __ Ldr(data, |
| 167 FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); | 165 FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); |
| 168 __ Ldr(data, | 166 __ Ldr(data, |
| 169 FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); | 167 FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); |
| 170 __ Ldr(data, | 168 __ Ldr(data, |
| 171 FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); | 169 FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); |
| 172 } else { | 170 } else { |
| 173 __ Ldr(data, | 171 __ Ldr(data, |
| 174 FieldMemOperand(callee, FunctionTemplateInfo::kCallCodeOffset)); | 172 FieldMemOperand(callee, FunctionTemplateInfo::kCallCodeOffset)); |
| 175 } | 173 } |
| 176 __ Ldr(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset)); | 174 __ Ldr(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset)); |
| 177 } | 175 } |
| 178 | 176 |
| 179 // Put api_function_address in place. | 177 // Put api_function_address in place. |
| 180 Address function_address = v8::ToCData<Address>(api_call_info->callback()); | 178 Address function_address = v8::ToCData<Address>(api_call_info->callback()); |
| 181 ApiFunction fun(function_address); | 179 ApiFunction fun(function_address); |
| 182 ExternalReference ref = ExternalReference( | 180 ExternalReference ref = ExternalReference( |
| 183 &fun, ExternalReference::DIRECT_API_CALL, masm->isolate()); | 181 &fun, ExternalReference::DIRECT_API_CALL, masm->isolate()); |
| 184 __ Mov(api_function_address, ref); | 182 __ Mov(api_function_address, ref); |
| 185 | 183 |
| 186 // Jump to stub. | 184 // Jump to stub. |
| 187 CallApiCallbackStub stub(isolate, is_store, call_data_undefined, | 185 CallApiCallbackStub stub(isolate, is_store, !optimization.is_constant_call()); |
| 188 !optimization.is_constant_call()); | |
| 189 __ TailCallStub(&stub); | 186 __ TailCallStub(&stub); |
| 190 } | 187 } |
| 191 | 188 |
| 192 | 189 |
| 193 void NamedStoreHandlerCompiler::GenerateStoreViaSetter( | 190 void NamedStoreHandlerCompiler::GenerateStoreViaSetter( |
| 194 MacroAssembler* masm, Handle<Map> map, Register receiver, Register holder, | 191 MacroAssembler* masm, Handle<Map> map, Register receiver, Register holder, |
| 195 int accessor_index, int expected_arguments, Register scratch) { | 192 int accessor_index, int expected_arguments, Register scratch) { |
| 196 // ----------- S t a t e ------------- | 193 // ----------- S t a t e ------------- |
| 197 // -- lr : return address | 194 // -- lr : return address |
| 198 // ----------------------------------- | 195 // ----------------------------------- |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 // Return the generated code. | 429 // Return the generated code. |
| 433 return GetCode(kind(), name); | 430 return GetCode(kind(), name); |
| 434 } | 431 } |
| 435 | 432 |
| 436 | 433 |
| 437 #undef __ | 434 #undef __ |
| 438 } // namespace internal | 435 } // namespace internal |
| 439 } // namespace v8 | 436 } // namespace v8 |
| 440 | 437 |
| 441 #endif // V8_TARGET_ARCH_IA32 | 438 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |