summaryrefslogtreecommitdiffstats
path: root/src/full-codegen.cc
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-01-06 18:27:03 +0000
committerBen Murdoch <benm@google.com>2011-01-06 18:27:03 +0000
commitdb5a90a88cfcddb042912799e872037c6548b8a3 (patch)
tree9814507a4747f3a2a18f373136c8afc07833e296 /src/full-codegen.cc
parent84594822a6e163d90d09c0b2a1f0e6502adf4686 (diff)
downloadandroid_external_v8-db5a90a88cfcddb042912799e872037c6548b8a3.tar.gz
android_external_v8-db5a90a88cfcddb042912799e872037c6548b8a3.tar.bz2
android_external_v8-db5a90a88cfcddb042912799e872037c6548b8a3.zip
Update V8 to r6122 (2.5 branch) as required by Chromium 9.0.597.55
Change-Id: Ia29dad551dd0cd7fa3c4d5084421f91d8b210271
Diffstat (limited to 'src/full-codegen.cc')
-rw-r--r--src/full-codegen.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/full-codegen.cc b/src/full-codegen.cc
index a890f159..55aa2301 100644
--- a/src/full-codegen.cc
+++ b/src/full-codegen.cc
@@ -795,6 +795,11 @@ void FullCodeGenerator::VisitContinueStatement(ContinueStatement* stmt) {
SetStatementPosition(stmt);
NestedStatement* current = nesting_stack_;
int stack_depth = 0;
+ // When continuing, we clobber the unpredictable value in the accumulator
+ // with one that's safe for GC. If we hit an exit from the try block of
+ // try...finally on our way out, we will unconditionally preserve the
+ // accumulator on the stack.
+ ClearAccumulator();
while (!current->IsContinueTarget(stmt->target())) {
stack_depth = current->Exit(stack_depth);
current = current->outer();
@@ -811,6 +816,11 @@ void FullCodeGenerator::VisitBreakStatement(BreakStatement* stmt) {
SetStatementPosition(stmt);
NestedStatement* current = nesting_stack_;
int stack_depth = 0;
+ // When breaking, we clobber the unpredictable value in the accumulator
+ // with one that's safe for GC. If we hit an exit from the try block of
+ // try...finally on our way out, we will unconditionally preserve the
+ // accumulator on the stack.
+ ClearAccumulator();
while (!current->IsBreakTarget(stmt->target())) {
stack_depth = current->Exit(stack_depth);
current = current->outer();
@@ -1100,7 +1110,10 @@ void FullCodeGenerator::VisitTryFinallyStatement(TryFinallyStatement* stmt) {
Visit(stmt->try_block());
__ PopTryHandler();
}
- // Execute the finally block on the way out.
+ // Execute the finally block on the way out. Clobber the unpredictable
+ // value in the accumulator with one that's safe for GC. The finally
+ // block will unconditionally preserve the accumulator on the stack.
+ ClearAccumulator();
__ Call(&finally_entry);
}