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

Side by Side Diff: src/arm/full-codegen-arm.cc

Issue 10540095: Reland r11753: Fix try..finally. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/assembler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4475 matching lines...) Expand 10 before | Expand all | Expand 10 after
4486 4486
4487 void FullCodeGenerator::EnterFinallyBlock() { 4487 void FullCodeGenerator::EnterFinallyBlock() {
4488 ASSERT(!result_register().is(r1)); 4488 ASSERT(!result_register().is(r1));
4489 // Store result register while executing finally block. 4489 // Store result register while executing finally block.
4490 __ push(result_register()); 4490 __ push(result_register());
4491 // Cook return address in link register to stack (smi encoded Code* delta) 4491 // Cook return address in link register to stack (smi encoded Code* delta)
4492 __ sub(r1, lr, Operand(masm_->CodeObject())); 4492 __ sub(r1, lr, Operand(masm_->CodeObject()));
4493 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); 4493 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize);
4494 STATIC_ASSERT(kSmiTag == 0); 4494 STATIC_ASSERT(kSmiTag == 0);
4495 __ add(r1, r1, Operand(r1)); // Convert to smi. 4495 __ add(r1, r1, Operand(r1)); // Convert to smi.
4496
4497 // Store result register while executing finally block.
4498 __ push(r1);
4499
4500 // Store pending message while executing finally block.
4501 ExternalReference pending_message_obj =
4502 ExternalReference::address_of_pending_message_obj(isolate());
4503 __ mov(ip, Operand(pending_message_obj));
4504 __ ldr(r1, MemOperand(ip));
4505 __ push(r1);
4506
4507 ExternalReference has_pending_message =
4508 ExternalReference::address_of_has_pending_message(isolate());
4509 __ mov(ip, Operand(has_pending_message));
4510 __ ldr(r1, MemOperand(ip));
4511 __ push(r1);
4512
4513 ExternalReference pending_message_script =
4514 ExternalReference::address_of_pending_message_script(isolate());
4515 __ mov(ip, Operand(pending_message_script));
4516 __ ldr(r1, MemOperand(ip));
4496 __ push(r1); 4517 __ push(r1);
4497 } 4518 }
4498 4519
4499 4520
4500 void FullCodeGenerator::ExitFinallyBlock() { 4521 void FullCodeGenerator::ExitFinallyBlock() {
4501 ASSERT(!result_register().is(r1)); 4522 ASSERT(!result_register().is(r1));
4523 // Restore pending message from stack.
4524 __ pop(r1);
4525 ExternalReference pending_message_script =
4526 ExternalReference::address_of_pending_message_script(isolate());
4527 __ mov(ip, Operand(pending_message_script));
4528 __ str(r1, MemOperand(ip));
4529
4530 __ pop(r1);
4531 ExternalReference has_pending_message =
4532 ExternalReference::address_of_has_pending_message(isolate());
4533 __ mov(ip, Operand(has_pending_message));
4534 __ str(r1, MemOperand(ip));
4535
4536 __ pop(r1);
4537 ExternalReference pending_message_obj =
4538 ExternalReference::address_of_pending_message_obj(isolate());
4539 __ mov(ip, Operand(pending_message_obj));
4540 __ str(r1, MemOperand(ip));
4541
4502 // Restore result register from stack. 4542 // Restore result register from stack.
4503 __ pop(r1); 4543 __ pop(r1);
4544
4504 // Uncook return address and return. 4545 // Uncook return address and return.
4505 __ pop(result_register()); 4546 __ pop(result_register());
4506 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); 4547 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize);
4507 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. 4548 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value.
4508 __ add(pc, r1, Operand(masm_->CodeObject())); 4549 __ add(pc, r1, Operand(masm_->CodeObject()));
4509 } 4550 }
4510 4551
4511 4552
4512 #undef __ 4553 #undef __
4513 4554
(...skipping 21 matching lines...) Expand all
4535 *context_length = 0; 4576 *context_length = 0;
4536 return previous_; 4577 return previous_;
4537 } 4578 }
4538 4579
4539 4580
4540 #undef __ 4581 #undef __
4541 4582
4542 } } // namespace v8::internal 4583 } } // namespace v8::internal
4543 4584
4544 #endif // V8_TARGET_ARCH_ARM 4585 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698