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

Side by Side Diff: src/ic/ia32/ic-ia32.cc

Issue 575373004: Convert KeyedLoad indexed interceptor case to a Handler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE and ports. Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/ic/handler-compiler.cc ('k') | src/ic/ic.h » ('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 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/ic/ic.h" 10 #include "src/ic/ic.h"
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 __ ret(0); 496 __ ret(0);
497 497
498 StubRuntimeCallHelper call_helper; 498 StubRuntimeCallHelper call_helper;
499 char_at_generator.GenerateSlow(masm, call_helper); 499 char_at_generator.GenerateSlow(masm, call_helper);
500 500
501 __ bind(&miss); 501 __ bind(&miss);
502 GenerateMiss(masm); 502 GenerateMiss(masm);
503 } 503 }
504 504
505 505
506 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
507 // Return address is on the stack.
508 Label slow;
509
510 Register receiver = LoadDescriptor::ReceiverRegister();
511 Register key = LoadDescriptor::NameRegister();
512 Register scratch = eax;
513 DCHECK(!scratch.is(receiver) && !scratch.is(key));
514
515 // Check that the receiver isn't a smi.
516 __ JumpIfSmi(receiver, &slow);
517
518 // Check that the key is an array index, that is Uint32.
519 __ test(key, Immediate(kSmiTagMask | kSmiSignMask));
520 __ j(not_zero, &slow);
521
522 // Get the map of the receiver.
523 __ mov(scratch, FieldOperand(receiver, HeapObject::kMapOffset));
524
525 // Check that it has indexed interceptor and access checks
526 // are not enabled for this object.
527 __ movzx_b(scratch, FieldOperand(scratch, Map::kBitFieldOffset));
528 __ and_(scratch, Immediate(kSlowCaseBitFieldMask));
529 __ cmp(scratch, Immediate(1 << Map::kHasIndexedInterceptor));
530 __ j(not_zero, &slow);
531
532 // Everything is fine, call runtime.
533 __ pop(scratch);
534 __ push(receiver); // receiver
535 __ push(key); // key
536 __ push(scratch); // return address
537
538 // Perform tail call to the entry.
539 ExternalReference ref = ExternalReference(
540 IC_Utility(kLoadElementWithInterceptor), masm->isolate());
541 __ TailCallExternalReference(ref, 2, 1);
542
543 __ bind(&slow);
544 GenerateMiss(masm);
545 }
546
547
548 void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { 506 void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) {
549 // The return address is on the stack. 507 // The return address is on the stack.
550 Register receiver = LoadDescriptor::ReceiverRegister(); 508 Register receiver = LoadDescriptor::ReceiverRegister();
551 Register key = LoadDescriptor::NameRegister(); 509 Register key = LoadDescriptor::NameRegister();
552 DCHECK(receiver.is(edx)); 510 DCHECK(receiver.is(edx));
553 DCHECK(key.is(ecx)); 511 DCHECK(key.is(ecx));
554 512
555 Label slow, notin; 513 Label slow, notin;
556 Factory* factory = masm->isolate()->factory(); 514 Factory* factory = masm->isolate()->factory();
557 Operand mapped_location = GenerateMappedArgumentsLookup( 515 Operand mapped_location = GenerateMappedArgumentsLookup(
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
1043 Condition cc = 1001 Condition cc =
1044 (check == ENABLE_INLINED_SMI_CHECK) 1002 (check == ENABLE_INLINED_SMI_CHECK)
1045 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) 1003 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero)
1046 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); 1004 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry);
1047 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1005 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1048 } 1006 }
1049 } 1007 }
1050 } // namespace v8::internal 1008 } // namespace v8::internal
1051 1009
1052 #endif // V8_TARGET_ARCH_IA32 1010 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ic/handler-compiler.cc ('k') | src/ic/ic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698