| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 heap->CollectGarbage(MAP_SPACE, "trigger 3"); | 155 heap->CollectGarbage(MAP_SPACE, "trigger 3"); |
| 156 mapp = heap->AllocateMap(JS_OBJECT_TYPE, | 156 mapp = heap->AllocateMap(JS_OBJECT_TYPE, |
| 157 JSObject::kHeaderSize)->ToObjectChecked(); | 157 JSObject::kHeaderSize)->ToObjectChecked(); |
| 158 | 158 |
| 159 // allocate a garbage | 159 // allocate a garbage |
| 160 String* func_name = String::cast( | 160 String* func_name = String::cast( |
| 161 heap->InternalizeUtf8String("theFunction")->ToObjectChecked()); | 161 heap->InternalizeUtf8String("theFunction")->ToObjectChecked()); |
| 162 SharedFunctionInfo* function_share = SharedFunctionInfo::cast( | 162 SharedFunctionInfo* function_share = SharedFunctionInfo::cast( |
| 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->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, kSloppyMode); | 173 global, handle(func_name), handle(function), NONE, SLOPPY); |
| 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( | 190 JSReceiver::SetProperty(global, handle(obj_name), handle(obj), NONE, SLOPPY); |
| 191 global, handle(obj_name), handle(obj), NONE, kSloppyMode); | |
| 192 String* prop_name = | 191 String* prop_name = |
| 193 String::cast(heap->InternalizeUtf8String("theSlot")->ToObjectChecked()); | 192 String::cast(heap->InternalizeUtf8String("theSlot")->ToObjectChecked()); |
| 194 Handle<Smi> twenty_three(Smi::FromInt(23), isolate); | 193 Handle<Smi> twenty_three(Smi::FromInt(23), isolate); |
| 195 JSReceiver::SetProperty( | 194 JSReceiver::SetProperty( |
| 196 handle(obj), handle(prop_name), twenty_three, NONE, kSloppyMode); | 195 handle(obj), handle(prop_name), twenty_three, NONE, SLOPPY); |
| 197 | 196 |
| 198 heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 5"); | 197 heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 5"); |
| 199 | 198 |
| 200 obj_name = | 199 obj_name = |
| 201 String::cast(heap->InternalizeUtf8String("theObject")->ToObjectChecked()); | 200 String::cast(heap->InternalizeUtf8String("theObject")->ToObjectChecked()); |
| 202 CHECK(JSReceiver::HasLocalProperty(global, handle(obj_name))); | 201 CHECK(JSReceiver::HasLocalProperty(global, handle(obj_name))); |
| 203 CHECK(isolate->context()->global_object()-> | 202 CHECK(isolate->context()->global_object()-> |
| 204 GetProperty(obj_name)->ToObjectChecked()->IsJSObject()); | 203 GetProperty(obj_name)->ToObjectChecked()->IsJSObject()); |
| 205 obj = JSObject::cast(isolate->context()->global_object()-> | 204 obj = JSObject::cast(isolate->context()->global_object()-> |
| 206 GetProperty(obj_name)->ToObjectChecked()); | 205 GetProperty(obj_name)->ToObjectChecked()); |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 | 535 |
| 537 | 536 |
| 538 TEST(RegressJoinThreadsOnIsolateDeinit) { | 537 TEST(RegressJoinThreadsOnIsolateDeinit) { |
| 539 intptr_t size_limit = ShortLivingIsolate() * 2; | 538 intptr_t size_limit = ShortLivingIsolate() * 2; |
| 540 for (int i = 0; i < 10; i++) { | 539 for (int i = 0; i < 10; i++) { |
| 541 CHECK_GT(size_limit, ShortLivingIsolate()); | 540 CHECK_GT(size_limit, ShortLivingIsolate()); |
| 542 } | 541 } |
| 543 } | 542 } |
| 544 | 543 |
| 545 #endif // __linux__ and !USE_SIMULATOR | 544 #endif // __linux__ and !USE_SIMULATOR |
| OLD | NEW |