| OLD | NEW |
| 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/ast/scopes.h" | 5 #include "src/ast/scopes.h" |
| 6 #include "src/compiler.h" | 6 #include "src/compiler.h" |
| 7 #include "src/compiler/all-nodes.h" | 7 #include "src/compiler/all-nodes.h" |
| 8 #include "src/compiler/common-operator.h" | 8 #include "src/compiler/common-operator.h" |
| 9 #include "src/compiler/common-operator-reducer.h" | 9 #include "src/compiler/common-operator-reducer.h" |
| 10 #include "src/compiler/dead-code-elimination.h" | 10 #include "src/compiler/dead-code-elimination.h" |
| 11 #include "src/compiler/frame.h" | 11 #include "src/compiler/frame.h" |
| 12 #include "src/compiler/graph.h" | 12 #include "src/compiler/graph.h" |
| 13 #include "src/compiler/graph-reducer.h" | 13 #include "src/compiler/graph-reducer.h" |
| 14 #include "src/compiler/graph-trimmer.h" | 14 #include "src/compiler/graph-trimmer.h" |
| 15 #include "src/compiler/graph-visualizer.h" | 15 #include "src/compiler/graph-visualizer.h" |
| 16 #include "src/compiler/js-graph.h" | 16 #include "src/compiler/js-graph.h" |
| 17 #include "src/compiler/loop-analysis.h" | 17 #include "src/compiler/loop-analysis.h" |
| 18 #include "src/compiler/node.h" | 18 #include "src/compiler/node.h" |
| 19 #include "src/compiler/node-marker.h" | 19 #include "src/compiler/node-marker.h" |
| 20 #include "src/compiler/osr.h" | 20 #include "src/compiler/osr.h" |
| 21 | 21 |
| 22 namespace v8 { | 22 namespace v8 { |
| 23 namespace internal { | 23 namespace internal { |
| 24 namespace compiler { | 24 namespace compiler { |
| 25 | 25 |
| 26 OsrHelper::OsrHelper(CompilationInfo* info) | 26 OsrHelper::OsrHelper(CompilationInfo* info) |
| 27 : parameter_count_(info->scope()->num_parameters()), | 27 : parameter_count_( |
| 28 stack_slot_count_(info->scope()->num_stack_slots() + | 28 info->is_optimizing_from_bytecode() |
| 29 info->osr_expr_stack_height()) {} | 29 ? info->shared_info()->bytecode_array()->parameter_count() |
| 30 | 30 : info->scope()->num_parameters()), |
| 31 stack_slot_count_( |
| 32 info->is_optimizing_from_bytecode() |
| 33 ? info->shared_info()->bytecode_array()->register_count() + |
| 34 InterpreterFrameConstants::kExtraSlotCount |
| 35 : info->scope()->num_stack_slots() + |
| 36 info->osr_expr_stack_height()) {} |
| 31 | 37 |
| 32 #ifdef DEBUG | 38 #ifdef DEBUG |
| 33 #define TRACE_COND (FLAG_trace_turbo_graph && FLAG_trace_osr) | 39 #define TRACE_COND (FLAG_trace_turbo_graph && FLAG_trace_osr) |
| 34 #else | 40 #else |
| 35 #define TRACE_COND false | 41 #define TRACE_COND false |
| 36 #endif | 42 #endif |
| 37 | 43 |
| 38 #define TRACE(...) \ | 44 #define TRACE(...) \ |
| 39 do { \ | 45 do { \ |
| 40 if (TRACE_COND) PrintF(__VA_ARGS__); \ | 46 if (TRACE_COND) PrintF(__VA_ARGS__); \ |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 | 334 |
| 329 void OsrHelper::SetupFrame(Frame* frame) { | 335 void OsrHelper::SetupFrame(Frame* frame) { |
| 330 // The optimized frame will subsume the unoptimized frame. Do so by reserving | 336 // The optimized frame will subsume the unoptimized frame. Do so by reserving |
| 331 // the first spill slots. | 337 // the first spill slots. |
| 332 frame->ReserveSpillSlots(UnoptimizedFrameSlots()); | 338 frame->ReserveSpillSlots(UnoptimizedFrameSlots()); |
| 333 } | 339 } |
| 334 | 340 |
| 335 } // namespace compiler | 341 } // namespace compiler |
| 336 } // namespace internal | 342 } // namespace internal |
| 337 } // namespace v8 | 343 } // namespace v8 |
| OLD | NEW |