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

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

Issue 225283005: Return MaybeHandle from SetProperty. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 6 years, 8 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') | 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 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 heap->AllocateSharedFunctionInfo(func_name)->ToObjectChecked()); 163 heap->AllocateSharedFunctionInfo(func_name)->ToObjectChecked());
164 JSFunction* function = JSFunction::cast( 164 JSFunction* function = JSFunction::cast(
165 heap->AllocateFunction(*isolate->sloppy_function_map(), 165 heap->AllocateFunction(*isolate->sloppy_function_map(),
166 function_share, 166 function_share,
167 heap->undefined_value())->ToObjectChecked()); 167 heap->undefined_value())->ToObjectChecked());
168 Map* initial_map = 168 Map* initial_map =
169 Map::cast(heap->AllocateMap(JS_OBJECT_TYPE, 169 Map::cast(heap->AllocateMap(JS_OBJECT_TYPE,
170 JSObject::kHeaderSize)->ToObjectChecked()); 170 JSObject::kHeaderSize)->ToObjectChecked());
171 function->set_initial_map(initial_map); 171 function->set_initial_map(initial_map);
172 JSReceiver::SetProperty( 172 JSReceiver::SetProperty(
173 global, handle(func_name), handle(function), NONE, SLOPPY); 173 global, handle(func_name), handle(function), NONE, SLOPPY).Assert();
174 174
175 JSObject* obj = JSObject::cast( 175 JSObject* obj = JSObject::cast(
176 heap->AllocateJSObject(function)->ToObjectChecked()); 176 heap->AllocateJSObject(function)->ToObjectChecked());
177 heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 4"); 177 heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 4");
178 178
179 func_name = String::cast( 179 func_name = String::cast(
180 heap->InternalizeUtf8String("theFunction")->ToObjectChecked()); 180 heap->InternalizeUtf8String("theFunction")->ToObjectChecked());
181 CHECK(JSReceiver::HasLocalProperty(global, handle(func_name))); 181 CHECK(JSReceiver::HasLocalProperty(global, handle(func_name)));
182 Object* func_value = isolate->context()->global_object()-> 182 Object* func_value = isolate->context()->global_object()->
183 GetProperty(func_name)->ToObjectChecked(); 183 GetProperty(func_name)->ToObjectChecked();
184 CHECK(func_value->IsJSFunction()); 184 CHECK(func_value->IsJSFunction());
185 function = JSFunction::cast(func_value); 185 function = JSFunction::cast(func_value);
186 186
187 obj = JSObject::cast(heap->AllocateJSObject(function)->ToObjectChecked()); 187 obj = JSObject::cast(heap->AllocateJSObject(function)->ToObjectChecked());
188 String* obj_name = 188 String* obj_name =
189 String::cast(heap->InternalizeUtf8String("theObject")->ToObjectChecked()); 189 String::cast(heap->InternalizeUtf8String("theObject")->ToObjectChecked());
190 JSReceiver::SetProperty(global, handle(obj_name), handle(obj), NONE, SLOPPY); 190 JSReceiver::SetProperty(
191 global, handle(obj_name), handle(obj), NONE, SLOPPY).Assert();
191 String* prop_name = 192 String* prop_name =
192 String::cast(heap->InternalizeUtf8String("theSlot")->ToObjectChecked()); 193 String::cast(heap->InternalizeUtf8String("theSlot")->ToObjectChecked());
193 Handle<Smi> twenty_three(Smi::FromInt(23), isolate); 194 Handle<Smi> twenty_three(Smi::FromInt(23), isolate);
194 JSReceiver::SetProperty( 195 JSReceiver::SetProperty(
195 handle(obj), handle(prop_name), twenty_three, NONE, SLOPPY); 196 handle(obj), handle(prop_name), twenty_three, NONE, SLOPPY).Assert();
196 197
197 heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 5"); 198 heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 5");
198 199
199 obj_name = 200 obj_name =
200 String::cast(heap->InternalizeUtf8String("theObject")->ToObjectChecked()); 201 String::cast(heap->InternalizeUtf8String("theObject")->ToObjectChecked());
201 CHECK(JSReceiver::HasLocalProperty(global, handle(obj_name))); 202 CHECK(JSReceiver::HasLocalProperty(global, handle(obj_name)));
202 CHECK(isolate->context()->global_object()-> 203 CHECK(isolate->context()->global_object()->
203 GetProperty(obj_name)->ToObjectChecked()->IsJSObject()); 204 GetProperty(obj_name)->ToObjectChecked()->IsJSObject());
204 obj = JSObject::cast(isolate->context()->global_object()-> 205 obj = JSObject::cast(isolate->context()->global_object()->
205 GetProperty(obj_name)->ToObjectChecked()); 206 GetProperty(obj_name)->ToObjectChecked());
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 536
536 537
537 TEST(RegressJoinThreadsOnIsolateDeinit) { 538 TEST(RegressJoinThreadsOnIsolateDeinit) {
538 intptr_t size_limit = ShortLivingIsolate() * 2; 539 intptr_t size_limit = ShortLivingIsolate() * 2;
539 for (int i = 0; i < 10; i++) { 540 for (int i = 0; i < 10; i++) {
540 CHECK_GT(size_limit, ShortLivingIsolate()); 541 CHECK_GT(size_limit, ShortLivingIsolate());
541 } 542 }
542 } 543 }
543 544
544 #endif // __linux__ and !USE_SIMULATOR 545 #endif // __linux__ and !USE_SIMULATOR
OLDNEW
« no previous file with comments | « test/cctest/test-heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698