| Index: src/rewriter.cc
|
| diff --git a/src/rewriter.cc b/src/rewriter.cc
|
| index 747f46f1b9a0a9b69d1d5b53525e19eb9d8f86fb..1abc6568621a0f23c10e627e2b842e876db62c5f 100644
|
| --- a/src/rewriter.cc
|
| +++ b/src/rewriter.cc
|
| @@ -222,11 +222,6 @@ void AstOptimizer::VisitConditional(Conditional* node) {
|
| }
|
|
|
|
|
| -void AstOptimizer::VisitSlot(Slot* node) {
|
| - USE(node);
|
| -}
|
| -
|
| -
|
| void AstOptimizer::VisitVariableProxy(VariableProxy* node) {
|
| Variable* var = node->AsVariable();
|
| if (var != NULL) {
|
| @@ -686,7 +681,7 @@ void AstOptimizer::VisitThisFunction(ThisFunction* node) {
|
|
|
| class Processor: public AstVisitor {
|
| public:
|
| - explicit Processor(VariableProxy* result)
|
| + explicit Processor(Variable* result)
|
| : result_(result),
|
| result_assigned_(false),
|
| is_set_(false),
|
| @@ -697,7 +692,7 @@ class Processor: public AstVisitor {
|
| bool result_assigned() const { return result_assigned_; }
|
|
|
| private:
|
| - VariableProxy* result_;
|
| + Variable* result_;
|
|
|
| // We are not tracking result usage via the result_'s use
|
| // counts (we leave the accurate computation to the
|
| @@ -714,7 +709,8 @@ class Processor: public AstVisitor {
|
|
|
| Expression* SetResult(Expression* value) {
|
| result_assigned_ = true;
|
| - return new Assignment(Token::ASSIGN, result_, value,
|
| + VariableProxy* result_proxy = new VariableProxy(result_);
|
| + return new Assignment(Token::ASSIGN, result_proxy, value,
|
| RelocInfo::kNoPosition);
|
| }
|
|
|
| @@ -869,12 +865,6 @@ void Processor::VisitConditional(Conditional* node) {
|
| }
|
|
|
|
|
| -void Processor::VisitSlot(Slot* node) {
|
| - USE(node);
|
| - UNREACHABLE();
|
| -}
|
| -
|
| -
|
| void Processor::VisitVariableProxy(VariableProxy* node) {
|
| USE(node);
|
| UNREACHABLE();
|
| @@ -999,13 +989,16 @@ bool Rewriter::Rewrite(CompilationInfo* info) {
|
|
|
| ZoneList<Statement*>* body = function->body();
|
| if (!body->is_empty()) {
|
| - VariableProxy* result = scope->NewTemporary(
|
| + Variable* result = scope->NewTemporary(
|
| info->isolate()->factory()->result_symbol());
|
| Processor processor(result);
|
| processor.Process(body);
|
| if (processor.HasStackOverflow()) return false;
|
|
|
| - if (processor.result_assigned()) body->Add(new ReturnStatement(result));
|
| + if (processor.result_assigned()) {
|
| + VariableProxy* result_proxy = new VariableProxy(result);
|
| + body->Add(new ReturnStatement(result_proxy));
|
| + }
|
| }
|
|
|
| return true;
|
|
|