OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/compilation-info.h" | 5 #include "src/compilation-info.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
11 #include "src/parsing/parse-info.h" | 11 #include "src/parsing/parse-info.h" |
| 12 #include "src/source-position.h" |
12 | 13 |
13 namespace v8 { | 14 namespace v8 { |
14 namespace internal { | 15 namespace internal { |
15 | 16 |
16 #define PARSE_INFO_GETTER(type, name) \ | 17 #define PARSE_INFO_GETTER(type, name) \ |
17 type CompilationInfo::name() const { \ | 18 type CompilationInfo::name() const { \ |
18 CHECK(parse_info()); \ | 19 CHECK(parse_info()); \ |
19 return parse_info()->name(); \ | 20 return parse_info()->name(); \ |
20 } | 21 } |
21 | 22 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 return has_global_object() ? native_context()->global_object() : nullptr; | 212 return has_global_object() ? native_context()->global_object() : nullptr; |
212 } | 213 } |
213 | 214 |
214 void CompilationInfo::SetOptimizing() { | 215 void CompilationInfo::SetOptimizing() { |
215 DCHECK(has_shared_info()); | 216 DCHECK(has_shared_info()); |
216 SetMode(OPTIMIZE); | 217 SetMode(OPTIMIZE); |
217 optimization_id_ = isolate()->NextOptimizationId(); | 218 optimization_id_ = isolate()->NextOptimizationId(); |
218 code_flags_ = Code::KindField::update(code_flags_, Code::OPTIMIZED_FUNCTION); | 219 code_flags_ = Code::KindField::update(code_flags_, Code::OPTIMIZED_FUNCTION); |
219 } | 220 } |
220 | 221 |
221 void CompilationInfo::AddInlinedFunction( | 222 int CompilationInfo::AddInlinedFunction( |
222 Handle<SharedFunctionInfo> inlined_function) { | 223 Handle<SharedFunctionInfo> inlined_function, SourcePosition pos) { |
| 224 int id = static_cast<int>(inlined_functions_.size()); |
223 inlined_functions_.push_back(InlinedFunctionHolder( | 225 inlined_functions_.push_back(InlinedFunctionHolder( |
224 inlined_function, handle(inlined_function->code()))); | 226 inlined_function, handle(inlined_function->code()), pos)); |
| 227 return id; |
225 } | 228 } |
226 | 229 |
227 Code::Kind CompilationInfo::output_code_kind() const { | 230 Code::Kind CompilationInfo::output_code_kind() const { |
228 return Code::ExtractKindFromFlags(code_flags_); | 231 return Code::ExtractKindFromFlags(code_flags_); |
229 } | 232 } |
230 | 233 |
231 } // namespace internal | 234 } // namespace internal |
232 } // namespace v8 | 235 } // namespace v8 |
OLD | NEW |