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

Side by Side Diff: test/cctest/test-heap.cc

Issue 1235002: Allow empty handles to escape handle scopes. (Closed)
Patch Set: Created 10 years, 9 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
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 2
3 #include <stdlib.h> 3 #include <stdlib.h>
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #include "execution.h" 7 #include "execution.h"
8 #include "factory.h" 8 #include "factory.h"
9 #include "macro-assembler.h" 9 #include "macro-assembler.h"
10 #include "global-handles.h" 10 #include "global-handles.h"
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 objs[next_objs_index++] = 802 objs[next_objs_index++] =
803 Factory::NewStringFromAscii(CStrVector(str), TENURED); 803 Factory::NewStringFromAscii(CStrVector(str), TENURED);
804 delete[] str; 804 delete[] str;
805 805
806 // Add a Map object to look for. 806 // Add a Map object to look for.
807 objs[next_objs_index++] = Handle<Map>(HeapObject::cast(*objs[0])->map()); 807 objs[next_objs_index++] = Handle<Map>(HeapObject::cast(*objs[0])->map());
808 808
809 CHECK_EQ(objs_count, next_objs_index); 809 CHECK_EQ(objs_count, next_objs_index);
810 CHECK_EQ(objs_count, ObjectsFoundInHeap(objs, objs_count)); 810 CHECK_EQ(objs_count, ObjectsFoundInHeap(objs, objs_count));
811 } 811 }
812
813
814 TEST(EmptyHandleEscapeFrom) {
815 InitializeVM();
816
817 v8::HandleScope scope;
818 Handle<JSObject> runaway;
819
820 {
821 v8::HandleScope nested;
822 Handle<JSObject> empty;
823 runaway = empty.EscapeFrom(&nested);
824 }
825
826 CHECK(runaway.is_null());
827 }
OLDNEW
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698