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

Unified Diff: src/compiler/bytecode-graph-builder.h

Issue 1419373007: [Interpreter] Adds implementation of bytecode graph builder for LoadICSloppy/Strict (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Modified bytecode-graph-builder-unittest to build bytecode array instead of generating it. Created 5 years, 1 month 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
« no previous file with comments | « no previous file | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/bytecode-graph-builder.h
diff --git a/src/compiler/bytecode-graph-builder.h b/src/compiler/bytecode-graph-builder.h
index 4e479ba3e64f79b2b3c276ca5284dc3025549de3..afdfe26a84d65a0b7ba5ea251106a6cea3669eb7 100644
--- a/src/compiler/bytecode-graph-builder.h
+++ b/src/compiler/bytecode-graph-builder.h
@@ -34,8 +34,25 @@ class BytecodeGraphBuilder {
Node* LoadAccumulator(Node* value);
+ // Get or create the node that represents the outer function closure.
+ Node* GetFunctionClosure();
+
+ // Get or create the node that represents the outer function context.
Node* GetFunctionContext();
+ // Builders for accessing an immutable object field.
+ Node* BuildLoadImmutableObjectField(Node* object, int offset);
+
+ // Builder for accessing type feedback vector.
+ Node* BuildLoadFeedbackVector();
+
+ // Helper function for creating a pair containing type feedback vector and
+ // a feedback slot.
+ VectorSlotPair CreateVectorSlotPair(int slot_id);
+
+ // Replaces the frame state inputs with empty frame states.
+ void AddEmptyFrameStateInputs(Node* node);
+
void set_environment(Environment* env) { environment_ = env; }
const Environment* environment() const { return environment_; }
Environment* environment() { return environment_; }
@@ -55,6 +72,11 @@ class BytecodeGraphBuilder {
return MakeNode(op, arraysize(buffer), buffer, false);
}
+ Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3) {
+ Node* buffer[] = {n1, n2, n3};
+ return MakeNode(op, arraysize(buffer), buffer, false);
+ }
+
Node* MakeNode(const Operator* op, int value_input_count, Node** value_inputs,
bool incomplete);
@@ -67,6 +89,8 @@ class BytecodeGraphBuilder {
void BuildBinaryOp(const Operator* op,
const interpreter::BytecodeArrayIterator& iterator);
+ void BuildNamedLoad(const interpreter::BytecodeArrayIterator& iterator);
+
// Growth increment for the temporary buffer used to construct input lists to
// new nodes.
static const int kInputBufferSizeIncrement = 64;
@@ -83,8 +107,8 @@ class BytecodeGraphBuilder {
}
LanguageMode language_mode() const {
- // TODO(oth): need to propagate language mode through
- return LanguageMode::SLOPPY;
+ // TODO(mythria): Don't rely on parse information to get language mode.
+ return info()->language_mode();
}
#define DECLARE_VISIT_BYTECODE(name, ...) \
@@ -104,6 +128,10 @@ class BytecodeGraphBuilder {
// Nodes representing values in the activation record.
SetOncePointer<Node> function_context_;
+ SetOncePointer<Node> function_closure_;
+
+ // Optimization to cache loaded feedback vector.
+ SetOncePointer<Node> feedback_vector_;
// Control nodes that exit the function body.
ZoneVector<Node*> exit_controls_;
« no previous file with comments | « no previous file | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698