OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_COMMON_OPERATOR_H_ | 5 #ifndef V8_COMPILER_COMMON_OPERATOR_H_ |
6 #define V8_COMPILER_COMMON_OPERATOR_H_ | 6 #define V8_COMPILER_COMMON_OPERATOR_H_ |
7 | 7 |
8 #include "src/compiler/machine-type.h" | 8 #include "src/compiler/machine-type.h" |
9 #include "src/unique.h" | 9 #include "src/unique.h" |
10 | 10 |
11 namespace v8 { | 11 namespace v8 { |
12 namespace internal { | 12 namespace internal { |
13 | 13 |
14 // Forward declarations. | 14 // Forward declarations. |
15 class ExternalReference; | 15 class ExternalReference; |
16 class OStream; | 16 class OStream; |
17 | 17 |
18 | 18 |
19 namespace compiler { | 19 namespace compiler { |
20 | 20 |
21 // Forward declarations. | 21 // Forward declarations. |
22 class CallDescriptor; | 22 class CallDescriptor; |
23 struct CommonOperatorBuilderImpl; | 23 struct CommonOperatorBuilderImpl; |
24 class Operator; | 24 class Operator; |
25 | 25 |
26 | 26 |
27 // Flag that describes how to combine the current environment with | 27 // Flag that describes how to combine the current environment with |
28 // the output of a node to obtain a framestate for lazy bailout. | 28 // the output of a node to obtain a framestate for lazy bailout. |
29 enum OutputFrameStateCombine { | 29 class OutputFrameStateCombine { |
30 kPushOutput, // Push the output on the expression stack. | 30 public: |
31 kIgnoreOutput // Use the frame state as-is. | 31 enum CombineKind { |
| 32 kPushOutput, // Push the output on the expression stack. |
| 33 kPokeAt // Poke at the given environment location, |
| 34 // counting from the top of the stack. |
| 35 }; |
| 36 |
| 37 static OutputFrameStateCombine Ignore(); |
| 38 static OutputFrameStateCombine Push(size_t count = 1); |
| 39 static OutputFrameStateCombine PokeAt(size_t index); |
| 40 |
| 41 CombineKind kind(); |
| 42 size_t GetPushCount(); |
| 43 size_t GetOffsetToPokeAt(); |
| 44 |
| 45 bool IsOutputIgnored(); |
| 46 |
| 47 private: |
| 48 OutputFrameStateCombine(CombineKind kind, size_t parameter); |
| 49 |
| 50 CombineKind kind_; |
| 51 size_t parameter_; |
32 }; | 52 }; |
33 | 53 |
34 | 54 |
35 // The type of stack frame that a FrameState node represents. | 55 // The type of stack frame that a FrameState node represents. |
36 enum FrameStateType { | 56 enum FrameStateType { |
37 JS_FRAME, // Represents an unoptimized JavaScriptFrame. | 57 JS_FRAME, // Represents an unoptimized JavaScriptFrame. |
38 ARGUMENTS_ADAPTOR // Represents an ArgumentsAdaptorFrame. | 58 ARGUMENTS_ADAPTOR // Represents an ArgumentsAdaptorFrame. |
39 }; | 59 }; |
40 | 60 |
41 | 61 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 128 |
109 const CommonOperatorBuilderImpl& impl_; | 129 const CommonOperatorBuilderImpl& impl_; |
110 Zone* const zone_; | 130 Zone* const zone_; |
111 }; | 131 }; |
112 | 132 |
113 } // namespace compiler | 133 } // namespace compiler |
114 } // namespace internal | 134 } // namespace internal |
115 } // namespace v8 | 135 } // namespace v8 |
116 | 136 |
117 #endif // V8_COMPILER_COMMON_OPERATOR_H_ | 137 #endif // V8_COMPILER_COMMON_OPERATOR_H_ |
OLD | NEW |