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

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

Issue 1642613002: Reland of Type Feedback Vector lives in the closure (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: %SetCode failed to install literals in cache. 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* shared = BuildLoadImmutableObjectField( 459 Node* literals =
460 closure, JSFunction::kSharedFunctionInfoOffset); 460 BuildLoadImmutableObjectField(closure, JSFunction::kLiteralsOffset);
461 Node* vector = BuildLoadImmutableObjectField( 461 Node* vector = BuildLoadImmutableObjectField(
462 shared, SharedFunctionInfo::kFeedbackVectorOffset); 462 literals, LiteralsArray::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 = info()->feedback_vector(); 470 Handle<TypeFeedbackVector> feedback_vector =
471 handle(info()->closure()->feedback_vector());
471 FeedbackVectorSlot slot; 472 FeedbackVectorSlot slot;
472 if (slot_id >= TypeFeedbackVector::kReservedIndexCount) { 473 if (slot_id >= TypeFeedbackVector::kReservedIndexCount) {
473 slot = feedback_vector->ToSlot(slot_id); 474 slot = feedback_vector->ToSlot(slot_id);
474 } 475 }
475 return VectorSlotPair(feedback_vector, slot); 476 return VectorSlotPair(feedback_vector, slot);
476 } 477 }
477 478
478 479
479 bool BytecodeGraphBuilder::CreateGraph(bool stack_check) { 480 bool BytecodeGraphBuilder::CreateGraph(bool stack_check) {
480 // Set up the basic structure of the graph. Outputs for {Start} are 481 // Set up the basic structure of the graph. Outputs for {Start} are
(...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after
2100 2101
2101 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { 2102 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) {
2102 if (environment()->IsMarkedAsUnreachable()) return; 2103 if (environment()->IsMarkedAsUnreachable()) return;
2103 environment()->MarkAsUnreachable(); 2104 environment()->MarkAsUnreachable();
2104 exit_controls_.push_back(exit); 2105 exit_controls_.push_back(exit);
2105 } 2106 }
2106 2107
2107 } // namespace compiler 2108 } // namespace compiler
2108 } // namespace internal 2109 } // namespace internal
2109 } // namespace v8 2110 } // 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