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

Side by Side Diff: test/cctest/test-mark-compact.cc

Issue 12210083: Renamed "symbols" to "internalized strings" throughout the code base, (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed Yang's comments Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-heap.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 Object* mapp; 175 Object* mapp;
176 MaybeObject* maybe_mapp; 176 MaybeObject* maybe_mapp;
177 do { 177 do {
178 maybe_mapp = HEAP->AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); 178 maybe_mapp = HEAP->AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
179 } while (maybe_mapp->ToObject(&mapp)); 179 } while (maybe_mapp->ToObject(&mapp));
180 HEAP->CollectGarbage(MAP_SPACE); 180 HEAP->CollectGarbage(MAP_SPACE);
181 mapp = HEAP->AllocateMap(JS_OBJECT_TYPE, 181 mapp = HEAP->AllocateMap(JS_OBJECT_TYPE,
182 JSObject::kHeaderSize)->ToObjectChecked(); 182 JSObject::kHeaderSize)->ToObjectChecked();
183 183
184 // allocate a garbage 184 // allocate a garbage
185 String* func_name = 185 String* func_name = String::cast(
186 String::cast(HEAP->LookupUtf8Symbol("theFunction")->ToObjectChecked()); 186 HEAP->InternalizeUtf8String("theFunction")->ToObjectChecked());
187 SharedFunctionInfo* function_share = SharedFunctionInfo::cast( 187 SharedFunctionInfo* function_share = SharedFunctionInfo::cast(
188 HEAP->AllocateSharedFunctionInfo(func_name)->ToObjectChecked()); 188 HEAP->AllocateSharedFunctionInfo(func_name)->ToObjectChecked());
189 JSFunction* function = JSFunction::cast( 189 JSFunction* function = JSFunction::cast(
190 HEAP->AllocateFunction(*Isolate::Current()->function_map(), 190 HEAP->AllocateFunction(*Isolate::Current()->function_map(),
191 function_share, 191 function_share,
192 HEAP->undefined_value())->ToObjectChecked()); 192 HEAP->undefined_value())->ToObjectChecked());
193 Map* initial_map = 193 Map* initial_map =
194 Map::cast(HEAP->AllocateMap(JS_OBJECT_TYPE, 194 Map::cast(HEAP->AllocateMap(JS_OBJECT_TYPE,
195 JSObject::kHeaderSize)->ToObjectChecked()); 195 JSObject::kHeaderSize)->ToObjectChecked());
196 function->set_initial_map(initial_map); 196 function->set_initial_map(initial_map);
197 Isolate::Current()->context()->global_object()->SetProperty( 197 Isolate::Current()->context()->global_object()->SetProperty(
198 func_name, function, NONE, kNonStrictMode)->ToObjectChecked(); 198 func_name, function, NONE, kNonStrictMode)->ToObjectChecked();
199 199
200 JSObject* obj = JSObject::cast( 200 JSObject* obj = JSObject::cast(
201 HEAP->AllocateJSObject(function)->ToObjectChecked()); 201 HEAP->AllocateJSObject(function)->ToObjectChecked());
202 HEAP->CollectGarbage(OLD_POINTER_SPACE); 202 HEAP->CollectGarbage(OLD_POINTER_SPACE);
203 203
204 func_name = 204 func_name = String::cast(
205 String::cast(HEAP->LookupUtf8Symbol("theFunction")->ToObjectChecked()); 205 HEAP->InternalizeUtf8String("theFunction")->ToObjectChecked());
206 CHECK(Isolate::Current()->context()->global_object()-> 206 CHECK(Isolate::Current()->context()->global_object()->
207 HasLocalProperty(func_name)); 207 HasLocalProperty(func_name));
208 Object* func_value = Isolate::Current()->context()->global_object()-> 208 Object* func_value = Isolate::Current()->context()->global_object()->
209 GetProperty(func_name)->ToObjectChecked(); 209 GetProperty(func_name)->ToObjectChecked();
210 CHECK(func_value->IsJSFunction()); 210 CHECK(func_value->IsJSFunction());
211 function = JSFunction::cast(func_value); 211 function = JSFunction::cast(func_value);
212 212
213 obj = JSObject::cast(HEAP->AllocateJSObject(function)->ToObjectChecked()); 213 obj = JSObject::cast(HEAP->AllocateJSObject(function)->ToObjectChecked());
214 String* obj_name = 214 String* obj_name =
215 String::cast(HEAP->LookupUtf8Symbol("theObject")->ToObjectChecked()); 215 String::cast(HEAP->InternalizeUtf8String("theObject")->ToObjectChecked());
216 Isolate::Current()->context()->global_object()->SetProperty( 216 Isolate::Current()->context()->global_object()->SetProperty(
217 obj_name, obj, NONE, kNonStrictMode)->ToObjectChecked(); 217 obj_name, obj, NONE, kNonStrictMode)->ToObjectChecked();
218 String* prop_name = 218 String* prop_name =
219 String::cast(HEAP->LookupUtf8Symbol("theSlot")->ToObjectChecked()); 219 String::cast(HEAP->InternalizeUtf8String("theSlot")->ToObjectChecked());
220 obj->SetProperty(prop_name, 220 obj->SetProperty(prop_name,
221 Smi::FromInt(23), 221 Smi::FromInt(23),
222 NONE, 222 NONE,
223 kNonStrictMode)->ToObjectChecked(); 223 kNonStrictMode)->ToObjectChecked();
224 224
225 HEAP->CollectGarbage(OLD_POINTER_SPACE); 225 HEAP->CollectGarbage(OLD_POINTER_SPACE);
226 226
227 obj_name = 227 obj_name =
228 String::cast(HEAP->LookupUtf8Symbol("theObject")->ToObjectChecked()); 228 String::cast(HEAP->InternalizeUtf8String("theObject")->ToObjectChecked());
229 CHECK(Isolate::Current()->context()->global_object()-> 229 CHECK(Isolate::Current()->context()->global_object()->
230 HasLocalProperty(obj_name)); 230 HasLocalProperty(obj_name));
231 CHECK(Isolate::Current()->context()->global_object()-> 231 CHECK(Isolate::Current()->context()->global_object()->
232 GetProperty(obj_name)->ToObjectChecked()->IsJSObject()); 232 GetProperty(obj_name)->ToObjectChecked()->IsJSObject());
233 obj = JSObject::cast(Isolate::Current()->context()->global_object()-> 233 obj = JSObject::cast(Isolate::Current()->context()->global_object()->
234 GetProperty(obj_name)->ToObjectChecked()); 234 GetProperty(obj_name)->ToObjectChecked());
235 prop_name = 235 prop_name =
236 String::cast(HEAP->LookupUtf8Symbol("theSlot")->ToObjectChecked()); 236 String::cast(HEAP->InternalizeUtf8String("theSlot")->ToObjectChecked());
237 CHECK(obj->GetProperty(prop_name) == Smi::FromInt(23)); 237 CHECK(obj->GetProperty(prop_name) == Smi::FromInt(23));
238 } 238 }
239 239
240 240
241 // TODO(1600): compaction of map space is temporary removed from GC. 241 // TODO(1600): compaction of map space is temporary removed from GC.
242 #if 0 242 #if 0
243 static Handle<Map> CreateMap() { 243 static Handle<Map> CreateMap() {
244 return FACTORY->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); 244 return FACTORY->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
245 } 245 }
246 246
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 if (v8::internal::Snapshot::IsEnabled()) { 564 if (v8::internal::Snapshot::IsEnabled()) {
565 CHECK_LE(delta, 2600 * 1024); 565 CHECK_LE(delta, 2600 * 1024);
566 } else { 566 } else {
567 CHECK_LE(delta, 3100 * 1024); 567 CHECK_LE(delta, 3100 * 1024);
568 } 568 }
569 } 569 }
570 } 570 }
571 } 571 }
572 572
573 #endif // __linux__ and !USE_SIMULATOR 573 #endif // __linux__ and !USE_SIMULATOR
OLDNEW
« no previous file with comments | « test/cctest/test-heap.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698