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

Side by Side Diff: src/compiler/bytecode-graph-builder.cc

Issue 2096653003: [ic] Don't pass receiver and name to LoadGlobalIC. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@store-name-in-metavector
Patch Set: Addressed Ross's comments Created 4 years, 6 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
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/compiler/bytecode-graph-builder.h" 5 #include "src/compiler/bytecode-graph-builder.h"
6 6
7 #include "src/compiler/bytecode-branch-analysis.h" 7 #include "src/compiler/bytecode-branch-analysis.h"
8 #include "src/compiler/linkage.h" 8 #include "src/compiler/linkage.h"
9 #include "src/compiler/operator-properties.h" 9 #include "src/compiler/operator-properties.h"
10 #include "src/interpreter/bytecodes.h" 10 #include "src/interpreter/bytecodes.h"
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0), value); 619 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0), value);
620 } 620 }
621 621
622 void BytecodeGraphBuilder::VisitMov() { 622 void BytecodeGraphBuilder::VisitMov() {
623 Node* value = 623 Node* value =
624 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); 624 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
625 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(1), value); 625 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(1), value);
626 } 626 }
627 627
628 Node* BytecodeGraphBuilder::BuildLoadGlobal(TypeofMode typeof_mode) { 628 Node* BytecodeGraphBuilder::BuildLoadGlobal(TypeofMode typeof_mode) {
629 Handle<Name> name =
630 Handle<Name>::cast(bytecode_iterator().GetConstantForIndexOperand(0));
631 VectorSlotPair feedback = 629 VectorSlotPair feedback =
632 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(1)); 630 CreateVectorSlotPair(bytecode_iterator().GetIndexOperand(0));
631 Handle<TypeFeedbackMetadata> metadata(
632 frame_state_function_info()->shared_info()->feedback_metadata());
633 DCHECK_EQ(FeedbackVectorSlotKind::LOAD_GLOBAL_IC,
634 metadata->GetKind(feedback.slot()));
635 Handle<Name> name(metadata->GetName(feedback.slot()));
633 const Operator* op = javascript()->LoadGlobal(name, feedback, typeof_mode); 636 const Operator* op = javascript()->LoadGlobal(name, feedback, typeof_mode);
634 return NewNode(op, GetFunctionClosure()); 637 return NewNode(op, GetFunctionClosure());
635 } 638 }
636 639
637 void BytecodeGraphBuilder::VisitLdaGlobal() { 640 void BytecodeGraphBuilder::VisitLdaGlobal() {
638 FrameStateBeforeAndAfter states(this); 641 FrameStateBeforeAndAfter states(this);
639 Node* node = BuildLoadGlobal(TypeofMode::NOT_INSIDE_TYPEOF); 642 Node* node = BuildLoadGlobal(TypeofMode::NOT_INSIDE_TYPEOF);
640 environment()->BindAccumulator(node, &states); 643 environment()->BindAccumulator(node, &states);
641 } 644 }
642 645
643 void BytecodeGraphBuilder::VisitLdrGlobal() { 646 void BytecodeGraphBuilder::VisitLdrGlobal() {
644 FrameStateBeforeAndAfter states(this); 647 FrameStateBeforeAndAfter states(this);
645 Node* node = BuildLoadGlobal(TypeofMode::NOT_INSIDE_TYPEOF); 648 Node* node = BuildLoadGlobal(TypeofMode::NOT_INSIDE_TYPEOF);
646 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(2), node, 649 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(1), node,
647 &states); 650 &states);
648 } 651 }
649 652
650 void BytecodeGraphBuilder::VisitLdaGlobalInsideTypeof() { 653 void BytecodeGraphBuilder::VisitLdaGlobalInsideTypeof() {
651 FrameStateBeforeAndAfter states(this); 654 FrameStateBeforeAndAfter states(this);
652 Node* node = BuildLoadGlobal(TypeofMode::INSIDE_TYPEOF); 655 Node* node = BuildLoadGlobal(TypeofMode::INSIDE_TYPEOF);
653 environment()->BindAccumulator(node, &states); 656 environment()->BindAccumulator(node, &states);
654 } 657 }
655 658
656 void BytecodeGraphBuilder::BuildStoreGlobal(LanguageMode language_mode) { 659 void BytecodeGraphBuilder::BuildStoreGlobal(LanguageMode language_mode) {
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after
1743 // Phi does not exist yet, introduce one. 1746 // Phi does not exist yet, introduce one.
1744 value = NewPhi(inputs, value, control); 1747 value = NewPhi(inputs, value, control);
1745 value->ReplaceInput(inputs - 1, other); 1748 value->ReplaceInput(inputs - 1, other);
1746 } 1749 }
1747 return value; 1750 return value;
1748 } 1751 }
1749 1752
1750 } // namespace compiler 1753 } // namespace compiler
1751 } // namespace internal 1754 } // namespace internal
1752 } // namespace v8 1755 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698