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_CRANKSHAFT_HYDROGEN_H_ | 5 #ifndef V8_CRANKSHAFT_HYDROGEN_H_ |
6 #define V8_CRANKSHAFT_HYDROGEN_H_ | 6 #define V8_CRANKSHAFT_HYDROGEN_H_ |
7 | 7 |
8 #include "src/accessors.h" | 8 #include "src/accessors.h" |
9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/ast/ast.h" | 10 #include "src/ast/ast.h" |
11 #include "src/ast/scopes.h" | 11 #include "src/ast/scopes.h" |
12 #include "src/bailout-reason.h" | 12 #include "src/bailout-reason.h" |
13 #include "src/compiler.h" | 13 #include "src/compiler.h" |
14 #include "src/crankshaft/compilation-phase.h" | 14 #include "src/crankshaft/compilation-phase.h" |
15 #include "src/crankshaft/hydrogen-instructions.h" | 15 #include "src/crankshaft/hydrogen-instructions.h" |
| 16 #include "src/parsing/parser.h" |
16 #include "src/zone.h" | 17 #include "src/zone.h" |
17 | 18 |
18 namespace v8 { | 19 namespace v8 { |
19 namespace internal { | 20 namespace internal { |
20 | 21 |
21 // Forward declarations. | 22 // Forward declarations. |
22 class BitVector; | 23 class BitVector; |
23 class FunctionState; | 24 class FunctionState; |
24 class HEnvironment; | 25 class HEnvironment; |
25 class HGraph; | 26 class HGraph; |
26 class HLoopInformation; | 27 class HLoopInformation; |
27 class HOsrBuilder; | 28 class HOsrBuilder; |
28 class HTracer; | 29 class HTracer; |
29 class LAllocator; | 30 class LAllocator; |
30 class LChunk; | 31 class LChunk; |
31 class LiveRange; | 32 class LiveRange; |
32 | 33 |
33 class HCompilationJob final : public CompilationJob { | 34 class HCompilationJob final : public CompilationJob { |
34 public: | 35 public: |
35 explicit HCompilationJob(CompilationInfo* info) | 36 explicit HCompilationJob(Handle<JSFunction> function) |
36 : CompilationJob(info, "Crankshaft"), graph_(nullptr), chunk_(nullptr) {} | 37 : CompilationJob(&info_, "Crankshaft"), |
| 38 zone_(function->GetIsolate()->allocator()), |
| 39 parse_info_(&zone_, function), |
| 40 info_(&parse_info_, function), |
| 41 graph_(nullptr), |
| 42 chunk_(nullptr) {} |
37 | 43 |
38 protected: | 44 protected: |
39 virtual Status CreateGraphImpl(); | 45 virtual Status CreateGraphImpl(); |
40 virtual Status OptimizeGraphImpl(); | 46 virtual Status OptimizeGraphImpl(); |
41 virtual Status GenerateCodeImpl(); | 47 virtual Status GenerateCodeImpl(); |
42 | 48 |
43 private: | 49 private: |
| 50 Zone zone_; |
| 51 ParseInfo parse_info_; |
| 52 CompilationInfo info_; |
44 HGraph* graph_; | 53 HGraph* graph_; |
45 LChunk* chunk_; | 54 LChunk* chunk_; |
46 }; | 55 }; |
47 | 56 |
48 class HBasicBlock final : public ZoneObject { | 57 class HBasicBlock final : public ZoneObject { |
49 public: | 58 public: |
50 explicit HBasicBlock(HGraph* graph); | 59 explicit HBasicBlock(HGraph* graph); |
51 ~HBasicBlock() { } | 60 ~HBasicBlock() { } |
52 | 61 |
53 // Simple accessors. | 62 // Simple accessors. |
(...skipping 3048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3102 } | 3111 } |
3103 | 3112 |
3104 private: | 3113 private: |
3105 HOptimizedGraphBuilder* builder_; | 3114 HOptimizedGraphBuilder* builder_; |
3106 }; | 3115 }; |
3107 | 3116 |
3108 } // namespace internal | 3117 } // namespace internal |
3109 } // namespace v8 | 3118 } // namespace v8 |
3110 | 3119 |
3111 #endif // V8_CRANKSHAFT_HYDROGEN_H_ | 3120 #endif // V8_CRANKSHAFT_HYDROGEN_H_ |
OLD | NEW |