| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 JSReceiver::SetProperty(global, func_name, function, NONE, SLOPPY).Check(); | 166 JSReceiver::SetProperty(global, func_name, function, NONE, SLOPPY).Check(); |
| 167 | 167 |
| 168 factory->NewJSObject(function); | 168 factory->NewJSObject(function); |
| 169 } | 169 } |
| 170 | 170 |
| 171 heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 4"); | 171 heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 4"); |
| 172 | 172 |
| 173 { HandleScope scope(isolate); | 173 { HandleScope scope(isolate); |
| 174 Handle<String> func_name = factory->InternalizeUtf8String("theFunction"); | 174 Handle<String> func_name = factory->InternalizeUtf8String("theFunction"); |
| 175 CHECK(JSReceiver::HasLocalProperty(global, func_name)); | 175 CHECK(JSReceiver::HasLocalProperty(global, func_name)); |
| 176 Handle<Object> func_value = Object::GetProperty(global, func_name); | 176 Handle<Object> func_value = |
| 177 Object::GetProperty(global, func_name).ToHandleChecked(); |
| 177 CHECK(func_value->IsJSFunction()); | 178 CHECK(func_value->IsJSFunction()); |
| 178 Handle<JSFunction> function = Handle<JSFunction>::cast(func_value); | 179 Handle<JSFunction> function = Handle<JSFunction>::cast(func_value); |
| 179 Handle<JSObject> obj = factory->NewJSObject(function); | 180 Handle<JSObject> obj = factory->NewJSObject(function); |
| 180 | 181 |
| 181 Handle<String> obj_name = factory->InternalizeUtf8String("theObject"); | 182 Handle<String> obj_name = factory->InternalizeUtf8String("theObject"); |
| 182 JSReceiver::SetProperty(global, obj_name, obj, NONE, SLOPPY).Check(); | 183 JSReceiver::SetProperty(global, obj_name, obj, NONE, SLOPPY).Check(); |
| 183 Handle<String> prop_name = factory->InternalizeUtf8String("theSlot"); | 184 Handle<String> prop_name = factory->InternalizeUtf8String("theSlot"); |
| 184 Handle<Smi> twenty_three(Smi::FromInt(23), isolate); | 185 Handle<Smi> twenty_three(Smi::FromInt(23), isolate); |
| 185 JSReceiver::SetProperty(obj, prop_name, twenty_three, NONE, SLOPPY).Check(); | 186 JSReceiver::SetProperty(obj, prop_name, twenty_three, NONE, SLOPPY).Check(); |
| 186 } | 187 } |
| 187 | 188 |
| 188 heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 5"); | 189 heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 5"); |
| 189 | 190 |
| 190 { HandleScope scope(isolate); | 191 { HandleScope scope(isolate); |
| 191 Handle<String> obj_name = factory->InternalizeUtf8String("theObject"); | 192 Handle<String> obj_name = factory->InternalizeUtf8String("theObject"); |
| 192 CHECK(JSReceiver::HasLocalProperty(global, obj_name)); | 193 CHECK(JSReceiver::HasLocalProperty(global, obj_name)); |
| 193 Handle<Object> object = Object::GetProperty(global, obj_name); | 194 Handle<Object> object = |
| 195 Object::GetProperty(global, obj_name).ToHandleChecked(); |
| 194 CHECK(object->IsJSObject()); | 196 CHECK(object->IsJSObject()); |
| 195 Handle<String> prop_name = factory->InternalizeUtf8String("theSlot"); | 197 Handle<String> prop_name = factory->InternalizeUtf8String("theSlot"); |
| 196 CHECK_EQ(*Object::GetProperty(object, prop_name), Smi::FromInt(23)); | 198 CHECK_EQ(*Object::GetProperty(object, prop_name).ToHandleChecked(), |
| 199 Smi::FromInt(23)); |
| 197 } | 200 } |
| 198 } | 201 } |
| 199 | 202 |
| 200 | 203 |
| 201 // TODO(1600): compaction of map space is temporary removed from GC. | 204 // TODO(1600): compaction of map space is temporary removed from GC. |
| 202 #if 0 | 205 #if 0 |
| 203 static Handle<Map> CreateMap(Isolate* isolate) { | 206 static Handle<Map> CreateMap(Isolate* isolate) { |
| 204 return isolate->factory()->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); | 207 return isolate->factory()->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); |
| 205 } | 208 } |
| 206 | 209 |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 | 527 |
| 525 | 528 |
| 526 TEST(RegressJoinThreadsOnIsolateDeinit) { | 529 TEST(RegressJoinThreadsOnIsolateDeinit) { |
| 527 intptr_t size_limit = ShortLivingIsolate() * 2; | 530 intptr_t size_limit = ShortLivingIsolate() * 2; |
| 528 for (int i = 0; i < 10; i++) { | 531 for (int i = 0; i < 10; i++) { |
| 529 CHECK_GT(size_limit, ShortLivingIsolate()); | 532 CHECK_GT(size_limit, ShortLivingIsolate()); |
| 530 } | 533 } |
| 531 } | 534 } |
| 532 | 535 |
| 533 #endif // __linux__ and !USE_SIMULATOR | 536 #endif // __linux__ and !USE_SIMULATOR |
| OLD | NEW |