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

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

Issue 1663323003: [fullcode] Change fullcode to compile finally using the token approach. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address review comments 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/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/mips64/full-codegen-mips64.cc
diff --git a/src/full-codegen/mips64/full-codegen-mips64.cc b/src/full-codegen/mips64/full-codegen-mips64.cc
index 5bef9c769221fab90dee905ff0300cd26a231c9f..b2c18d2317c6054c2e6fb58b4e989d6af4d5a522 100644
--- a/src/full-codegen/mips64/full-codegen-mips64.cc
+++ b/src/full-codegen/mips64/full-codegen-mips64.cc
@@ -27,8 +27,7 @@
namespace v8 {
namespace internal {
-#define __ ACCESS_MASM(masm_)
-
+#define __ ACCESS_MASM(masm())
// A patch site is a location in the code which it is possible to patch. This
// class has a number of methods to emit the code which is patchable and the
@@ -86,6 +85,7 @@ class JumpPatchSite BASE_EMBEDDED {
}
private:
+ MacroAssembler* masm() { return masm_; }
MacroAssembler* masm_;
Label patch_site_;
#ifdef DEBUG
@@ -1943,8 +1943,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
Operand(Smi::FromInt(JSGeneratorObject::RETURN)));
__ push(result_register());
EmitCreateIteratorResult(true);
- EmitUnwindBeforeReturn();
- EmitReturnSequence();
+ EmitUnwindAndReturn();
__ bind(&suspend);
VisitForAccumulatorValue(expr->generator_object());
@@ -1972,8 +1971,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
case Yield::kFinal: {
// Pop value from top-of-stack slot, box result into result register.
EmitCreateIteratorResult(true);
- EmitUnwindBeforeReturn();
- EmitReturnSequence();
+ EmitUnwindAndReturn();
break;
}
@@ -4678,15 +4676,6 @@ void FullCodeGenerator::PushFunctionArgumentForContextAllocation() {
void FullCodeGenerator::EnterFinallyBlock() {
DCHECK(!result_register().is(a1));
- // Store result register while executing finally block.
- __ push(result_register());
- // Cook return address in link register to stack (smi encoded Code* delta).
- __ Dsubu(a1, ra, Operand(masm_->CodeObject()));
- __ SmiTag(a1);
-
- // Store result register while executing finally block.
- __ push(a1);
-
// Store pending message while executing finally block.
ExternalReference pending_message_obj =
ExternalReference::address_of_pending_message_obj(isolate());
@@ -4706,16 +4695,6 @@ void FullCodeGenerator::ExitFinallyBlock() {
ExternalReference::address_of_pending_message_obj(isolate());
__ li(at, Operand(pending_message_obj));
__ sd(a1, MemOperand(at));
-
- // Restore result register from stack.
- __ pop(a1);
-
- // Uncook return address and return.
- __ pop(result_register());
-
- __ SmiUntag(a1);
- __ Daddu(at, a1, Operand(masm_->CodeObject()));
- __ Jump(at);
}
@@ -4735,6 +4714,31 @@ void FullCodeGenerator::EmitLoadStoreICSlot(FeedbackVectorSlot slot) {
Operand(SmiFromSlot(slot)));
}
+void FullCodeGenerator::DeferredCommands::EmitCommands() {
+ __ Pop(result_register()); // Restore the accumulator.
+ __ Pop(a1); // Get the token.
+ for (DeferredCommand cmd : commands_) {
+ Label skip;
+ __ li(at, Operand(Smi::FromInt(cmd.token)));
+ __ Branch(&skip, ne, a1, Operand(at));
+ switch (cmd.command) {
+ case kReturn:
+ codegen_->EmitUnwindAndReturn();
+ break;
+ case kThrow:
+ __ Push(result_register());
+ __ CallRuntime(Runtime::kReThrow);
+ break;
+ case kContinue:
+ codegen_->EmitContinue(cmd.target);
+ break;
+ case kBreak:
+ codegen_->EmitBreak(cmd.target);
+ break;
+ }
+ __ bind(&skip);
+ }
+}
#undef __
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698