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

Side by Side Diff: src/ic/accessor-assembler.cc

Issue 2541843006: [stubs] Add LoadFixedArrayElements with int index (Closed)
Patch Set: Address comments Created 4 years 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/code-stubs.cc ('k') | src/interpreter/interpreter-assembler.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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/ic/accessor-assembler.h" 5 #include "src/ic/accessor-assembler.h"
6 #include "src/ic/accessor-assembler-impl.h" 6 #include "src/ic/accessor-assembler-impl.h"
7 7
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/ic/handler-configuration.h" 10 #include "src/ic/handler-configuration.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 Node* receiver_map, Node* feedback, Label* if_handler, 55 Node* receiver_map, Node* feedback, Label* if_handler,
56 Variable* var_handler, Label* if_miss, int unroll_count) { 56 Variable* var_handler, Label* if_miss, int unroll_count) {
57 Comment("HandlePolymorphicCase"); 57 Comment("HandlePolymorphicCase");
58 DCHECK_EQ(MachineRepresentation::kTagged, var_handler->rep()); 58 DCHECK_EQ(MachineRepresentation::kTagged, var_handler->rep());
59 59
60 // Iterate {feedback} array. 60 // Iterate {feedback} array.
61 const int kEntrySize = 2; 61 const int kEntrySize = 2;
62 62
63 for (int i = 0; i < unroll_count; i++) { 63 for (int i = 0; i < unroll_count; i++) {
64 Label next_entry(this); 64 Label next_entry(this);
65 Node* cached_map = LoadWeakCellValue(LoadFixedArrayElement( 65 Node* cached_map =
66 feedback, IntPtrConstant(i * kEntrySize), 0, INTPTR_PARAMETERS)); 66 LoadWeakCellValue(LoadFixedArrayElement(feedback, i * kEntrySize));
67 GotoIf(WordNotEqual(receiver_map, cached_map), &next_entry); 67 GotoIf(WordNotEqual(receiver_map, cached_map), &next_entry);
68 68
69 // Found, now call handler. 69 // Found, now call handler.
70 Node* handler = LoadFixedArrayElement( 70 Node* handler = LoadFixedArrayElement(feedback, i * kEntrySize + 1);
71 feedback, IntPtrConstant(i * kEntrySize + 1), 0, INTPTR_PARAMETERS);
72 var_handler->Bind(handler); 71 var_handler->Bind(handler);
73 Goto(if_handler); 72 Goto(if_handler);
74 73
75 Bind(&next_entry); 74 Bind(&next_entry);
76 } 75 }
77 76
78 // Loop from {unroll_count}*kEntrySize to {length}. 77 // Loop from {unroll_count}*kEntrySize to {length}.
79 Node* init = IntPtrConstant(unroll_count * kEntrySize); 78 Node* init = IntPtrConstant(unroll_count * kEntrySize);
80 Node* length = LoadAndUntagFixedArrayBaseLength(feedback); 79 Node* length = LoadAndUntagFixedArrayBaseLength(feedback);
81 BuildFastLoop( 80 BuildFastLoop(
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 424
426 BuildFastLoop( 425 BuildFastLoop(
427 MachineType::PointerRepresentation(), start_index.value(), handler_length, 426 MachineType::PointerRepresentation(), start_index.value(), handler_length,
428 [this, p, handler, miss](CodeStubAssembler*, Node* current) { 427 [this, p, handler, miss](CodeStubAssembler*, Node* current) {
429 Node* prototype_cell = 428 Node* prototype_cell =
430 LoadFixedArrayElement(handler, current, 0, INTPTR_PARAMETERS); 429 LoadFixedArrayElement(handler, current, 0, INTPTR_PARAMETERS);
431 CheckPrototype(prototype_cell, p->name, miss); 430 CheckPrototype(prototype_cell, p->name, miss);
432 }, 431 },
433 1, IndexAdvanceMode::kPost); 432 1, IndexAdvanceMode::kPost);
434 433
435 Node* maybe_holder_cell = LoadFixedArrayElement( 434 Node* maybe_holder_cell =
436 handler, IntPtrConstant(LoadHandler::kHolderCellIndex), 0, 435 LoadFixedArrayElement(handler, LoadHandler::kHolderCellIndex);
437 INTPTR_PARAMETERS);
438 Label load_existent(this); 436 Label load_existent(this);
439 GotoIf(WordNotEqual(maybe_holder_cell, NullConstant()), &load_existent); 437 GotoIf(WordNotEqual(maybe_holder_cell, NullConstant()), &load_existent);
440 // This is a handler for a load of a non-existent value. 438 // This is a handler for a load of a non-existent value.
441 if (throw_reference_error_if_nonexistent) { 439 if (throw_reference_error_if_nonexistent) {
442 TailCallRuntime(Runtime::kThrowReferenceError, p->context, p->name); 440 TailCallRuntime(Runtime::kThrowReferenceError, p->context, p->name);
443 } else { 441 } else {
444 Return(UndefinedConstant()); 442 Return(UndefinedConstant());
445 } 443 }
446 444
447 Bind(&load_existent); 445 Bind(&load_existent);
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 Node* length = SmiUntag(maybe_transition_cell); 549 Node* length = SmiUntag(maybe_transition_cell);
552 BuildFastLoop(MachineType::PointerRepresentation(), 550 BuildFastLoop(MachineType::PointerRepresentation(),
553 IntPtrConstant(StoreHandler::kFirstPrototypeIndex), length, 551 IntPtrConstant(StoreHandler::kFirstPrototypeIndex), length,
554 [this, p, handler, miss](CodeStubAssembler*, Node* current) { 552 [this, p, handler, miss](CodeStubAssembler*, Node* current) {
555 Node* prototype_cell = LoadFixedArrayElement( 553 Node* prototype_cell = LoadFixedArrayElement(
556 handler, current, 0, INTPTR_PARAMETERS); 554 handler, current, 0, INTPTR_PARAMETERS);
557 CheckPrototype(prototype_cell, p->name, miss); 555 CheckPrototype(prototype_cell, p->name, miss);
558 }, 556 },
559 1, IndexAdvanceMode::kPost); 557 1, IndexAdvanceMode::kPost);
560 558
561 Node* maybe_transition_cell = LoadFixedArrayElement( 559 Node* maybe_transition_cell =
562 handler, IntPtrConstant(StoreHandler::kTransitionCellIndex), 0, 560 LoadFixedArrayElement(handler, StoreHandler::kTransitionCellIndex);
563 INTPTR_PARAMETERS);
564 Node* transition = LoadWeakCellValue(maybe_transition_cell, miss); 561 Node* transition = LoadWeakCellValue(maybe_transition_cell, miss);
565 var_transition.Bind(transition); 562 var_transition.Bind(transition);
566 Goto(&if_transition); 563 Goto(&if_transition);
567 } 564 }
568 565
569 Bind(&if_transition); 566 Bind(&if_transition);
570 { 567 {
571 Node* holder = p->receiver; 568 Node* holder = p->receiver;
572 Node* transition = var_transition.value(); 569 Node* transition = var_transition.value();
573 Node* handler_word = SmiUntag(smi_handler); 570 Node* handler_word = SmiUntag(smi_handler);
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1767 void AccessorAssembler::GenerateKeyedStoreICTrampolineTF( 1764 void AccessorAssembler::GenerateKeyedStoreICTrampolineTF(
1768 CodeAssemblerState* state, LanguageMode language_mode) { 1765 CodeAssemblerState* state, LanguageMode language_mode) {
1769 AccessorAssemblerImpl assembler(state); 1766 AccessorAssemblerImpl assembler(state);
1770 assembler.GenerateKeyedStoreICTrampolineTF(language_mode); 1767 assembler.GenerateKeyedStoreICTrampolineTF(language_mode);
1771 } 1768 }
1772 1769
1773 #undef ACCESSOR_ASSEMBLER_PUBLIC_INTERFACE 1770 #undef ACCESSOR_ASSEMBLER_PUBLIC_INTERFACE
1774 1771
1775 } // namespace internal 1772 } // namespace internal
1776 } // namespace v8 1773 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs.cc ('k') | src/interpreter/interpreter-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698