Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: test/cctest/test-mark-compact.cc

Issue 238773009: Set code on the SharedFunctionInfo before creating the function. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-heap.cc ('k') | test/cctest/test-weakmaps.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « test/cctest/test-heap.cc ('k') | test/cctest/test-weakmaps.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698