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

Unified Diff: src/full-codegen/mips/full-codegen-mips.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/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/mips/full-codegen-mips.cc
diff --git a/src/full-codegen/mips/full-codegen-mips.cc b/src/full-codegen/mips/full-codegen-mips.cc
index a9402564f64d7e70b6a845adba2a96735fb36b98..b94f7250fd236e375e6b7b43988aa0712c3bee49 100644
--- a/src/full-codegen/mips/full-codegen-mips.cc
+++ b/src/full-codegen/mips/full-codegen-mips.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
@@ -1942,8 +1942,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());
@@ -1971,8 +1970,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;
}
@@ -4664,17 +4662,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).
- __ Subu(a1, ra, Operand(masm_->CodeObject()));
- DCHECK_EQ(1, kSmiTagSize + kSmiShiftSize);
- STATIC_ASSERT(0 == kSmiTag);
- __ Addu(a1, a1, Operand(a1)); // Convert to smi.
-
- // 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());
@@ -4694,16 +4681,6 @@ void FullCodeGenerator::ExitFinallyBlock() {
ExternalReference::address_of_pending_message_obj(isolate());
__ li(at, Operand(pending_message_obj));
__ sw(a1, MemOperand(at));
-
- // Restore result register from stack.
- __ pop(a1);
-
- // Uncook return address and return.
- __ pop(result_register());
- DCHECK_EQ(1, kSmiTagSize + kSmiShiftSize);
- __ sra(a1, a1, 1); // Un-smi-tag value.
- __ Addu(at, a1, Operand(masm_->CodeObject()));
- __ Jump(at);
}
@@ -4723,6 +4700,32 @@ void FullCodeGenerator::EmitLoadStoreICSlot(FeedbackVectorSlot slot) {
Operand(SmiFromSlot(slot)));
}
+void FullCodeGenerator::DeferredCommands::EmitCommands() {
+ DCHECK(!result_register().is(a1));
+ __ 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/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698