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

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

Issue 10832365: Rename Context::global to Context::global_object, (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed Michael's comments. Created 8 years, 4 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-random.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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
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()->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 =
205 String::cast(HEAP->LookupAsciiSymbol("theFunction")->ToObjectChecked()); 205 String::cast(HEAP->LookupAsciiSymbol("theFunction")->ToObjectChecked());
206 CHECK(Isolate::Current()->context()->global()->HasLocalProperty(func_name)); 206 CHECK(Isolate::Current()->context()->global_object()->
207 Object* func_value = Isolate::Current()->context()->global()-> 207 HasLocalProperty(func_name));
208 Object* func_value = Isolate::Current()->context()->global_object()->
208 GetProperty(func_name)->ToObjectChecked(); 209 GetProperty(func_name)->ToObjectChecked();
209 CHECK(func_value->IsJSFunction()); 210 CHECK(func_value->IsJSFunction());
210 function = JSFunction::cast(func_value); 211 function = JSFunction::cast(func_value);
211 212
212 obj = JSObject::cast(HEAP->AllocateJSObject(function)->ToObjectChecked()); 213 obj = JSObject::cast(HEAP->AllocateJSObject(function)->ToObjectChecked());
213 String* obj_name = 214 String* obj_name =
214 String::cast(HEAP->LookupAsciiSymbol("theObject")->ToObjectChecked()); 215 String::cast(HEAP->LookupAsciiSymbol("theObject")->ToObjectChecked());
215 Isolate::Current()->context()->global()->SetProperty( 216 Isolate::Current()->context()->global_object()->SetProperty(
216 obj_name, obj, NONE, kNonStrictMode)->ToObjectChecked(); 217 obj_name, obj, NONE, kNonStrictMode)->ToObjectChecked();
217 String* prop_name = 218 String* prop_name =
218 String::cast(HEAP->LookupAsciiSymbol("theSlot")->ToObjectChecked()); 219 String::cast(HEAP->LookupAsciiSymbol("theSlot")->ToObjectChecked());
219 obj->SetProperty(prop_name, 220 obj->SetProperty(prop_name,
220 Smi::FromInt(23), 221 Smi::FromInt(23),
221 NONE, 222 NONE,
222 kNonStrictMode)->ToObjectChecked(); 223 kNonStrictMode)->ToObjectChecked();
223 224
224 HEAP->CollectGarbage(OLD_POINTER_SPACE); 225 HEAP->CollectGarbage(OLD_POINTER_SPACE);
225 226
226 obj_name = 227 obj_name =
227 String::cast(HEAP->LookupAsciiSymbol("theObject")->ToObjectChecked()); 228 String::cast(HEAP->LookupAsciiSymbol("theObject")->ToObjectChecked());
228 CHECK(Isolate::Current()->context()->global()->HasLocalProperty(obj_name)); 229 CHECK(Isolate::Current()->context()->global_object()->
229 CHECK(Isolate::Current()->context()->global()-> 230 HasLocalProperty(obj_name));
231 CHECK(Isolate::Current()->context()->global_object()->
230 GetProperty(obj_name)->ToObjectChecked()->IsJSObject()); 232 GetProperty(obj_name)->ToObjectChecked()->IsJSObject());
231 obj = JSObject::cast(Isolate::Current()->context()->global()-> 233 obj = JSObject::cast(Isolate::Current()->context()->global_object()->
232 GetProperty(obj_name)->ToObjectChecked()); 234 GetProperty(obj_name)->ToObjectChecked());
233 prop_name = 235 prop_name =
234 String::cast(HEAP->LookupAsciiSymbol("theSlot")->ToObjectChecked()); 236 String::cast(HEAP->LookupAsciiSymbol("theSlot")->ToObjectChecked());
235 CHECK(obj->GetProperty(prop_name) == Smi::FromInt(23)); 237 CHECK(obj->GetProperty(prop_name) == Smi::FromInt(23));
236 } 238 }
237 239
238 240
239 // TODO(1600): compaction of map space is temporary removed from GC. 241 // TODO(1600): compaction of map space is temporary removed from GC.
240 #if 0 242 #if 0
241 static Handle<Map> CreateMap() { 243 static Handle<Map> CreateMap() {
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 if (v8::internal::Snapshot::IsEnabled()) { 547 if (v8::internal::Snapshot::IsEnabled()) {
546 CHECK_LE(delta, 2600 * 1024); // 2484. 548 CHECK_LE(delta, 2600 * 1024); // 2484.
547 } else { 549 } else {
548 CHECK_LE(delta, 2950 * 1024); // 2844 550 CHECK_LE(delta, 2950 * 1024); // 2844
549 } 551 }
550 } 552 }
551 } 553 }
552 } 554 }
553 555
554 #endif // __linux__ and !USE_SIMULATOR 556 #endif // __linux__ and !USE_SIMULATOR
OLDNEW
« no previous file with comments | « test/cctest/test-heap.cc ('k') | test/cctest/test-random.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698