OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 5 #ifndef V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
6 #define V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 6 #define V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "src/ast.h" | 10 #include "src/ast.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 Handle<BytecodeArray> ToBytecodeArray(); | 28 Handle<BytecodeArray> ToBytecodeArray(); |
29 | 29 |
30 // Set number of parameters expected by function. | 30 // Set number of parameters expected by function. |
31 void set_parameter_count(int number_of_params); | 31 void set_parameter_count(int number_of_params); |
32 int parameter_count() const; | 32 int parameter_count() const; |
33 | 33 |
34 // Set number of locals required for bytecode array. | 34 // Set number of locals required for bytecode array. |
35 void set_locals_count(int number_of_locals); | 35 void set_locals_count(int number_of_locals); |
36 int locals_count() const; | 36 int locals_count() const; |
37 | 37 |
| 38 // Returns true if the bytecode has an explicit return at the end. |
| 39 bool HasExplicitReturn(); |
| 40 |
38 Register Parameter(int parameter_index); | 41 Register Parameter(int parameter_index); |
39 | 42 |
40 // Constant loads to accumulator. | 43 // Constant loads to accumulator. |
41 BytecodeArrayBuilder& LoadLiteral(v8::internal::Smi* value); | 44 BytecodeArrayBuilder& LoadLiteral(v8::internal::Smi* value); |
42 BytecodeArrayBuilder& LoadLiteral(Handle<Object> object); | 45 BytecodeArrayBuilder& LoadLiteral(Handle<Object> object); |
43 BytecodeArrayBuilder& LoadUndefined(); | 46 BytecodeArrayBuilder& LoadUndefined(); |
44 BytecodeArrayBuilder& LoadNull(); | 47 BytecodeArrayBuilder& LoadNull(); |
45 BytecodeArrayBuilder& LoadTheHole(); | 48 BytecodeArrayBuilder& LoadTheHole(); |
46 BytecodeArrayBuilder& LoadTrue(); | 49 BytecodeArrayBuilder& LoadTrue(); |
47 BytecodeArrayBuilder& LoadFalse(); | 50 BytecodeArrayBuilder& LoadFalse(); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 117 |
115 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); | 118 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); |
116 }; | 119 }; |
117 | 120 |
118 | 121 |
119 } // namespace interpreter | 122 } // namespace interpreter |
120 } // namespace internal | 123 } // namespace internal |
121 } // namespace v8 | 124 } // namespace v8 |
122 | 125 |
123 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 126 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
OLD | NEW |