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

Unified Diff: runtime/vm/allocation_test.cc

Issue 108383007: Replaces LongJump with LongJumpScope. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 12 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 | « no previous file | runtime/vm/class_finalizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/allocation_test.cc
===================================================================
--- runtime/vm/allocation_test.cc (revision 31435)
+++ runtime/vm/allocation_test.cc (working copy)
@@ -84,7 +84,7 @@
}
-static void StackAllocatedLongJumpHelper(int* ptr, LongJump* jump) {
+static void StackAllocatedLongJumpHelper(int* ptr, LongJumpScope* jump) {
TestValueObject stacked(ptr);
EXPECT_EQ(2, *ptr);
*ptr = 3;
@@ -97,7 +97,7 @@
TEST_CASE(StackAllocatedLongJump) {
- LongJump jump;
+ LongJumpScope jump;
int data = 1;
if (setjmp(*jump.Set()) == 0) {
StackAllocatedLongJumpHelper(&data, &jump);
@@ -131,7 +131,7 @@
}
-static void StackedStackResourceLongJumpHelper(int* ptr, LongJump* jump) {
+static void StackedStackResourceLongJumpHelper(int* ptr, LongJumpScope* jump) {
TestStackedStackResource stacked(ptr);
EXPECT_EQ(4, *ptr);
*ptr = 5;
@@ -143,7 +143,7 @@
}
-static void StackResourceLongJumpHelper(int* ptr, LongJump* jump) {
+static void StackResourceLongJumpHelper(int* ptr, LongJumpScope* jump) {
TestStackResource stacked(ptr);
EXPECT_EQ(2, *ptr);
*ptr = 3;
@@ -153,13 +153,17 @@
TEST_CASE(StackResourceLongJump) {
- LongJump jump;
- int data = 1;
- if (setjmp(*jump.Set()) == 0) {
- StackResourceLongJumpHelper(&data, &jump);
- UNREACHABLE();
+ LongJumpScope* base = Isolate::Current()->long_jump_base();
+ {
+ LongJumpScope jump;
+ int data = 1;
+ if (setjmp(*jump.Set()) == 0) {
+ StackResourceLongJumpHelper(&data, &jump);
+ UNREACHABLE();
+ }
+ EXPECT_EQ(7, data);
}
- EXPECT_EQ(7, data);
+ ASSERT(base == Isolate::Current()->long_jump_base());
}
} // namespace dart
« no previous file with comments | « no previous file | runtime/vm/class_finalizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698