| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 kDisableFutureOptimization = 1 << 12, | 128 kDisableFutureOptimization = 1 << 12, |
| 129 kSplittingEnabled = 1 << 13, | 129 kSplittingEnabled = 1 << 13, |
| 130 kTypeFeedbackEnabled = 1 << 14, | 130 kTypeFeedbackEnabled = 1 << 14, |
| 131 kDeoptimizationEnabled = 1 << 15, | 131 kDeoptimizationEnabled = 1 << 15, |
| 132 kSourcePositionsEnabled = 1 << 16, | 132 kSourcePositionsEnabled = 1 << 16, |
| 133 kFirstCompile = 1 << 17, | 133 kFirstCompile = 1 << 17, |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 explicit CompilationInfo(ParseInfo* parse_info); | 136 explicit CompilationInfo(ParseInfo* parse_info); |
| 137 CompilationInfo(CodeStub* stub, Isolate* isolate, Zone* zone); | 137 CompilationInfo(CodeStub* stub, Isolate* isolate, Zone* zone); |
| 138 CompilationInfo(const char* code_stub_debug_name, Isolate* isolate, | 138 CompilationInfo(const char* debug_name, Isolate* isolate, Zone* zone); |
| 139 Zone* zone); | |
| 140 virtual ~CompilationInfo(); | 139 virtual ~CompilationInfo(); |
| 141 | 140 |
| 142 ParseInfo* parse_info() const { return parse_info_; } | 141 ParseInfo* parse_info() const { return parse_info_; } |
| 143 | 142 |
| 144 // ----------------------------------------------------------- | 143 // ----------------------------------------------------------- |
| 145 // TODO(titzer): inline and delete accessors of ParseInfo | 144 // TODO(titzer): inline and delete accessors of ParseInfo |
| 146 // ----------------------------------------------------------- | 145 // ----------------------------------------------------------- |
| 147 Handle<Script> script() const; | 146 Handle<Script> script() const; |
| 148 bool is_eval() const; | 147 bool is_eval() const; |
| 149 bool is_native() const; | 148 bool is_native() const; |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 // Compilation mode. | 425 // Compilation mode. |
| 427 // BASE is generated by the full codegen, optionally prepared for bailouts. | 426 // BASE is generated by the full codegen, optionally prepared for bailouts. |
| 428 // OPTIMIZE is optimized code generated by the Hydrogen-based backend. | 427 // OPTIMIZE is optimized code generated by the Hydrogen-based backend. |
| 429 enum Mode { | 428 enum Mode { |
| 430 BASE, | 429 BASE, |
| 431 OPTIMIZE, | 430 OPTIMIZE, |
| 432 STUB | 431 STUB |
| 433 }; | 432 }; |
| 434 | 433 |
| 435 CompilationInfo(ParseInfo* parse_info, CodeStub* code_stub, | 434 CompilationInfo(ParseInfo* parse_info, CodeStub* code_stub, |
| 436 const char* code_stub_debug_name, Mode mode, Isolate* isolate, | 435 const char* debug_name, Mode mode, Isolate* isolate, |
| 437 Zone* zone); | 436 Zone* zone); |
| 438 | 437 |
| 439 Isolate* isolate_; | 438 Isolate* isolate_; |
| 440 | 439 |
| 441 void SetMode(Mode mode) { | 440 void SetMode(Mode mode) { |
| 442 mode_ = mode; | 441 mode_ = mode; |
| 443 } | 442 } |
| 444 | 443 |
| 445 void SetFlag(Flag flag) { flags_ |= flag; } | 444 void SetFlag(Flag flag) { flags_ |= flag; } |
| 446 | 445 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 | 495 |
| 497 int optimization_id_; | 496 int optimization_id_; |
| 498 | 497 |
| 499 int osr_expr_stack_height_; | 498 int osr_expr_stack_height_; |
| 500 | 499 |
| 501 // The current OSR frame for specialization or {nullptr}. | 500 // The current OSR frame for specialization or {nullptr}. |
| 502 JavaScriptFrame* osr_frame_ = nullptr; | 501 JavaScriptFrame* osr_frame_ = nullptr; |
| 503 | 502 |
| 504 Type::FunctionType* function_type_; | 503 Type::FunctionType* function_type_; |
| 505 | 504 |
| 506 const char* code_stub_debug_name_; | 505 const char* debug_name_; |
| 507 | 506 |
| 508 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); | 507 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); |
| 509 }; | 508 }; |
| 510 | 509 |
| 511 | 510 |
| 512 // A wrapper around a CompilationInfo that detaches the Handles from | 511 // A wrapper around a CompilationInfo that detaches the Handles from |
| 513 // the underlying DeferredHandleScope and stores them in info_ on | 512 // the underlying DeferredHandleScope and stores them in info_ on |
| 514 // destruction. | 513 // destruction. |
| 515 class CompilationHandleScope BASE_EMBEDDED { | 514 class CompilationHandleScope BASE_EMBEDDED { |
| 516 public: | 515 public: |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 Zone zone_; | 701 Zone zone_; |
| 703 size_t info_zone_start_allocation_size_; | 702 size_t info_zone_start_allocation_size_; |
| 704 base::ElapsedTimer timer_; | 703 base::ElapsedTimer timer_; |
| 705 | 704 |
| 706 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 705 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
| 707 }; | 706 }; |
| 708 | 707 |
| 709 } } // namespace v8::internal | 708 } } // namespace v8::internal |
| 710 | 709 |
| 711 #endif // V8_COMPILER_H_ | 710 #endif // V8_COMPILER_H_ |
| OLD | NEW |