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 6342: Specialized string equality based on representation (Closed)
Patch Set: Created 12 years, 2 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
« src/objects.h ('K') | « src/runtime.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 20 matching lines...) Expand all
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::kHeaderSize); 39 CheckMap(Heap::fixed_array_map(), FIXED_ARRAY_TYPE, Array::kHeaderSize);
40 CheckMap(Heap::long_string_map(), LONG_STRING_TYPE, 40 CheckMap(Heap::long_string_map(), LONG_STRING_TYPE,
41 TwoByteString::kHeaderSize); 41 SeqTwoByteString::kHeaderSize);
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 bool exc; 47 bool exc;
48 Object* print_string = *Execution::ToString(Handle<Object>(obj), &exc); 48 Object* print_string = *Execution::ToString(Handle<Object>(obj), &exc);
49 CHECK(String::cast(print_string)->IsEqualTo(CStrVector(string))); 49 CHECK(String::cast(print_string)->IsEqualTo(CStrVector(string)));
50 } 50 }
51 51
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 objs[next_objs_index++] = 770 objs[next_objs_index++] =
771 Factory::NewStringFromAscii(CStrVector(str), TENURED); 771 Factory::NewStringFromAscii(CStrVector(str), TENURED);
772 delete[] str; 772 delete[] str;
773 773
774 // Add a Map object to look for. 774 // Add a Map object to look for.
775 objs[next_objs_index++] = Handle<Map>(HeapObject::cast(*objs[0])->map()); 775 objs[next_objs_index++] = Handle<Map>(HeapObject::cast(*objs[0])->map());
776 776
777 CHECK_EQ(objs_count, next_objs_index); 777 CHECK_EQ(objs_count, next_objs_index);
778 CHECK_EQ(objs_count, ObjectsFoundInHeap(objs, objs_count)); 778 CHECK_EQ(objs_count, ObjectsFoundInHeap(objs, objs_count));
779 } 779 }
OLDNEW
« src/objects.h ('K') | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698