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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // keep allocating maps until it fails | 149 // keep allocating maps until it fails |
150 do { | 150 do { |
151 allocation = heap->AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); | 151 allocation = heap->AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); |
152 } while (!allocation.IsRetry()); | 152 } while (!allocation.IsRetry()); |
153 heap->CollectGarbage(MAP_SPACE, "trigger 3"); | 153 heap->CollectGarbage(MAP_SPACE, "trigger 3"); |
154 heap->AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize).ToObjectChecked(); | 154 heap->AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize).ToObjectChecked(); |
155 | 155 |
156 { HandleScope scope(isolate); | 156 { HandleScope scope(isolate); |
157 // allocate a garbage | 157 // allocate a garbage |
158 Handle<String> func_name = factory->InternalizeUtf8String("theFunction"); | 158 Handle<String> func_name = factory->InternalizeUtf8String("theFunction"); |
159 Handle<JSFunction> function = factory->NewFunctionWithPrototype( | 159 Handle<JSFunction> function = factory->NewFunction(func_name); |
160 func_name, factory->undefined_value()); | |
161 Handle<Map> initial_map = factory->NewMap( | |
162 JS_OBJECT_TYPE, JSObject::kHeaderSize); | |
163 function->set_initial_map(*initial_map); | |
164 JSReceiver::SetProperty(global, func_name, function, NONE, SLOPPY).Check(); | 160 JSReceiver::SetProperty(global, func_name, function, NONE, SLOPPY).Check(); |
165 | 161 |
166 factory->NewJSObject(function); | 162 factory->NewJSObject(function); |
167 } | 163 } |
168 | 164 |
169 heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 4"); | 165 heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 4"); |
170 | 166 |
171 { HandleScope scope(isolate); | 167 { HandleScope scope(isolate); |
172 Handle<String> func_name = factory->InternalizeUtf8String("theFunction"); | 168 Handle<String> func_name = factory->InternalizeUtf8String("theFunction"); |
173 CHECK(JSReceiver::HasLocalProperty(global, func_name)); | 169 CHECK(JSReceiver::HasLocalProperty(global, func_name)); |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 | 491 |
496 | 492 |
497 TEST(RegressJoinThreadsOnIsolateDeinit) { | 493 TEST(RegressJoinThreadsOnIsolateDeinit) { |
498 intptr_t size_limit = ShortLivingIsolate() * 2; | 494 intptr_t size_limit = ShortLivingIsolate() * 2; |
499 for (int i = 0; i < 10; i++) { | 495 for (int i = 0; i < 10; i++) { |
500 CHECK_GT(size_limit, ShortLivingIsolate()); | 496 CHECK_GT(size_limit, ShortLivingIsolate()); |
501 } | 497 } |
502 } | 498 } |
503 | 499 |
504 #endif // __linux__ and !USE_SIMULATOR | 500 #endif // __linux__ and !USE_SIMULATOR |
OLD | NEW |