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

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

Issue 643783005: X87: Eliminate special keyed load string stub in favor of uniform handlers (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@bleeding_edge
Patch Set: 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
« no previous file with comments | « no previous file | src/x87/code-stubs-x87.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 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_X87 7 #if V8_TARGET_ARCH_X87
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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 __ IncrementCounter(counters->keyed_load_generic_symbol(), 1); 471 __ IncrementCounter(counters->keyed_load_generic_symbol(), 1);
472 __ ret(0); 472 __ ret(0);
473 473
474 __ bind(&index_name); 474 __ bind(&index_name);
475 __ IndexFromHash(ebx, key); 475 __ IndexFromHash(ebx, key);
476 // Now jump to the place where smi keys are handled. 476 // Now jump to the place where smi keys are handled.
477 __ jmp(&index_smi); 477 __ jmp(&index_smi);
478 } 478 }
479 479
480 480
481 void KeyedLoadIC::GenerateString(MacroAssembler* masm) {
482 // Return address is on the stack.
483 Label miss;
484
485 Register receiver = LoadDescriptor::ReceiverRegister();
486 Register index = LoadDescriptor::NameRegister();
487 Register scratch = ebx;
488 DCHECK(!scratch.is(receiver) && !scratch.is(index));
489 Register result = eax;
490 DCHECK(!result.is(scratch));
491
492 StringCharAtGenerator char_at_generator(receiver, index, scratch, result,
493 &miss, // When not a string.
494 &miss, // When not a number.
495 &miss, // When index out of range.
496 STRING_INDEX_IS_ARRAY_INDEX);
497 char_at_generator.GenerateFast(masm);
498 __ ret(0);
499
500 StubRuntimeCallHelper call_helper;
501 char_at_generator.GenerateSlow(masm, call_helper);
502
503 __ bind(&miss);
504 GenerateMiss(masm);
505 }
506
507
508 void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) { 481 void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) {
509 // Return address is on the stack. 482 // Return address is on the stack.
510 Label slow, notin; 483 Label slow, notin;
511 Register receiver = StoreDescriptor::ReceiverRegister(); 484 Register receiver = StoreDescriptor::ReceiverRegister();
512 Register name = StoreDescriptor::NameRegister(); 485 Register name = StoreDescriptor::NameRegister();
513 Register value = StoreDescriptor::ValueRegister(); 486 Register value = StoreDescriptor::ValueRegister();
514 DCHECK(receiver.is(edx)); 487 DCHECK(receiver.is(edx));
515 DCHECK(name.is(ecx)); 488 DCHECK(name.is(ecx));
516 DCHECK(value.is(eax)); 489 DCHECK(value.is(eax));
517 490
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 Condition cc = 973 Condition cc =
1001 (check == ENABLE_INLINED_SMI_CHECK) 974 (check == ENABLE_INLINED_SMI_CHECK)
1002 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) 975 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero)
1003 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); 976 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry);
1004 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 977 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
1005 } 978 }
1006 } 979 }
1007 } // namespace v8::internal 980 } // namespace v8::internal
1008 981
1009 #endif // V8_TARGET_ARCH_X87 982 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « no previous file | src/x87/code-stubs-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698