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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 return has_global_object() ? native_context()->global_object() : nullptr; | 208 return has_global_object() ? native_context()->global_object() : nullptr; |
208 } | 209 } |
209 | 210 |
210 void CompilationInfo::SetOptimizing() { | 211 void CompilationInfo::SetOptimizing() { |
211 DCHECK(has_shared_info()); | 212 DCHECK(has_shared_info()); |
212 SetMode(OPTIMIZE); | 213 SetMode(OPTIMIZE); |
213 optimization_id_ = isolate()->NextOptimizationId(); | 214 optimization_id_ = isolate()->NextOptimizationId(); |
214 code_flags_ = Code::KindField::update(code_flags_, Code::OPTIMIZED_FUNCTION); | 215 code_flags_ = Code::KindField::update(code_flags_, Code::OPTIMIZED_FUNCTION); |
215 } | 216 } |
216 | 217 |
217 void CompilationInfo::AddInlinedFunction( | 218 int CompilationInfo::AddInlinedFunction( |
218 Handle<SharedFunctionInfo> inlined_function) { | 219 Handle<SharedFunctionInfo> inlined_function, SourcePosition pos) { |
| 220 int id = static_cast<int>(inlined_functions_.size()); |
219 inlined_functions_.push_back(InlinedFunctionHolder( | 221 inlined_functions_.push_back(InlinedFunctionHolder( |
220 inlined_function, handle(inlined_function->code()))); | 222 inlined_function, handle(inlined_function->code()), pos)); |
| 223 return id; |
221 } | 224 } |
222 | 225 |
223 Code::Kind CompilationInfo::output_code_kind() const { | 226 Code::Kind CompilationInfo::output_code_kind() const { |
224 return Code::ExtractKindFromFlags(code_flags_); | 227 return Code::ExtractKindFromFlags(code_flags_); |
225 } | 228 } |
226 | 229 |
227 } // namespace internal | 230 } // namespace internal |
228 } // namespace v8 | 231 } // namespace v8 |
OLD | NEW |