| Index: vm/intermediate_language.h
|
| ===================================================================
|
| --- vm/intermediate_language.h (revision 9930)
|
| +++ vm/intermediate_language.h (working copy)
|
| @@ -113,6 +113,7 @@
|
| class BufferFormatter;
|
| class ComparisonComp;
|
| class Instruction;
|
| +class PushArgumentInstr;
|
| class Value;
|
|
|
| class Computation : public ZoneAllocated {
|
| @@ -459,7 +460,7 @@
|
| public:
|
| ClosureCallComp(ClosureCallNode* node,
|
| intptr_t try_index,
|
| - ZoneGrowableArray<Value*>* arguments)
|
| + ZoneGrowableArray<PushArgumentInstr*>* arguments)
|
| : ast_node_(*node),
|
| try_index_(try_index),
|
| arguments_(arguments) { }
|
| @@ -471,20 +472,23 @@
|
| intptr_t try_index() const { return try_index_; }
|
|
|
| intptr_t ArgumentCount() const { return arguments_->length(); }
|
| - Value* ArgumentAt(intptr_t index) const { return (*arguments_)[index]; }
|
| + PushArgumentInstr* ArgumentAt(intptr_t index) const {
|
| + return (*arguments_)[index];
|
| + }
|
|
|
| - virtual intptr_t InputCount() const;
|
| - virtual Value* InputAt(intptr_t i) const { return ArgumentAt(i); }
|
| - virtual void SetInputAt(intptr_t i, Value* value) {
|
| - (*arguments_)[i] = value;
|
| + virtual intptr_t InputCount() const { return 0; }
|
| + virtual Value* InputAt(intptr_t i) const {
|
| + UNREACHABLE();
|
| + return NULL;
|
| }
|
| + virtual void SetInputAt(intptr_t i, Value* value) { UNREACHABLE(); }
|
|
|
| virtual void PrintOperandsTo(BufferFormatter* f) const;
|
|
|
| private:
|
| const ClosureCallNode& ast_node_;
|
| const intptr_t try_index_;
|
| - ZoneGrowableArray<Value*>* arguments_;
|
| + ZoneGrowableArray<PushArgumentInstr*>* arguments_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ClosureCallComp);
|
| };
|
| @@ -1235,27 +1239,17 @@
|
| };
|
|
|
|
|
| -class CreateClosureComp : public TemplateComputation<2> {
|
| +class CreateClosureComp : public TemplateComputation<0> {
|
| public:
|
| - CreateClosureComp(ClosureNode* node,
|
| - intptr_t try_index,
|
| - Value* type_arguments,
|
| - Value* receiver)
|
| + CreateClosureComp(ClosureNode* node, intptr_t try_index)
|
| : ast_node_(*node),
|
| - try_index_(try_index) {
|
| - ASSERT(type_arguments != NULL);
|
| - ASSERT(receiver != NULL);
|
| - inputs_[0] = type_arguments;
|
| - inputs_[1] = receiver;
|
| - }
|
| + try_index_(try_index) { }
|
|
|
| DECLARE_COMPUTATION(CreateClosure)
|
|
|
| intptr_t token_pos() const { return ast_node_.token_pos(); }
|
| intptr_t try_index() const { return try_index_; }
|
| const Function& function() const { return ast_node_.function(); }
|
| - Value* type_arguments() const { return inputs_[0]; }
|
| - Value* receiver() const { return inputs_[1]; }
|
|
|
| virtual void PrintOperandsTo(BufferFormatter* f) const;
|
|
|
| @@ -1680,6 +1674,7 @@
|
| M(Bind) \
|
| M(Parameter) \
|
| M(ParallelMove) \
|
| + M(PushArgument) \
|
| M(Return) \
|
| M(Throw) \
|
| M(ReThrow) \
|
| @@ -2223,6 +2218,25 @@
|
| };
|
|
|
|
|
| +class PushArgumentInstr : public InstructionWithInputs {
|
| + public:
|
| + explicit PushArgumentInstr(Value* value) : value_(value) { }
|
| +
|
| + DECLARE_INSTRUCTION(PushArgument)
|
| +
|
| + Value* value() const { return value_; }
|
| +
|
| + virtual LocationSummary* MakeLocationSummary() const;
|
| +
|
| + virtual void EmitNativeCode(FlowGraphCompiler* compiler);
|
| +
|
| + private:
|
| + Value* value_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(PushArgumentInstr);
|
| +};
|
| +
|
| +
|
| class ReturnInstr : public InstructionWithInputs {
|
| public:
|
| ReturnInstr(intptr_t token_pos, Value* value)
|
|
|