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

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

Issue 390833003: Remove PropertyAttributes from SetProperty (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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-object-observe.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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 do { 151 do {
152 allocation = heap->AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); 152 allocation = heap->AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
153 } while (!allocation.IsRetry()); 153 } while (!allocation.IsRetry());
154 heap->CollectGarbage(MAP_SPACE, "trigger 3"); 154 heap->CollectGarbage(MAP_SPACE, "trigger 3");
155 heap->AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize).ToObjectChecked(); 155 heap->AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize).ToObjectChecked();
156 156
157 { HandleScope scope(isolate); 157 { HandleScope scope(isolate);
158 // allocate a garbage 158 // allocate a garbage
159 Handle<String> func_name = factory->InternalizeUtf8String("theFunction"); 159 Handle<String> func_name = factory->InternalizeUtf8String("theFunction");
160 Handle<JSFunction> function = factory->NewFunction(func_name); 160 Handle<JSFunction> function = factory->NewFunction(func_name);
161 JSReceiver::SetProperty(global, func_name, function, NONE, SLOPPY).Check(); 161 JSReceiver::SetProperty(global, func_name, function, SLOPPY).Check();
162 162
163 factory->NewJSObject(function); 163 factory->NewJSObject(function);
164 } 164 }
165 165
166 heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 4"); 166 heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 4");
167 167
168 { HandleScope scope(isolate); 168 { HandleScope scope(isolate);
169 Handle<String> func_name = factory->InternalizeUtf8String("theFunction"); 169 Handle<String> func_name = factory->InternalizeUtf8String("theFunction");
170 CHECK(JSReceiver::HasOwnProperty(global, func_name)); 170 CHECK(JSReceiver::HasOwnProperty(global, func_name));
171 Handle<Object> func_value = 171 Handle<Object> func_value =
172 Object::GetProperty(global, func_name).ToHandleChecked(); 172 Object::GetProperty(global, func_name).ToHandleChecked();
173 CHECK(func_value->IsJSFunction()); 173 CHECK(func_value->IsJSFunction());
174 Handle<JSFunction> function = Handle<JSFunction>::cast(func_value); 174 Handle<JSFunction> function = Handle<JSFunction>::cast(func_value);
175 Handle<JSObject> obj = factory->NewJSObject(function); 175 Handle<JSObject> obj = factory->NewJSObject(function);
176 176
177 Handle<String> obj_name = factory->InternalizeUtf8String("theObject"); 177 Handle<String> obj_name = factory->InternalizeUtf8String("theObject");
178 JSReceiver::SetProperty(global, obj_name, obj, NONE, SLOPPY).Check(); 178 JSReceiver::SetProperty(global, obj_name, obj, SLOPPY).Check();
179 Handle<String> prop_name = factory->InternalizeUtf8String("theSlot"); 179 Handle<String> prop_name = factory->InternalizeUtf8String("theSlot");
180 Handle<Smi> twenty_three(Smi::FromInt(23), isolate); 180 Handle<Smi> twenty_three(Smi::FromInt(23), isolate);
181 JSReceiver::SetProperty(obj, prop_name, twenty_three, NONE, SLOPPY).Check(); 181 JSReceiver::SetProperty(obj, prop_name, twenty_three, SLOPPY).Check();
182 } 182 }
183 183
184 heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 5"); 184 heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 5");
185 185
186 { HandleScope scope(isolate); 186 { HandleScope scope(isolate);
187 Handle<String> obj_name = factory->InternalizeUtf8String("theObject"); 187 Handle<String> obj_name = factory->InternalizeUtf8String("theObject");
188 CHECK(JSReceiver::HasOwnProperty(global, obj_name)); 188 CHECK(JSReceiver::HasOwnProperty(global, obj_name));
189 Handle<Object> object = 189 Handle<Object> object =
190 Object::GetProperty(global, obj_name).ToHandleChecked(); 190 Object::GetProperty(global, obj_name).ToHandleChecked();
191 CHECK(object->IsJSObject()); 191 CHECK(object->IsJSObject());
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 492
493 493
494 TEST(RegressJoinThreadsOnIsolateDeinit) { 494 TEST(RegressJoinThreadsOnIsolateDeinit) {
495 intptr_t size_limit = ShortLivingIsolate() * 2; 495 intptr_t size_limit = ShortLivingIsolate() * 2;
496 for (int i = 0; i < 10; i++) { 496 for (int i = 0; i < 10; i++) {
497 CHECK_GT(size_limit, ShortLivingIsolate()); 497 CHECK_GT(size_limit, ShortLivingIsolate());
498 } 498 }
499 } 499 }
500 500
501 #endif // __linux__ and !USE_SIMULATOR 501 #endif // __linux__ and !USE_SIMULATOR
OLDNEW
« no previous file with comments | « test/cctest/test-heap.cc ('k') | test/cctest/test-object-observe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698