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/ic/x64/ic-x64.cc

Issue 685123007: Restore special interceptor stub for keyed loads. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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/ic-compiler.cc ('k') | src/x64/code-stubs-x64.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_X64 7 #if V8_TARGET_ARCH_X64
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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 GenerateDictionaryLoad(masm, &slow, rbx, key, rax, rdi, rax); 396 GenerateDictionaryLoad(masm, &slow, rbx, key, rax, rdi, rax);
397 __ IncrementCounter(counters->keyed_load_generic_symbol(), 1); 397 __ IncrementCounter(counters->keyed_load_generic_symbol(), 1);
398 __ ret(0); 398 __ ret(0);
399 399
400 __ bind(&index_name); 400 __ bind(&index_name);
401 __ IndexFromHash(rbx, key); 401 __ IndexFromHash(rbx, key);
402 __ jmp(&index_smi); 402 __ jmp(&index_smi);
403 } 403 }
404 404
405 405
406 void KeyedLoadIC::GenerateIndexedInterceptor(MacroAssembler* masm) {
407 // Return address is on the stack.
408 Label slow;
409
410 Register receiver = LoadDescriptor::ReceiverRegister();
411 Register key = LoadDescriptor::NameRegister();
412 Register scratch = rax;
413 DCHECK(!scratch.is(receiver) && !scratch.is(key));
414
415 // Check that the receiver isn't a smi.
416 __ JumpIfSmi(receiver, &slow);
417
418 // Check that the key is an array index, that is Uint32.
419 STATIC_ASSERT(kSmiValueSize <= 32);
420 __ JumpUnlessNonNegativeSmi(key, &slow);
421
422 // Get the map of the receiver.
423 __ movp(scratch, FieldOperand(receiver, HeapObject::kMapOffset));
424
425 // Check that it has indexed interceptor and access checks
426 // are not enabled for this object.
427 __ movb(scratch, FieldOperand(scratch, Map::kBitFieldOffset));
428 __ andb(scratch, Immediate(kSlowCaseBitFieldMask));
429 __ cmpb(scratch, Immediate(1 << Map::kHasIndexedInterceptor));
430 __ j(not_zero, &slow);
431
432 // Everything is fine, call runtime.
433 __ PopReturnAddressTo(scratch);
434 __ Push(receiver); // receiver
435 __ Push(key); // key
436 __ PushReturnAddressFrom(scratch);
437
438 // Perform tail call to the entry.
439 __ TailCallExternalReference(
440 ExternalReference(IC_Utility(IC::kLoadElementWithInterceptor),
441 masm->isolate()),
442 2, 1);
443
444 __ bind(&slow);
445 GenerateMiss(masm);
446 }
447
448
406 static void KeyedStoreGenerateMegamorphicHelper( 449 static void KeyedStoreGenerateMegamorphicHelper(
407 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, 450 MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow,
408 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length) { 451 KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length) {
409 Label transition_smi_elements; 452 Label transition_smi_elements;
410 Label finish_object_store, non_double_value, transition_double_elements; 453 Label finish_object_store, non_double_value, transition_double_elements;
411 Label fast_double_without_map_check; 454 Label fast_double_without_map_check;
412 Register receiver = StoreDescriptor::ReceiverRegister(); 455 Register receiver = StoreDescriptor::ReceiverRegister();
413 Register key = StoreDescriptor::NameRegister(); 456 Register key = StoreDescriptor::NameRegister();
414 Register value = StoreDescriptor::ValueRegister(); 457 Register value = StoreDescriptor::ValueRegister();
415 DCHECK(receiver.is(rdx)); 458 DCHECK(receiver.is(rdx));
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 Condition cc = 1013 Condition cc =
971 (check == ENABLE_INLINED_SMI_CHECK) 1014 (check == ENABLE_INLINED_SMI_CHECK)
972 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero) 1015 ? (*jmp_address == Assembler::kJncShortOpcode ? not_zero : zero)
973 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry); 1016 : (*jmp_address == Assembler::kJnzShortOpcode ? not_carry : carry);
974 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc); 1017 *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | cc);
975 } 1018 }
976 } 1019 }
977 } // namespace v8::internal 1020 } // namespace v8::internal
978 1021
979 #endif // V8_TARGET_ARCH_X64 1022 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ic/ic-compiler.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698