OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "src/ast-numbering.h" | 9 #include "src/ast-numbering.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 prologue_offset_(Code::kPrologueOffsetNotSet), | 156 prologue_offset_(Code::kPrologueOffsetNotSet), |
157 no_frame_ranges_(isolate->cpu_profiler()->is_profiling() | 157 no_frame_ranges_(isolate->cpu_profiler()->is_profiling() |
158 ? new List<OffsetRange>(2) | 158 ? new List<OffsetRange>(2) |
159 : nullptr), | 159 : nullptr), |
160 track_positions_(FLAG_hydrogen_track_positions || | 160 track_positions_(FLAG_hydrogen_track_positions || |
161 isolate->cpu_profiler()->is_profiling()), | 161 isolate->cpu_profiler()->is_profiling()), |
162 opt_count_(has_shared_info() ? shared_info()->opt_count() : 0), | 162 opt_count_(has_shared_info() ? shared_info()->opt_count() : 0), |
163 parameter_count_(0), | 163 parameter_count_(0), |
164 optimization_id_(-1), | 164 optimization_id_(-1), |
165 osr_expr_stack_height_(0), | 165 osr_expr_stack_height_(0), |
166 function_type_(nullptr) {} | 166 function_type_(nullptr) { |
| 167 // Parameter count is number of stack parameters. |
| 168 if (code_stub_ != NULL) { |
| 169 CodeStubDescriptor descriptor(code_stub_); |
| 170 parameter_count_ = descriptor.GetStackParameterCount(); |
| 171 if (descriptor.function_mode() == NOT_JS_FUNCTION_STUB_MODE) { |
| 172 parameter_count_--; |
| 173 } |
| 174 } |
| 175 } |
167 | 176 |
168 | 177 |
169 CompilationInfo::~CompilationInfo() { | 178 CompilationInfo::~CompilationInfo() { |
170 DisableFutureOptimization(); | 179 DisableFutureOptimization(); |
171 delete deferred_handles_; | 180 delete deferred_handles_; |
172 delete no_frame_ranges_; | 181 delete no_frame_ranges_; |
173 #ifdef DEBUG | 182 #ifdef DEBUG |
174 // Check that no dependent maps have been added or added dependent maps have | 183 // Check that no dependent maps have been added or added dependent maps have |
175 // been rolled back or committed. | 184 // been rolled back or committed. |
176 DCHECK(dependencies()->IsEmpty()); | 185 DCHECK(dependencies()->IsEmpty()); |
(...skipping 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1707 | 1716 |
1708 | 1717 |
1709 #if DEBUG | 1718 #if DEBUG |
1710 void CompilationInfo::PrintAstForTesting() { | 1719 void CompilationInfo::PrintAstForTesting() { |
1711 PrintF("--- Source from AST ---\n%s\n", | 1720 PrintF("--- Source from AST ---\n%s\n", |
1712 PrettyPrinter(isolate(), zone()).PrintProgram(function())); | 1721 PrettyPrinter(isolate(), zone()).PrintProgram(function())); |
1713 } | 1722 } |
1714 #endif | 1723 #endif |
1715 } // namespace internal | 1724 } // namespace internal |
1716 } // namespace v8 | 1725 } // namespace v8 |
OLD | NEW |