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

Side by Side Diff: src/compiler/osr.cc

Issue 890903002: [turbofan] Fix OSR into functions where the expression stack is not empty. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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/mips64/code-generator-mips64.cc ('k') | src/compiler/x64/code-generator-x64.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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.h" 5 #include "src/compiler.h"
6 #include "src/compiler/common-operator.h" 6 #include "src/compiler/common-operator.h"
7 #include "src/compiler/control-reducer.h" 7 #include "src/compiler/control-reducer.h"
8 #include "src/compiler/frame.h" 8 #include "src/compiler/frame.h"
9 #include "src/compiler/graph.h" 9 #include "src/compiler/graph.h"
10 #include "src/compiler/js-graph.h" 10 #include "src/compiler/js-graph.h"
11 #include "src/compiler/loop-analysis.h" 11 #include "src/compiler/loop-analysis.h"
12 #include "src/compiler/node.h" 12 #include "src/compiler/node.h"
13 #include "src/compiler/node-marker.h" 13 #include "src/compiler/node-marker.h"
14 #include "src/compiler/osr.h" 14 #include "src/compiler/osr.h"
15 #include "src/scopes.h" 15 #include "src/scopes.h"
16 16
17 namespace v8 { 17 namespace v8 {
18 namespace internal { 18 namespace internal {
19 namespace compiler { 19 namespace compiler {
20 20
21 OsrHelper::OsrHelper(CompilationInfo* info) 21 OsrHelper::OsrHelper(CompilationInfo* info)
22 : parameter_count_(info->scope()->num_parameters()), 22 : parameter_count_(info->scope()->num_parameters()),
23 stack_slot_count_(info->scope()->num_stack_slots()) {} 23 stack_slot_count_(info->scope()->num_stack_slots() +
24 info->osr_expr_stack_height()) {}
24 25
25 26
26 bool OsrHelper::Deconstruct(JSGraph* jsgraph, CommonOperatorBuilder* common, 27 bool OsrHelper::Deconstruct(JSGraph* jsgraph, CommonOperatorBuilder* common,
27 Zone* tmp_zone) { 28 Zone* tmp_zone) {
28 Graph* graph = jsgraph->graph(); 29 Graph* graph = jsgraph->graph();
29 Node* osr_normal_entry = nullptr; 30 Node* osr_normal_entry = nullptr;
30 Node* osr_loop_entry = nullptr; 31 Node* osr_loop_entry = nullptr;
31 Node* osr_loop = nullptr; 32 Node* osr_loop = nullptr;
32 33
33 for (Node* node : graph->start()->uses()) { 34 for (Node* node : graph->start()->uses()) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 ControlReducer::ReduceGraph(tmp_zone, jsgraph, common); 69 ControlReducer::ReduceGraph(tmp_zone, jsgraph, common);
69 70
70 return true; 71 return true;
71 } 72 }
72 73
73 74
74 void OsrHelper::SetupFrame(Frame* frame) { 75 void OsrHelper::SetupFrame(Frame* frame) {
75 // The optimized frame will subsume the unoptimized frame. Do so by reserving 76 // The optimized frame will subsume the unoptimized frame. Do so by reserving
76 // the first spill slots. 77 // the first spill slots.
77 frame->ReserveSpillSlots(UnoptimizedFrameSlots()); 78 frame->ReserveSpillSlots(UnoptimizedFrameSlots());
79 // The frame needs to be adjusted by the number of unoptimized frame slots.
80 frame->SetOsrStackSlotCount(static_cast<int>(UnoptimizedFrameSlots()));
78 } 81 }
79 82
80 83
81 } // namespace compiler 84 } // namespace compiler
82 } // namespace internal 85 } // namespace internal
83 } // namespace v8 86 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips64/code-generator-mips64.cc ('k') | src/compiler/x64/code-generator-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698