OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |