Chromium Code Reviews| 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..f1ba964316182a1e54e4d5feabf6488c2278bc19 100644 |
| --- a/src/compiler/bytecode-graph-builder.h |
| +++ b/src/compiler/bytecode-graph-builder.h |
| @@ -28,14 +28,34 @@ 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. |
|
rmcilroy
2015/11/10 18:00:15
nit - you only have the immutable version here - u
mythria
2015/11/11 13:39:24
Done.
|
| + 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); |
| + |
| + // Builds deoptimization for a given node. |
|
rmcilroy
2015/11/10 18:00:15
nit - not sure what you mean by "Builds deoptimiza
mythria
2015/11/11 13:39:24
Removed this function as discussed in today's meet
|
| + // 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 +75,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 +92,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 +110,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 +131,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_; |