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..f60bd8648bd2858224e920f572c8b1dd9a845946 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); |
+ Node* BuildLoadObjectField(Node* object, int offset); |
+ |
+ // Builders for accessing the function context. |
+ Node* BuildLoadFeedbackVector(); |
+ |
+ // Helper function for creating a pair of feedback vector and slot. |
+ // Named and keyed loads require a VectorSlotPair for successful lowering. |
+ VectorSlotPair CreateVectorSlotPair(FeedbackVectorSlot slot); |
+ |
+ // 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); |
@@ -104,6 +130,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_; |