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

Unified Diff: src/full-codegen/ia32/full-codegen-ia32.cc

Issue 1724753002: [fullcodegen] Implement control flow across do-expressions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Disable verification. Created 4 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/full-codegen/full-codegen.cc ('k') | src/full-codegen/mips/full-codegen-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/ia32/full-codegen-ia32.cc
diff --git a/src/full-codegen/ia32/full-codegen-ia32.cc b/src/full-codegen/ia32/full-codegen-ia32.cc
index 1f913af43f4910945acb5f7a259ddc34a3a8c14a..13639a7e1035f440d98e9385f7bd0fb812f151d7 100644
--- a/src/full-codegen/ia32/full-codegen-ia32.cc
+++ b/src/full-codegen/ia32/full-codegen-ia32.cc
@@ -934,14 +934,14 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
FeedbackVectorSlot slot = stmt->ForInFeedbackSlot();
- Label loop, exit;
- ForIn loop_statement(this, stmt);
- increment_loop_depth();
-
// Get the object to enumerate over.
SetExpressionAsStatementPosition(stmt->enumerable());
VisitForAccumulatorValue(stmt->enumerable());
- OperandStackDepthIncrement(ForIn::kElementCount);
+ OperandStackDepthIncrement(5);
+
+ Label loop, exit;
+ Iteration loop_statement(this, stmt);
+ increment_loop_depth();
// If the object is null or undefined, skip over the loop, otherwise convert
// it to a JS receiver. See ECMA-262 version 5, section 12.6.4.
@@ -1089,8 +1089,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
// Remove the pointers stored on the stack.
__ bind(loop_statement.break_label());
- __ add(esp, Immediate(5 * kPointerSize));
- OperandStackDepthDecrement(ForIn::kElementCount);
+ DropOperands(5);
// Exit and decrement the loop depth.
PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS);
@@ -1805,7 +1804,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
case Yield::kSuspend:
// Pop value from top-of-stack slot; box result into result register.
EmitCreateIteratorResult(false);
- __ push(result_register());
+ PushOperand(result_register());
// Fall through.
case Yield::kInitial: {
Label suspend, continuation, post_runtime, resume;
@@ -1824,6 +1823,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
EmitUnwindAndReturn();
__ bind(&suspend);
+ OperandStackDepthIncrement(1); // Not popped on this path.
VisitForAccumulatorValue(expr->generator_object());
DCHECK(continuation.pos() > 0 && Smi::IsValid(continuation.pos()));
__ mov(FieldOperand(eax, JSGeneratorObject::kContinuationOffset),
@@ -1850,7 +1850,6 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
case Yield::kFinal: {
// Pop value from top-of-stack slot, box result into result register.
- OperandStackDepthDecrement(1);
EmitCreateIteratorResult(true);
EmitUnwindAndReturn();
break;
@@ -1991,6 +1990,7 @@ void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
__ mov(FieldOperand(eax, JSIteratorResult::kDoneOffset),
isolate()->factory()->ToBoolean(done));
STATIC_ASSERT(JSIteratorResult::kSize == 5 * kPointerSize);
+ OperandStackDepthDecrement(1);
}
« no previous file with comments | « src/full-codegen/full-codegen.cc ('k') | src/full-codegen/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698