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

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

Issue 10537078: Preserve error message during finally block in 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 4490 matching lines...) Expand 10 before | Expand all | Expand 10 after
4501 // Restore result register from stack. 4501 // Restore result register from stack.
4502 __ pop(r1); 4502 __ pop(r1);
4503 // Uncook return address and return. 4503 // Uncook return address and return.
4504 __ pop(result_register()); 4504 __ pop(result_register());
4505 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); 4505 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize);
4506 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. 4506 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value.
4507 __ add(pc, r1, Operand(masm_->CodeObject())); 4507 __ add(pc, r1, Operand(masm_->CodeObject()));
4508 } 4508 }
4509 4509
4510 4510
4511 void FullCodeGenerator::SavePendingMessage() {
4512 ASSERT(!result_register().is(r1));
4513 // Store pending message while executing finally block upon exception.
4514 ExternalReference pending_message_obj =
4515 ExternalReference::address_of_pending_message_obj(isolate());
4516 __ mov(ip, Operand(pending_message_obj));
4517 __ ldr(r1, MemOperand(ip));
4518 __ push(r1);
4519 }
4520
4521
4522 void FullCodeGenerator::RestorePendingMessage() {
4523 ASSERT(!result_register().is(r1));
4524 // Restore pending message if cleared by executing the finally block.
4525 __ pop(r1);
4526 ExternalReference pending_message_obj =
4527 ExternalReference::address_of_pending_message_obj(isolate());
4528 __ mov(ip, Operand(pending_message_obj));
4529 __ str(r1, MemOperand(ip));
4530 }
4531
4532
4511 #undef __ 4533 #undef __
4512 4534
4513 #define __ ACCESS_MASM(masm()) 4535 #define __ ACCESS_MASM(masm())
4514 4536
4515 FullCodeGenerator::NestedStatement* FullCodeGenerator::TryFinally::Exit( 4537 FullCodeGenerator::NestedStatement* FullCodeGenerator::TryFinally::Exit(
4516 int* stack_depth, 4538 int* stack_depth,
4517 int* context_length) { 4539 int* context_length) {
4518 // The macros used here must preserve the result register. 4540 // The macros used here must preserve the result register.
4519 4541
4520 // Because the handler block contains the context of the finally 4542 // Because the handler block contains the context of the finally
(...skipping 13 matching lines...) Expand all
4534 *context_length = 0; 4556 *context_length = 0;
4535 return previous_; 4557 return previous_;
4536 } 4558 }
4537 4559
4538 4560
4539 #undef __ 4561 #undef __
4540 4562
4541 } } // namespace v8::internal 4563 } } // namespace v8::internal
4542 4564
4543 #endif // V8_TARGET_ARCH_ARM 4565 #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