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

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 1213043005: [turbofan] Use OSR value for innermost context value. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/compiler/linkage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index 0abc9918df6595454e83f095732f71049ddc4088..c04c378fcdde3e8275a7f952f892fbe52c9c8354 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -498,15 +498,6 @@ Node* AstGraphBuilder::NewOuterContextParam() {
}
-Node* AstGraphBuilder::NewCurrentContextOsrValue() {
- // TODO(titzer): use a real OSR value here; a parameter works by accident.
- // Parameter (arity + 1) is special for the outer context of the function
- const Operator* op = common()->Parameter(
- info()->num_parameters_including_this(), "%osr-context");
- return NewNode(op, graph()->start());
-}
-
-
bool AstGraphBuilder::CreateGraph(bool constant_context, bool stack_check) {
Scope* scope = info()->scope();
DCHECK(graph() != NULL);
@@ -4093,11 +4084,13 @@ void AstGraphBuilder::Environment::PrepareForLoop(BitVector* assigned,
Node* osr_context = nullptr;
const Operator* op =
builder_->javascript()->LoadContext(0, Context::PREVIOUS_INDEX, true);
+ const Operator* op_inner =
+ builder_->common()->OsrValue(Linkage::kOsrContextSpillSlotIndex);
int last = static_cast<int>(contexts()->size() - 1);
for (int i = last; i >= 0; i--) {
Node* val = contexts()->at(i);
if (!IrOpcode::IsConstantOpcode(val->opcode())) {
- osr_context = (i == last) ? builder_->NewCurrentContextOsrValue()
+ osr_context = (i == last) ? graph->NewNode(op_inner, osr_loop_entry)
: graph->NewNode(op, osr_context, osr_context,
osr_loop_entry);
contexts()->at(i) = builder_->MergeValue(val, osr_context, control);
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/compiler/linkage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698