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 18 matching lines...) Expand all Loading... |
29 CHECK_EQ(Heap::meta_map(), map->map()); | 29 CHECK_EQ(Heap::meta_map(), map->map()); |
30 CHECK_EQ(type, map->instance_type()); | 30 CHECK_EQ(type, map->instance_type()); |
31 CHECK_EQ(instance_size, map->instance_size()); | 31 CHECK_EQ(instance_size, map->instance_size()); |
32 } | 32 } |
33 | 33 |
34 | 34 |
35 TEST(HeapMaps) { | 35 TEST(HeapMaps) { |
36 InitializeVM(); | 36 InitializeVM(); |
37 CheckMap(Heap::meta_map(), MAP_TYPE, Map::kSize); | 37 CheckMap(Heap::meta_map(), MAP_TYPE, Map::kSize); |
38 CheckMap(Heap::heap_number_map(), HEAP_NUMBER_TYPE, HeapNumber::kSize); | 38 CheckMap(Heap::heap_number_map(), HEAP_NUMBER_TYPE, HeapNumber::kSize); |
39 CheckMap(Heap::fixed_array_map(), FIXED_ARRAY_TYPE, Array::kAlignedSize); | 39 CheckMap(Heap::fixed_array_map(), FIXED_ARRAY_TYPE, FixedArray::kHeaderSize); |
40 CheckMap(Heap::long_string_map(), LONG_STRING_TYPE, | 40 CheckMap(Heap::long_string_map(), LONG_STRING_TYPE, |
41 SeqTwoByteString::kAlignedSize); | 41 SeqTwoByteString::kAlignedSize); |
42 } | 42 } |
43 | 43 |
44 | 44 |
45 static void CheckOddball(Object* obj, const char* string) { | 45 static void CheckOddball(Object* obj, const char* string) { |
46 CHECK(obj->IsOddball()); | 46 CHECK(obj->IsOddball()); |
47 #ifndef V8_HOST_ARCH_64_BIT | 47 #ifndef V8_HOST_ARCH_64_BIT |
48 // TODO(X64): Reenable when native builtins work. | 48 // TODO(X64): Reenable when native builtins work. |
49 bool exc; | 49 bool exc; |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 objs[next_objs_index++] = | 789 objs[next_objs_index++] = |
790 Factory::NewStringFromAscii(CStrVector(str), TENURED); | 790 Factory::NewStringFromAscii(CStrVector(str), TENURED); |
791 delete[] str; | 791 delete[] str; |
792 | 792 |
793 // Add a Map object to look for. | 793 // Add a Map object to look for. |
794 objs[next_objs_index++] = Handle<Map>(HeapObject::cast(*objs[0])->map()); | 794 objs[next_objs_index++] = Handle<Map>(HeapObject::cast(*objs[0])->map()); |
795 | 795 |
796 CHECK_EQ(objs_count, next_objs_index); | 796 CHECK_EQ(objs_count, next_objs_index); |
797 CHECK_EQ(objs_count, ObjectsFoundInHeap(objs, objs_count)); | 797 CHECK_EQ(objs_count, ObjectsFoundInHeap(objs, objs_count)); |
798 } | 798 } |
OLD | NEW |