| OLD | NEW | 
|---|
| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 160     Handle<JSFunction> function = factory->NewFunction(func_name); | 160     Handle<JSFunction> function = factory->NewFunction(func_name); | 
| 161     JSReceiver::SetProperty(global, func_name, function, 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     v8::Maybe<bool> maybe = JSReceiver::HasOwnProperty(global, func_name); | 
|  | 171     CHECK(maybe.has_value); | 
|  | 172     CHECK(maybe.value); | 
| 171     Handle<Object> func_value = | 173     Handle<Object> func_value = | 
| 172         Object::GetProperty(global, func_name).ToHandleChecked(); | 174         Object::GetProperty(global, func_name).ToHandleChecked(); | 
| 173     CHECK(func_value->IsJSFunction()); | 175     CHECK(func_value->IsJSFunction()); | 
| 174     Handle<JSFunction> function = Handle<JSFunction>::cast(func_value); | 176     Handle<JSFunction> function = Handle<JSFunction>::cast(func_value); | 
| 175     Handle<JSObject> obj = factory->NewJSObject(function); | 177     Handle<JSObject> obj = factory->NewJSObject(function); | 
| 176 | 178 | 
| 177     Handle<String> obj_name = factory->InternalizeUtf8String("theObject"); | 179     Handle<String> obj_name = factory->InternalizeUtf8String("theObject"); | 
| 178     JSReceiver::SetProperty(global, obj_name, obj, SLOPPY).Check(); | 180     JSReceiver::SetProperty(global, obj_name, obj, SLOPPY).Check(); | 
| 179     Handle<String> prop_name = factory->InternalizeUtf8String("theSlot"); | 181     Handle<String> prop_name = factory->InternalizeUtf8String("theSlot"); | 
| 180     Handle<Smi> twenty_three(Smi::FromInt(23), isolate); | 182     Handle<Smi> twenty_three(Smi::FromInt(23), isolate); | 
| 181     JSReceiver::SetProperty(obj, prop_name, twenty_three, SLOPPY).Check(); | 183     JSReceiver::SetProperty(obj, prop_name, twenty_three, SLOPPY).Check(); | 
| 182   } | 184   } | 
| 183 | 185 | 
| 184   heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 5"); | 186   heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 5"); | 
| 185 | 187 | 
| 186   { HandleScope scope(isolate); | 188   { HandleScope scope(isolate); | 
| 187     Handle<String> obj_name = factory->InternalizeUtf8String("theObject"); | 189     Handle<String> obj_name = factory->InternalizeUtf8String("theObject"); | 
| 188     CHECK(JSReceiver::HasOwnProperty(global, obj_name)); | 190     v8::Maybe<bool> maybe = JSReceiver::HasOwnProperty(global, obj_name); | 
|  | 191     CHECK(maybe.has_value); | 
|  | 192     CHECK(maybe.value); | 
| 189     Handle<Object> object = | 193     Handle<Object> object = | 
| 190         Object::GetProperty(global, obj_name).ToHandleChecked(); | 194         Object::GetProperty(global, obj_name).ToHandleChecked(); | 
| 191     CHECK(object->IsJSObject()); | 195     CHECK(object->IsJSObject()); | 
| 192     Handle<String> prop_name = factory->InternalizeUtf8String("theSlot"); | 196     Handle<String> prop_name = factory->InternalizeUtf8String("theSlot"); | 
| 193     CHECK_EQ(*Object::GetProperty(object, prop_name).ToHandleChecked(), | 197     CHECK_EQ(*Object::GetProperty(object, prop_name).ToHandleChecked(), | 
| 194              Smi::FromInt(23)); | 198              Smi::FromInt(23)); | 
| 195   } | 199   } | 
| 196 } | 200 } | 
| 197 | 201 | 
| 198 | 202 | 
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 492 | 496 | 
| 493 | 497 | 
| 494 TEST(RegressJoinThreadsOnIsolateDeinit) { | 498 TEST(RegressJoinThreadsOnIsolateDeinit) { | 
| 495   intptr_t size_limit = ShortLivingIsolate() * 2; | 499   intptr_t size_limit = ShortLivingIsolate() * 2; | 
| 496   for (int i = 0; i < 10; i++) { | 500   for (int i = 0; i < 10; i++) { | 
| 497     CHECK_GT(size_limit, ShortLivingIsolate()); | 501     CHECK_GT(size_limit, ShortLivingIsolate()); | 
| 498   } | 502   } | 
| 499 } | 503 } | 
| 500 | 504 | 
| 501 #endif  // __linux__ and !USE_SIMULATOR | 505 #endif  // __linux__ and !USE_SIMULATOR | 
| OLD | NEW | 
|---|