Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Side by Side Diff: src/ic/arm/handler-compiler-arm.cc

Issue 2838143003: [stubs] Drop CallApiCallbackStub::call_data_undefined optimization. (Closed)
Patch Set: Fix handler-compiler for remaining archs. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ic/arm64/handler-compiler-arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_ARM 5 #if V8_TARGET_ARCH_ARM
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/assembler-inl.h" 10 #include "src/assembler-inl.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 __ ldr(holder, FieldMemOperand(holder, Map::kPrototypeOffset)); 214 __ ldr(holder, FieldMemOperand(holder, Map::kPrototypeOffset));
215 } 215 }
216 break; 216 break;
217 case CallOptimization::kHolderNotFound: 217 case CallOptimization::kHolderNotFound:
218 UNREACHABLE(); 218 UNREACHABLE();
219 break; 219 break;
220 } 220 }
221 221
222 Isolate* isolate = masm->isolate(); 222 Isolate* isolate = masm->isolate();
223 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); 223 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
224 bool call_data_undefined = false;
225 // Put call data in place. 224 // Put call data in place.
226 if (api_call_info->data()->IsUndefined(isolate)) { 225 if (api_call_info->data()->IsUndefined(isolate)) {
227 call_data_undefined = true;
228 __ LoadRoot(data, Heap::kUndefinedValueRootIndex); 226 __ LoadRoot(data, Heap::kUndefinedValueRootIndex);
229 } else { 227 } else {
230 if (optimization.is_constant_call()) { 228 if (optimization.is_constant_call()) {
231 __ ldr(data, 229 __ ldr(data,
232 FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset)); 230 FieldMemOperand(callee, JSFunction::kSharedFunctionInfoOffset));
233 __ ldr(data, 231 __ ldr(data,
234 FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset)); 232 FieldMemOperand(data, SharedFunctionInfo::kFunctionDataOffset));
235 __ ldr(data, 233 __ ldr(data,
236 FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset)); 234 FieldMemOperand(data, FunctionTemplateInfo::kCallCodeOffset));
237 } else { 235 } else {
238 __ ldr(data, 236 __ ldr(data,
239 FieldMemOperand(callee, FunctionTemplateInfo::kCallCodeOffset)); 237 FieldMemOperand(callee, FunctionTemplateInfo::kCallCodeOffset));
240 } 238 }
241 __ ldr(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset)); 239 __ ldr(data, FieldMemOperand(data, CallHandlerInfo::kDataOffset));
242 } 240 }
243 241
244 // Put api_function_address in place. 242 // Put api_function_address in place.
245 Address function_address = v8::ToCData<Address>(api_call_info->callback()); 243 Address function_address = v8::ToCData<Address>(api_call_info->callback());
246 ApiFunction fun(function_address); 244 ApiFunction fun(function_address);
247 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; 245 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL;
248 ExternalReference ref = ExternalReference(&fun, type, masm->isolate()); 246 ExternalReference ref = ExternalReference(&fun, type, masm->isolate());
249 __ mov(api_function_address, Operand(ref)); 247 __ mov(api_function_address, Operand(ref));
250 248
251 // Jump to stub. 249 // Jump to stub.
252 CallApiCallbackStub stub(isolate, is_store, call_data_undefined, 250 CallApiCallbackStub stub(isolate, is_store, !optimization.is_constant_call());
253 !optimization.is_constant_call());
254 __ TailCallStub(&stub); 251 __ TailCallStub(&stub);
255 } 252 }
256 253
257 #undef __ 254 #undef __
258 #define __ ACCESS_MASM(masm()) 255 #define __ ACCESS_MASM(masm())
259 256
260 257
261 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, 258 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label,
262 Handle<Name> name) { 259 Handle<Name> name) {
263 if (!label->is_unused()) { 260 if (!label->is_unused()) {
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 Register NamedStoreHandlerCompiler::value() { 426 Register NamedStoreHandlerCompiler::value() {
430 return StoreDescriptor::ValueRegister(); 427 return StoreDescriptor::ValueRegister();
431 } 428 }
432 429
433 430
434 #undef __ 431 #undef __
435 } // namespace internal 432 } // namespace internal
436 } // namespace v8 433 } // namespace v8
437 434
438 #endif // V8_TARGET_ARCH_ARM 435 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ic/arm64/handler-compiler-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698