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..d975595c85823c34a3278e1b345803f8ec57ff55 100644 |
--- a/src/compiler/bytecode-graph-builder.h |
+++ b/src/compiler/bytecode-graph-builder.h |
@@ -28,14 +28,35 @@ class BytecodeGraphBuilder { |
private: |
class Environment; |
+ class FrameStateBeforeAndAfter; |
void CreateGraphBody(bool stack_check); |
void VisitBytecodes(); |
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 a (potentially immutable) object field. |
+ Node* BuildLoadImmutableObjectField(Node* object, int offset); |
+ |
+ // Builders for accessing the function context. |
rmcilroy
2015/11/09 15:23:00
Fix comment
mythria
2015/11/10 09:55:35
Done.
|
+ Node* BuildLoadFeedbackVector(); |
+ |
+ // Helper function for creating a pair of feedback vector and slot. |
rmcilroy
2015/11/09 15:23:00
/s/pair of feedback vector and slot./pair containi
mythria
2015/11/10 09:55:35
Done.
|
+ // Named and keyed loads require a VectorSlotPair for successful lowering. |
rmcilroy
2015/11/09 15:23:00
no need for second line of comment (there are a bu
mythria
2015/11/10 09:55:35
Done.
|
+ VectorSlotPair CreateVectorSlotPair(FeedbackVectorSlot slot); |
+ VectorSlotPair CreateVectorSlotPair(int slot_id); |
+ |
+ // Builds deoptimization for a given node. |
+ // TODO(mythria): Current implementation introduces empty frames. Replace |
+ // them with actual frame states. |
+ void PrepareFrameState(Node* node); |
+ |
void set_environment(Environment* env) { environment_ = env; } |
const Environment* environment() const { return environment_; } |
Environment* environment() { return environment_; } |
@@ -55,6 +76,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 +93,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 +111,8 @@ class BytecodeGraphBuilder { |
} |
LanguageMode language_mode() const { |
- // TODO(oth): need to propagate language mode through |
- return LanguageMode::SLOPPY; |
+ // TODO(mythria): info() should not be used here. |
rmcilroy
2015/11/09 15:23:00
/s/info() should not be used here/Don't rely on pa
mythria
2015/11/10 09:55:35
Done.
|
+ return info()->language_mode(); |
} |
#define DECLARE_VISIT_BYTECODE(name, ...) \ |
@@ -104,6 +132,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_; |