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

Unified Diff: src/builtins/s390/builtins-s390.cc

Issue 2783043002: PPC/s390: [cleanup] combine 3 ResumeGenerator stubs into one (Closed)
Patch Set: Created 3 years, 9 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/builtins/ppc/builtins-ppc.cc ('k') | src/ppc/interface-descriptors-ppc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/s390/builtins-s390.cc
diff --git a/src/builtins/s390/builtins-s390.cc b/src/builtins/s390/builtins-s390.cc
index fcd71d31b6f842df3df7f658b5b73441d4925862..d23e538b0a855a58451d2dea05e0d1cfd3e152eb 100644
--- a/src/builtins/s390/builtins-s390.cc
+++ b/src/builtins/s390/builtins-s390.cc
@@ -653,40 +653,40 @@ void Builtins::Generate_JSBuiltinsConstructStubForDerived(
// static
void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
- Generate_ResumeGenerator(masm, ResumeGeneratorType::kGenerator);
-}
-
-// static
-void Builtins::Generate_ResumeAsyncGeneratorTrampoline(MacroAssembler* masm) {
- Generate_ResumeGenerator(masm, ResumeGeneratorType::kAsyncGenerator);
-}
-
-// static
-void Builtins::Generate_ResumeAwaitedAsyncGeneratorTrampoline(
- MacroAssembler* masm) {
- Generate_ResumeGenerator(masm, ResumeGeneratorType::kAwaitedAsyncGenerator);
-}
-
-void Builtins::Generate_ResumeGenerator(MacroAssembler* masm,
- ResumeGeneratorType type) {
// ----------- S t a t e -------------
// -- r2 : the value to pass to the generator
// -- r3 : the JSGeneratorObject to resume
// -- r4 : the resume mode (tagged)
+ // -- r5 : the SuspendFlags of the earlier suspend call (tagged)
// -- lr : return address
// -----------------------------------
- if (type == ResumeGeneratorType::kGenerator) {
- __ AssertGeneratorObject(r3);
- } else {
- __ AssertAsyncGeneratorObject(r3);
- }
+ __ SmiUntag(r5);
+ __ AssertGeneratorObject(r3, r5);
// Store input value into generator object.
- int offset = type == ResumeGeneratorType::kAwaitedAsyncGenerator
- ? JSAsyncGeneratorObject::kAwaitInputOrDebugPosOffset
- : JSGeneratorObject::kInputOrDebugPosOffset;
- __ StoreP(r2, FieldMemOperand(r3, offset), r0);
- __ RecordWriteField(r3, offset, r2, r5, kLRHasNotBeenSaved, kDontSaveFPRegs);
+ Label async_await, done_store_input;
+
+ __ And(r5, r5, Operand(static_cast<int>(SuspendFlags::kAsyncGeneratorAwait)));
+ __ CmpP(r5, Operand(static_cast<int>(SuspendFlags::kAsyncGeneratorAwait)));
+ __ beq(&async_await);
+
+ __ StoreP(r2, FieldMemOperand(r3, JSGeneratorObject::kInputOrDebugPosOffset),
+ r0);
+ __ RecordWriteField(r3, JSGeneratorObject::kInputOrDebugPosOffset, r2, r5,
+ kLRHasNotBeenSaved, kDontSaveFPRegs);
+ __ b(&done_store_input);
+
+ __ bind(&async_await);
+ __ StoreP(
+ r2,
+ FieldMemOperand(r3, JSAsyncGeneratorObject::kAwaitInputOrDebugPosOffset),
+ r0);
+ __ RecordWriteField(r3, JSAsyncGeneratorObject::kAwaitInputOrDebugPosOffset,
+ r2, r5, kLRHasNotBeenSaved, kDontSaveFPRegs);
+ __ b(&done_store_input);
+
+ __ bind(&done_store_input);
+ // `r5` no longer holds SuspendFlags
// Store resume mode into generator object.
__ StoreP(r4, FieldMemOperand(r3, JSGeneratorObject::kResumeModeOffset));
« no previous file with comments | « src/builtins/ppc/builtins-ppc.cc ('k') | src/ppc/interface-descriptors-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698