Index: src/codegen-ia32.cc |
=================================================================== |
--- src/codegen-ia32.cc (revision 1546) |
+++ src/codegen-ia32.cc (working copy) |
@@ -30,8 +30,9 @@ |
#include "bootstrapper.h" |
#include "codegen-inl.h" |
#include "debug.h" |
+#include "runtime.h" |
#include "scopes.h" |
-#include "runtime.h" |
+#include "virtual-frame.h" |
namespace v8 { namespace internal { |
@@ -439,6 +440,16 @@ |
} |
+void CodeGenerator::LoadAndSpill(Expression* expression, |
+ TypeofState typeof_state) { |
+ ASSERT(in_spilled_code()); |
+ set_in_spilled_code(false); |
+ Load(expression, typeof_state); |
+ frame_->SpillAll(); |
+ set_in_spilled_code(true); |
+} |
+ |
+ |
void CodeGenerator::Load(Expression* x, TypeofState typeof_state) { |
#ifdef DEBUG |
int original_height = frame_->height(); |
@@ -1553,6 +1564,28 @@ |
} |
+void CodeGenerator::VisitAndSpill(Statement* statement) { |
+ ASSERT(in_spilled_code()); |
+ set_in_spilled_code(false); |
+ Visit(statement); |
+ if (frame_ != NULL) { |
+ frame_->SpillAll(); |
+ } |
+ set_in_spilled_code(true); |
+} |
+ |
+ |
+void CodeGenerator::VisitStatementsAndSpill(ZoneList<Statement*>* statements) { |
+ ASSERT(in_spilled_code()); |
+ set_in_spilled_code(false); |
+ VisitStatements(statements); |
+ if (frame_ != NULL) { |
+ frame_->SpillAll(); |
+ } |
+ set_in_spilled_code(true); |
+} |
+ |
+ |
void CodeGenerator::VisitStatements(ZoneList<Statement*>* statements) { |
ASSERT(!in_spilled_code()); |
for (int i = 0; has_valid_frame() && i < statements->length(); i++) { |