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

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

Issue 15455002: Use keyed-call inline caches in delegating yield (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix ARM compilation. 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 | « src/ia32/full-codegen-ia32.cc ('k') | test/mjsunit/regress/regress-2691.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/full-codegen-x64.cc
diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
index 4068af3683bd3cb8b625df330e1acf7a752c5d3a..3b90d4181af2a33c83188de0191861e212993636 100644
--- a/src/x64/full-codegen-x64.cc
+++ b/src/x64/full-codegen-x64.cc
@@ -2020,16 +2020,13 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
__ jmp(&l_next);
- // catch (e) { receiver = iter; f = iter.throw; arg = e; goto l_call; }
+ // catch (e) { receiver = iter; f = 'throw'; arg = e; goto l_call; }
__ bind(&l_catch);
handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos()));
- __ movq(rcx, Operand(rsp, 1 * kPointerSize)); // iter
- __ push(rcx); // iter
- __ push(rax); // exception
- __ movq(rax, rcx); // iter
__ LoadRoot(rcx, Heap::kthrow_stringRootIndex); // "throw"
- Handle<Code> throw_ic = isolate()->builtins()->LoadIC_Initialize();
- CallIC(throw_ic); // iter.throw in rax
+ __ push(rcx);
+ __ push(Operand(rsp, 2 * kPointerSize)); // iter
+ __ push(rax); // exception
__ jmp(&l_call);
// try { received = yield result.value }
@@ -2049,31 +2046,19 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ bind(&l_resume); // received in rax
__ PopTryHandler();
- // receiver = iter; f = iter.next; arg = received;
+ // receiver = iter; f = 'next'; arg = received;
__ bind(&l_next);
- __ movq(rcx, Operand(rsp, 1 * kPointerSize)); // iter
- __ push(rcx); // iter
- __ push(rax); // received
- __ movq(rax, rcx); // iter
__ LoadRoot(rcx, Heap::knext_stringRootIndex); // "next"
- Handle<Code> next_ic = isolate()->builtins()->LoadIC_Initialize();
- CallIC(next_ic); // iter.next in rax
+ __ push(rcx);
+ __ push(Operand(rsp, 2 * kPointerSize)); // iter
+ __ push(rax); // received
- // result = f.call(receiver, arg);
+ // result = receiver[f](arg);
__ bind(&l_call);
- Label l_call_runtime;
- __ JumpIfSmi(rax, &l_call_runtime);
- __ CmpObjectType(rax, JS_FUNCTION_TYPE, rbx);
- __ j(not_equal, &l_call_runtime);
- __ movq(rdi, rax);
- ParameterCount count(1);
- __ InvokeFunction(rdi, count, CALL_FUNCTION,
- NullCallWrapper(), CALL_AS_METHOD);
+ Handle<Code> ic = isolate()->stub_cache()->ComputeKeyedCallInitialize(1);
+ CallIC(ic);
__ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
- __ jmp(&l_loop);
- __ bind(&l_call_runtime);
- __ push(rax);
- __ CallRuntime(Runtime::kCall, 3);
+ __ Drop(1); // The key is still on the stack; drop it.
// val = result.value; if (!result.done) goto l_try;
__ bind(&l_loop);
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | test/mjsunit/regress/regress-2691.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698