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

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

Issue 1643533003: Revert of Type Feedback Vector lives in the closure (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 | « src/compiler/ast-graph-builder.cc ('k') | src/compiler/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 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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 const Operator* op = 449 const Operator* op =
450 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true); 450 javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true);
451 Node* native_context = NewNode(op, environment()->Context()); 451 Node* native_context = NewNode(op, environment()->Context());
452 return NewNode(javascript()->LoadContext(0, index, true), native_context); 452 return NewNode(javascript()->LoadContext(0, index, true), native_context);
453 } 453 }
454 454
455 455
456 Node* BytecodeGraphBuilder::BuildLoadFeedbackVector() { 456 Node* BytecodeGraphBuilder::BuildLoadFeedbackVector() {
457 if (!feedback_vector_.is_set()) { 457 if (!feedback_vector_.is_set()) {
458 Node* closure = GetFunctionClosure(); 458 Node* closure = GetFunctionClosure();
459 Node* literals = 459 Node* shared = BuildLoadImmutableObjectField(
460 BuildLoadImmutableObjectField(closure, JSFunction::kLiteralsOffset); 460 closure, JSFunction::kSharedFunctionInfoOffset);
461 Node* vector = BuildLoadImmutableObjectField( 461 Node* vector = BuildLoadImmutableObjectField(
462 literals, LiteralsArray::kFeedbackVectorOffset); 462 shared, SharedFunctionInfo::kFeedbackVectorOffset);
463 feedback_vector_.set(vector); 463 feedback_vector_.set(vector);
464 } 464 }
465 return feedback_vector_.get(); 465 return feedback_vector_.get();
466 } 466 }
467 467
468 468
469 VectorSlotPair BytecodeGraphBuilder::CreateVectorSlotPair(int slot_id) { 469 VectorSlotPair BytecodeGraphBuilder::CreateVectorSlotPair(int slot_id) {
470 Handle<TypeFeedbackVector> feedback_vector = 470 Handle<TypeFeedbackVector> feedback_vector = info()->feedback_vector();
471 handle(info()->closure()->feedback_vector());
472 FeedbackVectorSlot slot; 471 FeedbackVectorSlot slot;
473 if (slot_id >= TypeFeedbackVector::kReservedIndexCount) { 472 if (slot_id >= TypeFeedbackVector::kReservedIndexCount) {
474 slot = feedback_vector->ToSlot(slot_id); 473 slot = feedback_vector->ToSlot(slot_id);
475 } 474 }
476 return VectorSlotPair(feedback_vector, slot); 475 return VectorSlotPair(feedback_vector, slot);
477 } 476 }
478 477
479 478
480 bool BytecodeGraphBuilder::CreateGraph(bool stack_check) { 479 bool BytecodeGraphBuilder::CreateGraph(bool stack_check) {
481 // Set up the basic structure of the graph. Outputs for {Start} are 480 // Set up the basic structure of the graph. Outputs for {Start} are
(...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after
2101 2100
2102 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { 2101 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) {
2103 if (environment()->IsMarkedAsUnreachable()) return; 2102 if (environment()->IsMarkedAsUnreachable()) return;
2104 environment()->MarkAsUnreachable(); 2103 environment()->MarkAsUnreachable();
2105 exit_controls_.push_back(exit); 2104 exit_controls_.push_back(exit);
2106 } 2105 }
2107 2106
2108 } // namespace compiler 2107 } // namespace compiler
2109 } // namespace internal 2108 } // namespace internal
2110 } // namespace v8 2109 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/compiler/interpreter-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698