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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 MaybeObject* maybe_map; | 152 MaybeObject* maybe_map; |
153 do { | 153 do { |
154 maybe_map = heap->AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); | 154 maybe_map = heap->AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); |
155 } while (maybe_map->ToObject(&map)); | 155 } while (maybe_map->ToObject(&map)); |
156 heap->CollectGarbage(MAP_SPACE, "trigger 3"); | 156 heap->CollectGarbage(MAP_SPACE, "trigger 3"); |
157 heap->AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize)->ToObjectChecked(); | 157 heap->AllocateMap(JS_OBJECT_TYPE, JSObject::kHeaderSize)->ToObjectChecked(); |
158 | 158 |
159 { HandleScope scope(isolate); | 159 { HandleScope scope(isolate); |
160 // allocate a garbage | 160 // allocate a garbage |
161 Handle<String> func_name = factory->InternalizeUtf8String("theFunction"); | 161 Handle<String> func_name = factory->InternalizeUtf8String("theFunction"); |
162 Handle<JSFunction> function = factory->NewFunction( | 162 Handle<JSFunction> function = factory->NewFunctionWithPrototype( |
163 func_name, factory->undefined_value()); | 163 func_name, factory->undefined_value()); |
164 Handle<Map> initial_map = factory->NewMap( | 164 Handle<Map> initial_map = factory->NewMap( |
165 JS_OBJECT_TYPE, JSObject::kHeaderSize); | 165 JS_OBJECT_TYPE, JSObject::kHeaderSize); |
166 function->set_initial_map(*initial_map); | 166 function->set_initial_map(*initial_map); |
167 JSReceiver::SetProperty(global, func_name, function, NONE, SLOPPY).Check(); | 167 JSReceiver::SetProperty(global, func_name, function, NONE, SLOPPY).Check(); |
168 | 168 |
169 factory->NewJSObject(function); | 169 factory->NewJSObject(function); |
170 } | 170 } |
171 | 171 |
172 heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 4"); | 172 heap->CollectGarbage(OLD_POINTER_SPACE, "trigger 4"); |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 | 522 |
523 | 523 |
524 TEST(RegressJoinThreadsOnIsolateDeinit) { | 524 TEST(RegressJoinThreadsOnIsolateDeinit) { |
525 intptr_t size_limit = ShortLivingIsolate() * 2; | 525 intptr_t size_limit = ShortLivingIsolate() * 2; |
526 for (int i = 0; i < 10; i++) { | 526 for (int i = 0; i < 10; i++) { |
527 CHECK_GT(size_limit, ShortLivingIsolate()); | 527 CHECK_GT(size_limit, ShortLivingIsolate()); |
528 } | 528 } |
529 } | 529 } |
530 | 530 |
531 #endif // __linux__ and !USE_SIMULATOR | 531 #endif // __linux__ and !USE_SIMULATOR |
OLD | NEW |