Chromium Code Reviews| 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 "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/interpreter/bytecode-array-writer.h" | 9 #include "src/interpreter/bytecode-array-writer.h" |
| 10 #include "src/interpreter/bytecode-register-allocator.h" | 10 #include "src/interpreter/bytecode-register-allocator.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 225 BytecodeArrayBuilder& JumpIfNotHole(BytecodeLabel* label); | 225 BytecodeArrayBuilder& JumpIfNotHole(BytecodeLabel* label); |
| 226 BytecodeArrayBuilder& JumpIfNull(BytecodeLabel* label); | 226 BytecodeArrayBuilder& JumpIfNull(BytecodeLabel* label); |
| 227 BytecodeArrayBuilder& JumpIfUndefined(BytecodeLabel* label); | 227 BytecodeArrayBuilder& JumpIfUndefined(BytecodeLabel* label); |
| 228 | 228 |
| 229 BytecodeArrayBuilder& StackCheck(int position); | 229 BytecodeArrayBuilder& StackCheck(int position); |
| 230 | 230 |
| 231 BytecodeArrayBuilder& Throw(); | 231 BytecodeArrayBuilder& Throw(); |
| 232 BytecodeArrayBuilder& ReThrow(); | 232 BytecodeArrayBuilder& ReThrow(); |
| 233 BytecodeArrayBuilder& Return(); | 233 BytecodeArrayBuilder& Return(); |
| 234 | 234 |
| 235 BytecodeArrayBuilder& Illegal(); | |
| 236 | |
| 237 // Debugger. | 235 // Debugger. |
| 238 BytecodeArrayBuilder& Debugger(); | 236 BytecodeArrayBuilder& Debugger(); |
| 239 | 237 |
| 240 // Complex flow control. | 238 // Complex flow control. |
| 241 BytecodeArrayBuilder& ForInPrepare(Register cache_info_triple); | 239 BytecodeArrayBuilder& ForInPrepare(Register cache_info_triple); |
| 242 BytecodeArrayBuilder& ForInDone(Register index, Register cache_length); | 240 BytecodeArrayBuilder& ForInDone(Register index, Register cache_length); |
| 243 BytecodeArrayBuilder& ForInNext(Register receiver, Register index, | 241 BytecodeArrayBuilder& ForInNext(Register receiver, Register index, |
| 244 Register cache_type_array_pair, | 242 Register cache_type_array_pair, |
| 245 int feedback_slot); | 243 int feedback_slot); |
| 246 BytecodeArrayBuilder& ForInStep(Register index); | 244 BytecodeArrayBuilder& ForInStep(Register index); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 327 | 325 |
| 328 // Attach latest source position to |node|. | 326 // Attach latest source position to |node|. |
| 329 void AttachSourceInfo(BytecodeNode* node); | 327 void AttachSourceInfo(BytecodeNode* node); |
| 330 | 328 |
| 331 // Set position for return. | 329 // Set position for return. |
| 332 void SetReturnPosition(); | 330 void SetReturnPosition(); |
| 333 | 331 |
| 334 // Gets a constant pool entry for the |object|. | 332 // Gets a constant pool entry for the |object|. |
| 335 size_t GetConstantPoolEntry(Handle<Object> object); | 333 size_t GetConstantPoolEntry(Handle<Object> object); |
| 336 | 334 |
| 335 // Not implemented as the illegal bytecode is used inside internally | |
| 336 // to indicate a bytecode field is not valid or an error has occured | |
| 337 // during bytecode generation. | |
| 338 BytecodeArrayBuilder& Illegal(); | |
| 339 | |
|
rmcilroy
2016/05/13 12:41:27
We should just remove the function, right?
| |
| 337 Isolate* isolate() const { return isolate_; } | 340 Isolate* isolate() const { return isolate_; } |
| 338 BytecodeArrayWriter* bytecode_array_writer() { | 341 BytecodeArrayWriter* bytecode_array_writer() { |
| 339 return &bytecode_array_writer_; | 342 return &bytecode_array_writer_; |
| 340 } | 343 } |
| 341 BytecodePipelineStage* pipeline() { return pipeline_; } | 344 BytecodePipelineStage* pipeline() { return pipeline_; } |
| 342 ConstantArrayBuilder* constant_array_builder() { | 345 ConstantArrayBuilder* constant_array_builder() { |
| 343 return &constant_array_builder_; | 346 return &constant_array_builder_; |
| 344 } | 347 } |
| 345 const ConstantArrayBuilder* constant_array_builder() const { | 348 const ConstantArrayBuilder* constant_array_builder() const { |
| 346 return &constant_array_builder_; | 349 return &constant_array_builder_; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 411 size_t offset_; | 414 size_t offset_; |
| 412 | 415 |
| 413 friend class BytecodeArrayBuilder; | 416 friend class BytecodeArrayBuilder; |
| 414 }; | 417 }; |
| 415 | 418 |
| 416 } // namespace interpreter | 419 } // namespace interpreter |
| 417 } // namespace internal | 420 } // namespace internal |
| 418 } // namespace v8 | 421 } // namespace v8 |
| 419 | 422 |
| 420 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 423 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
| OLD | NEW |