Chromium Code Reviews| 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 #ifndef V8_COMPILER_H_ | 5 #ifndef V8_COMPILER_H_ |
| 6 #define V8_COMPILER_H_ | 6 #define V8_COMPILER_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/ast.h" | 9 #include "src/ast.h" |
| 10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 ONLY_SINGLE_FUNCTION_LITERAL // Only a single FunctionLiteral expression. | 23 ONLY_SINGLE_FUNCTION_LITERAL // Only a single FunctionLiteral expression. |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 struct OffsetRange { | 26 struct OffsetRange { |
| 27 OffsetRange(int from, int to) : from(from), to(to) {} | 27 OffsetRange(int from, int to) : from(from), to(to) {} |
| 28 int from; | 28 int from; |
| 29 int to; | 29 int to; |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 | 32 |
| 33 class InlinedFunctionInfo { | |
|
Vyacheslav Egorov (Google)
2015/02/16 15:12:02
Maybe we should move HSourcePosition and rename in
Sven Panne
2015/02/17 07:31:06
This sounds sensible, I don't really like all thos
| |
| 34 public: | |
| 35 explicit InlinedFunctionInfo(Handle<SharedFunctionInfo> shared) | |
| 36 : shared_(shared), start_position_(shared->start_position()) {} | |
| 37 | |
| 38 Handle<SharedFunctionInfo> shared() const { return shared_; } | |
| 39 int start_position() const { return start_position_; } | |
| 40 | |
| 41 private: | |
| 42 Handle<SharedFunctionInfo> shared_; | |
| 43 int start_position_; | |
| 44 }; | |
| 45 | |
| 46 | |
| 33 class ScriptData { | 47 class ScriptData { |
| 34 public: | 48 public: |
| 35 ScriptData(const byte* data, int length); | 49 ScriptData(const byte* data, int length); |
| 36 ~ScriptData() { | 50 ~ScriptData() { |
| 37 if (owns_data_) DeleteArray(data_); | 51 if (owns_data_) DeleteArray(data_); |
| 38 } | 52 } |
| 39 | 53 |
| 40 const byte* data() const { return data_; } | 54 const byte* data() const { return data_; } |
| 41 int length() const { return length_; } | 55 int length() const { return length_; } |
| 42 bool rejected() const { return rejected_; } | 56 bool rejected() const { return rejected_; } |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 376 inline void AddNoFrameRange(int from, int to) { | 390 inline void AddNoFrameRange(int from, int to) { |
| 377 if (no_frame_ranges_) no_frame_ranges_->Add(OffsetRange(from, to)); | 391 if (no_frame_ranges_) no_frame_ranges_->Add(OffsetRange(from, to)); |
| 378 } | 392 } |
| 379 | 393 |
| 380 List<OffsetRange>* ReleaseNoFrameRanges() { | 394 List<OffsetRange>* ReleaseNoFrameRanges() { |
| 381 List<OffsetRange>* result = no_frame_ranges_; | 395 List<OffsetRange>* result = no_frame_ranges_; |
| 382 no_frame_ranges_ = NULL; | 396 no_frame_ranges_ = NULL; |
| 383 return result; | 397 return result; |
| 384 } | 398 } |
| 385 | 399 |
| 400 List<InlinedFunctionInfo>* inlined_function_infos() { | |
| 401 return inlined_function_infos_; | |
| 402 } | |
| 403 List<int>* inlining_id_to_function_id() { | |
| 404 return inlining_id_to_function_id_; | |
| 405 } | |
| 406 int TraceInlinedFunction(Handle<SharedFunctionInfo> shared, int raw_position); | |
| 407 | |
| 386 Handle<Foreign> object_wrapper() { | 408 Handle<Foreign> object_wrapper() { |
| 387 if (object_wrapper_.is_null()) { | 409 if (object_wrapper_.is_null()) { |
| 388 object_wrapper_ = | 410 object_wrapper_ = |
| 389 isolate()->factory()->NewForeign(reinterpret_cast<Address>(this)); | 411 isolate()->factory()->NewForeign(reinterpret_cast<Address>(this)); |
| 390 } | 412 } |
| 391 return object_wrapper_; | 413 return object_wrapper_; |
| 392 } | 414 } |
| 393 | 415 |
| 394 void AbortDueToDependencyChange() { | 416 void AbortDueToDependencyChange() { |
| 395 DCHECK(!OptimizingCompilerThread::IsOptimizerThread(isolate())); | 417 DCHECK(!OptimizingCompilerThread::IsOptimizerThread(isolate())); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 519 Handle<T> handle(*(*object)); | 541 Handle<T> handle(*(*object)); |
| 520 *object = handle; | 542 *object = handle; |
| 521 } | 543 } |
| 522 } | 544 } |
| 523 | 545 |
| 524 BailoutReason bailout_reason_; | 546 BailoutReason bailout_reason_; |
| 525 | 547 |
| 526 int prologue_offset_; | 548 int prologue_offset_; |
| 527 | 549 |
| 528 List<OffsetRange>* no_frame_ranges_; | 550 List<OffsetRange>* no_frame_ranges_; |
| 551 List<InlinedFunctionInfo>* inlined_function_infos_; | |
| 552 List<int>* inlining_id_to_function_id_; | |
| 529 | 553 |
| 530 // A copy of shared_info()->opt_count() to avoid handle deref | 554 // A copy of shared_info()->opt_count() to avoid handle deref |
| 531 // during graph optimization. | 555 // during graph optimization. |
| 532 int opt_count_; | 556 int opt_count_; |
| 533 | 557 |
| 534 // Number of parameters used for compilation of stubs that require arguments. | 558 // Number of parameters used for compilation of stubs that require arguments. |
| 535 int parameter_count_; | 559 int parameter_count_; |
| 536 | 560 |
| 537 Handle<Foreign> object_wrapper_; | 561 Handle<Foreign> object_wrapper_; |
| 538 | 562 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 776 Zone zone_; | 800 Zone zone_; |
| 777 size_t info_zone_start_allocation_size_; | 801 size_t info_zone_start_allocation_size_; |
| 778 base::ElapsedTimer timer_; | 802 base::ElapsedTimer timer_; |
| 779 | 803 |
| 780 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 804 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
| 781 }; | 805 }; |
| 782 | 806 |
| 783 } } // namespace v8::internal | 807 } } // namespace v8::internal |
| 784 | 808 |
| 785 #endif // V8_COMPILER_H_ | 809 #endif // V8_COMPILER_H_ |
| OLD | NEW |