| 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/zone.h" | 10 #include "src/zone.h" |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 return abort_due_to_dependency_; | 316 return abort_due_to_dependency_; |
| 317 } | 317 } |
| 318 | 318 |
| 319 bool HasSameOsrEntry(Handle<JSFunction> function, BailoutId osr_ast_id) { | 319 bool HasSameOsrEntry(Handle<JSFunction> function, BailoutId osr_ast_id) { |
| 320 return osr_ast_id_ == osr_ast_id && function.is_identical_to(closure_); | 320 return osr_ast_id_ == osr_ast_id && function.is_identical_to(closure_); |
| 321 } | 321 } |
| 322 | 322 |
| 323 int optimization_id() const { return optimization_id_; } | 323 int optimization_id() const { return optimization_id_; } |
| 324 | 324 |
| 325 AstValueFactory* ast_value_factory() const { return ast_value_factory_; } | 325 AstValueFactory* ast_value_factory() const { return ast_value_factory_; } |
| 326 void SetAstValueFactory(AstValueFactory* ast_value_factory) { | 326 void SetAstValueFactory(AstValueFactory* ast_value_factory, |
| 327 bool owned = true) { |
| 327 ast_value_factory_ = ast_value_factory; | 328 ast_value_factory_ = ast_value_factory; |
| 329 ast_value_factory_owned_ = owned; |
| 328 } | 330 } |
| 329 | 331 |
| 330 protected: | 332 protected: |
| 331 CompilationInfo(Handle<Script> script, | 333 CompilationInfo(Handle<Script> script, |
| 332 Zone* zone); | 334 Zone* zone); |
| 333 CompilationInfo(Handle<SharedFunctionInfo> shared_info, | 335 CompilationInfo(Handle<SharedFunctionInfo> shared_info, |
| 334 Zone* zone); | 336 Zone* zone); |
| 335 CompilationInfo(HydrogenCodeStub* stub, | 337 CompilationInfo(HydrogenCodeStub* stub, |
| 336 Isolate* isolate, | 338 Isolate* isolate, |
| 337 Zone* zone); | 339 Zone* zone); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 // Number of parameters used for compilation of stubs that require arguments. | 466 // Number of parameters used for compilation of stubs that require arguments. |
| 465 int parameter_count_; | 467 int parameter_count_; |
| 466 | 468 |
| 467 bool this_has_uses_; | 469 bool this_has_uses_; |
| 468 | 470 |
| 469 Handle<Foreign> object_wrapper_; | 471 Handle<Foreign> object_wrapper_; |
| 470 | 472 |
| 471 int optimization_id_; | 473 int optimization_id_; |
| 472 | 474 |
| 473 AstValueFactory* ast_value_factory_; | 475 AstValueFactory* ast_value_factory_; |
| 476 bool ast_value_factory_owned_; |
| 474 | 477 |
| 475 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); | 478 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); |
| 476 }; | 479 }; |
| 477 | 480 |
| 478 | 481 |
| 479 // Exactly like a CompilationInfo, except also creates and enters a | 482 // Exactly like a CompilationInfo, except also creates and enters a |
| 480 // Zone on construction and deallocates it on exit. | 483 // Zone on construction and deallocates it on exit. |
| 481 class CompilationInfoWithZone: public CompilationInfo { | 484 class CompilationInfoWithZone: public CompilationInfo { |
| 482 public: | 485 public: |
| 483 explicit CompilationInfoWithZone(Handle<Script> script) | 486 explicit CompilationInfoWithZone(Handle<Script> script) |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 unsigned info_zone_start_allocation_size_; | 704 unsigned info_zone_start_allocation_size_; |
| 702 ElapsedTimer timer_; | 705 ElapsedTimer timer_; |
| 703 | 706 |
| 704 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 707 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
| 705 }; | 708 }; |
| 706 | 709 |
| 707 | 710 |
| 708 } } // namespace v8::internal | 711 } } // namespace v8::internal |
| 709 | 712 |
| 710 #endif // V8_COMPILER_H_ | 713 #endif // V8_COMPILER_H_ |
| OLD | NEW |