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

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

Issue 16855009: MIPS: Delegating yield does not re-box result objects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/full-codegen-mips.cc
diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc
index a16e478afa882d4b9f0c5b0af26b1262d2a73b46..9140cb90046f5a1a94a1304b7aa629305e8d6737 100644
--- a/src/mips/full-codegen-mips.cc
+++ b/src/mips/full-codegen-mips.cc
@@ -2056,9 +2056,11 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ mov(a0, v0);
__ jmp(&l_call);
- // try { received = yield result.value }
+ // try { received = %yield result }
+ // Shuffle the received result above a try handler and yield it without
+ // re-boxing.
__ bind(&l_try);
- EmitCreateIteratorResult(false); // pop and box to v0
+ __ pop(a0); // result
__ PushTryHandler(StackHandler::CATCH, expr->index());
const int handler_size = StackHandlerConstants::kSize;
__ push(a0); // result
@@ -2103,18 +2105,10 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ push(a0);
__ CallRuntime(Runtime::kCall, 3);
- // val = result.value; if (!result.done) goto l_try;
+ // if (!result.done) goto l_try;
__ bind(&l_loop);
__ mov(a0, v0);
- // result.value
__ push(a0); // save result
- __ LoadRoot(a2, Heap::kvalue_stringRootIndex); // "value"
- Handle<Code> value_ic = isolate()->builtins()->LoadIC_Initialize();
- CallIC(value_ic); // result.value in a0
- __ mov(a0, v0);
- __ pop(a1); // result
- __ push(a0); // result.value
- __ mov(a0, a1); // result
__ LoadRoot(a2, Heap::kdone_stringRootIndex); // "done"
Handle<Code> done_ic = isolate()->builtins()->LoadIC_Initialize();
CallIC(done_ic); // result.done in v0
@@ -2124,7 +2118,10 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ Branch(&l_try, eq, v0, Operand(zero_reg));
// result.value
- __ pop(v0); // result.value
+ __ pop(a0); // result
+ __ LoadRoot(a2, Heap::kvalue_stringRootIndex); // "value"
+ Handle<Code> value_ic = isolate()->builtins()->LoadIC_Initialize();
+ CallIC(value_ic); // result.value in r0
Paul Lind 2013/06/13 17:32:46 nit: comment r0 -> v0
context()->DropAndPlug(2, v0); // drop iter and g
break;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698