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

Unified Diff: src/arm/fast-codegen-arm.cc

Issue 491077: Fast codegen: Implement with. (Closed)
Patch Set: Created 11 years 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 | src/compiler.cc » ('j') | src/fast-codegen.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/fast-codegen-arm.cc
diff --git a/src/arm/fast-codegen-arm.cc b/src/arm/fast-codegen-arm.cc
index 55fe9d0c7090074c9dec72bb428ea5131350cb1e..c32bd65d44d941ef9aaf0383b33c958141dd0469 100644
--- a/src/arm/fast-codegen-arm.cc
+++ b/src/arm/fast-codegen-arm.cc
@@ -1690,28 +1690,44 @@ void FastCodeGenerator::VisitThisFunction(ThisFunction* expr) {
Register FastCodeGenerator::result_register() { return r0; }
+
+Register FastCodeGenerator::context_register() { return cp; }
+
+
+void FastCodeGenerator::StoreFrameField(int frame_offset, Register value) {
+ ASSERT_EQ(POINTER_SIZE_ALIGN(frame_offset), frame_offset);
+ __ str(value, MemOperand(fp, frame_offset));
+}
+
+
+void FastCodeGenerator::LoadContextField(Register dst, int context_index) {
+ __ ldr(dst,
+ MemOperand(context_register(), Context::SlotOffset(context_index)));
+}
+
+
// ----------------------------------------------------------------------------
// Non-local control flow support.
void FastCodeGenerator::EnterFinallyBlock() {
ASSERT(!result_register().is(r1));
+ // Store result register while executing finally block.
+ __ push(result_register());
// Cook return address in link register to stack (smi encoded Code* delta)
__ sub(r1, lr, Operand(masm_->CodeObject()));
ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize);
ASSERT_EQ(0, kSmiTag);
__ add(r1, r1, Operand(r1)); // Convert to smi.
__ push(r1);
- // Store result register while executing finally block.
- __ push(result_register());
}
void FastCodeGenerator::ExitFinallyBlock() {
ASSERT(!result_register().is(r1));
// Restore result register from stack.
- __ pop(result_register());
- // Uncook return address and return.
__ pop(r1);
+ // Uncook return address and return.
+ __ pop(result_register());
ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize);
__ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value.
__ add(pc, r1, Operand(masm_->CodeObject()));
« no previous file with comments | « no previous file | src/compiler.cc » ('j') | src/fast-codegen.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698