Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Unified Diff: src/rewriter.cc

Issue 6529055: [Isolates] Merge crankshaft (r5922 from bleeding_edge). (Closed)
Patch Set: Win32 port Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/property.h ('k') | src/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/property.h ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698