| 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 #ifndef V8_COMPILATION_INFO_H_ | 5 #ifndef V8_COMPILATION_INFO_H_ |
| 6 #define V8_COMPILATION_INFO_H_ | 6 #define V8_COMPILATION_INFO_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "src/compilation-dependencies.h" | 10 #include "src/compilation-dependencies.h" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 bool has_simple_parameters(); | 283 bool has_simple_parameters(); |
| 284 | 284 |
| 285 struct InlinedFunctionHolder { | 285 struct InlinedFunctionHolder { |
| 286 Handle<SharedFunctionInfo> shared_info; | 286 Handle<SharedFunctionInfo> shared_info; |
| 287 | 287 |
| 288 // Root that holds the unoptimized code of the inlined function alive | 288 // Root that holds the unoptimized code of the inlined function alive |
| 289 // (and out of reach of code flushing) until we finish compilation. | 289 // (and out of reach of code flushing) until we finish compilation. |
| 290 // Do not remove. | 290 // Do not remove. |
| 291 Handle<Code> inlined_code_object_root; | 291 Handle<Code> inlined_code_object_root; |
| 292 | 292 |
| 293 InliningPosition position; |
| 294 |
| 293 InlinedFunctionHolder(Handle<SharedFunctionInfo> inlined_shared_info, | 295 InlinedFunctionHolder(Handle<SharedFunctionInfo> inlined_shared_info, |
| 294 Handle<Code> inlined_code_object_root) | 296 Handle<Code> inlined_code_object_root, |
| 297 SourcePosition pos) |
| 295 : shared_info(inlined_shared_info), | 298 : shared_info(inlined_shared_info), |
| 296 inlined_code_object_root(inlined_code_object_root) {} | 299 inlined_code_object_root(inlined_code_object_root) { |
| 300 position.position = pos; |
| 301 // initialized when generating the deoptimization literals |
| 302 position.inlined_function_id = -1; |
| 303 } |
| 304 |
| 305 void RegisterInlinedFunctionId(size_t inlined_function_id) { |
| 306 position.inlined_function_id = static_cast<int>(inlined_function_id); |
| 307 } |
| 297 }; | 308 }; |
| 298 | 309 |
| 299 typedef std::vector<InlinedFunctionHolder> InlinedFunctionList; | 310 typedef std::vector<InlinedFunctionHolder> InlinedFunctionList; |
| 300 InlinedFunctionList const& inlined_functions() const { | 311 InlinedFunctionList& inlined_functions() { return inlined_functions_; } |
| 301 return inlined_functions_; | |
| 302 } | |
| 303 | 312 |
| 304 void AddInlinedFunction(Handle<SharedFunctionInfo> inlined_function); | 313 // Returns the inlining id for source position tracking. |
| 314 int AddInlinedFunction(Handle<SharedFunctionInfo> inlined_function, |
| 315 SourcePosition pos); |
| 316 |
| 317 Handle<PodArray<InliningPosition>> CreateInliningPositions(); |
| 305 | 318 |
| 306 std::unique_ptr<char[]> GetDebugName() const; | 319 std::unique_ptr<char[]> GetDebugName() const; |
| 307 | 320 |
| 308 Code::Kind output_code_kind() const; | 321 Code::Kind output_code_kind() const; |
| 309 | 322 |
| 310 StackFrame::Type GetOutputStackFrameType() const; | 323 StackFrame::Type GetOutputStackFrameType() const; |
| 311 | 324 |
| 312 int GetDeclareGlobalsFlags() const; | 325 int GetDeclareGlobalsFlags() const; |
| 313 | 326 |
| 314 SourcePositionTableBuilder::RecordingMode SourcePositionRecordingMode() const; | 327 SourcePositionTableBuilder::RecordingMode SourcePositionRecordingMode() const; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 | 396 |
| 384 Vector<const char> debug_name_; | 397 Vector<const char> debug_name_; |
| 385 | 398 |
| 386 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); | 399 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); |
| 387 }; | 400 }; |
| 388 | 401 |
| 389 } // namespace internal | 402 } // namespace internal |
| 390 } // namespace v8 | 403 } // namespace v8 |
| 391 | 404 |
| 392 #endif // V8_COMPILATION_INFO_H_ | 405 #endif // V8_COMPILATION_INFO_H_ |
| OLD | NEW |