Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: src/compiler/interpreter-assembler.h

Issue 1343363002: [Interpreter] Basic flow control. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Clarify comment and diff reduction. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/compiler/interpreter-assembler.h
diff --git a/src/compiler/interpreter-assembler.h b/src/compiler/interpreter-assembler.h
index adb7ed8f71971bb9a5f94cf5c39eac12929c9a42..eca1cbb75e9c80ea0b478c88271e7c6734b1977d 100644
--- a/src/compiler/interpreter-assembler.h
+++ b/src/compiler/interpreter-assembler.h
@@ -13,6 +13,7 @@
#include "src/frames.h"
#include "src/interpreter/bytecodes.h"
#include "src/runtime/runtime.h"
+#include "src/zone-containers.h"
namespace v8 {
namespace internal {
@@ -68,6 +69,7 @@ class InterpreterAssembler {
Node* IntPtrConstant(intptr_t value);
Node* NumberConstant(double value);
Node* HeapConstant(Handle<HeapObject> object);
+ Node* BooleanConstant(bool value);
// Tag and untag Smi values.
Node* SmiTag(Node* value);
@@ -106,6 +108,17 @@ class InterpreterAssembler {
// Call runtime function.
Node* CallRuntime(Runtime::FunctionId function_id, Node* arg1, Node* arg2);
+ // Jump relative to the current bytecode by |jump_offset|.
+ void Jump(Node* jump_offset);
rmcilroy 2015/09/18 10:42:23 please add tests for these in interpreter-assemble
oth 2015/09/23 10:46:55 Added a test for Jump and a partial test JumpIfWor
+
+ // Jump relative to the current bytecode by |jump_offset| if the
+ // values |lhs| and |rhs| are equal.
+ void JumpIfEqual(Node* lhs, Node* rhs, Node* jump_offset);
+
+ // Jump relative to the current bytecode by |jump_offset| if the
+ // values |lhs| and |rhs| are not equal.
+ void JumpIfNotEqual(Node* lhs, Node* rhs, Node* jump_offset);
+
// Returns from the function.
void Return();
@@ -146,9 +159,13 @@ class InterpreterAssembler {
// Returns BytecodeOffset() advanced by delta bytecodes. Note: this does not
// update BytecodeOffset() itself.
Node* Advance(int delta);
+ Node* Advance(Node* delta);
+
+ // Starts next instruction dispatch at |new_bytecode_offset|.
+ void DispatchTo(Node* new_bytecode_offset);
- // Sets the end node of the graph.
- void SetEndInput(Node* input);
+ // Adds an end node of the graph.
+ void AddEndInput(Node* input);
// Private helpers which delegate to RawMachineAssembler.
Isolate* isolate();
@@ -157,7 +174,7 @@ class InterpreterAssembler {
interpreter::Bytecode bytecode_;
base::SmartPointer<RawMachineAssembler> raw_assembler_;
- Node* end_node_;
+ ZoneVector<Node*> end_nodes_;
Node* accumulator_;
bool code_generated_;

Powered by Google App Engine
This is Rietveld 408576698