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

Side by Side Diff: src/x87/code-stubs-x87.cc

Issue 1820843002: Turn LoadIndexedInterceptor into a Turbofan stub (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase again Created 4 years, 9 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/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_X87 5 #if V8_TARGET_ARCH_X87
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/api-arguments.h" 8 #include "src/api-arguments.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 __ j(equal, &miss); 360 __ j(equal, &miss);
361 __ TryGetFunctionPrototype(receiver, eax, ebx, &miss); 361 __ TryGetFunctionPrototype(receiver, eax, ebx, &miss);
362 __ ret(0); 362 __ ret(0);
363 363
364 __ bind(&miss); 364 __ bind(&miss);
365 PropertyAccessCompiler::TailCallBuiltin( 365 PropertyAccessCompiler::TailCallBuiltin(
366 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC)); 366 masm, PropertyAccessCompiler::MissBuiltin(Code::LOAD_IC));
367 } 367 }
368 368
369 369
370 void LoadIndexedInterceptorStub::Generate(MacroAssembler* masm) {
371 // Return address is on the stack.
372 Label slow;
373
374 Register receiver = LoadDescriptor::ReceiverRegister();
375 Register key = LoadDescriptor::NameRegister();
376 Register scratch = eax;
377 DCHECK(!scratch.is(receiver) && !scratch.is(key));
378
379 // Check that the key is an array index, that is Uint32.
380 __ test(key, Immediate(kSmiTagMask | kSmiSignMask));
381 __ j(not_zero, &slow);
382
383 // Everything is fine, call runtime.
384 __ pop(scratch);
385 __ push(receiver); // receiver
386 __ push(key); // key
387 __ push(scratch); // return address
388
389 // Perform tail call to the entry.
390 __ TailCallRuntime(Runtime::kLoadElementWithInterceptor);
391
392 __ bind(&slow);
393 PropertyAccessCompiler::TailCallBuiltin(
394 masm, PropertyAccessCompiler::MissBuiltin(Code::KEYED_LOAD_IC));
395 }
396
397
398 void LoadIndexedStringStub::Generate(MacroAssembler* masm) { 370 void LoadIndexedStringStub::Generate(MacroAssembler* masm) {
399 // Return address is on the stack. 371 // Return address is on the stack.
400 Label miss; 372 Label miss;
401 373
402 Register receiver = LoadDescriptor::ReceiverRegister(); 374 Register receiver = LoadDescriptor::ReceiverRegister();
403 Register index = LoadDescriptor::NameRegister(); 375 Register index = LoadDescriptor::NameRegister();
404 Register scratch = edi; 376 Register scratch = edi;
405 DCHECK(!scratch.is(receiver) && !scratch.is(index)); 377 DCHECK(!scratch.is(receiver) && !scratch.is(index));
406 Register result = eax; 378 Register result = eax;
407 DCHECK(!result.is(scratch)); 379 DCHECK(!result.is(scratch));
(...skipping 5124 matching lines...) Expand 10 before | Expand all | Expand 10 after
5532 return_value_operand, NULL); 5504 return_value_operand, NULL);
5533 } 5505 }
5534 5506
5535 5507
5536 #undef __ 5508 #undef __
5537 5509
5538 } // namespace internal 5510 } // namespace internal
5539 } // namespace v8 5511 } // namespace v8
5540 5512
5541 #endif // V8_TARGET_ARCH_X87 5513 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698