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

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

Issue 602773003: Eliminate special keyed load string stub in favor of uniform handlers. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE and ports. Created 6 years, 2 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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 __ IncrementCounter(counters->keyed_load_generic_symbol(), 1); 469 __ IncrementCounter(counters->keyed_load_generic_symbol(), 1);
470 __ ret(0); 470 __ ret(0);
471 471
472 __ bind(&index_name); 472 __ bind(&index_name);
473 __ IndexFromHash(ebx, key); 473 __ IndexFromHash(ebx, key);
474 // Now jump to the place where smi keys are handled. 474 // Now jump to the place where smi keys are handled.
475 __ jmp(&index_smi); 475 __ jmp(&index_smi);
476 } 476 }
477 477
478 478
479 void KeyedLoadIC::GenerateString(MacroAssembler* masm) {
480 // Return address is on the stack.
481 Label miss;
482
483 Register receiver = LoadDescriptor::ReceiverRegister();
484 Register index = LoadDescriptor::NameRegister();
485 Register scratch = ebx;
486 DCHECK(!scratch.is(receiver) && !scratch.is(index));
487 Register result = eax;
488 DCHECK(!result.is(scratch));
489
490 StringCharAtGenerator char_at_generator(receiver, index, scratch, result,
491 &miss, // When not a string.
492 &miss, // When not a number.
493 &miss, // When index out of range.
494 STRING_INDEX_IS_ARRAY_INDEX);
495 char_at_generator.GenerateFast(masm);
496 __ ret(0);
497
498 StubRuntimeCallHelper call_helper;
499 char_at_generator.GenerateSlow(masm, call_helper);
500
501 __ bind(&miss);
502 GenerateMiss(masm);
503 }
504
505
506 void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) { 479 void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) {
507 // Return address is on the stack. 480 // Return address is on the stack.
508 Label slow, notin; 481 Label slow, notin;
509 Register receiver = StoreDescriptor::ReceiverRegister(); 482 Register receiver = StoreDescriptor::ReceiverRegister();
510 Register name = StoreDescriptor::NameRegister(); 483 Register name = StoreDescriptor::NameRegister();
511 Register value = StoreDescriptor::ValueRegister(); 484 Register value = StoreDescriptor::ValueRegister();
512 DCHECK(receiver.is(edx)); 485 DCHECK(receiver.is(edx));
513 DCHECK(name.is(ecx)); 486 DCHECK(name.is(ecx));
514 DCHECK(value.is(eax)); 487 DCHECK(value.is(eax));
515 488
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 Condition cc = 948 Condition cc =
976 (check == ENABLE_INLINED_SMI_CHECK) 949 (check == ENABLE_INLINED_SMI_CHECK)
977 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) 950 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero)
978 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); 951 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry);
979 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 952 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
980 } 953 }
981 } 954 }
982 } // namespace v8::internal 955 } // namespace v8::internal
983 956
984 #endif // V8_TARGET_ARCH_IA32 957 #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