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

Side by Side Diff: test/cctest/test-alloc.cc

Issue 268063008: Replace NewFunctionWithPrototype(name, prototype) by NewFunction(name) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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 | « src/runtime.cc ('k') | test/cctest/test-heap.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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 attributes); 130 attributes);
131 } 131 }
132 132
133 133
134 TEST(StressJS) { 134 TEST(StressJS) {
135 Isolate* isolate = CcTest::i_isolate(); 135 Isolate* isolate = CcTest::i_isolate();
136 Factory* factory = isolate->factory(); 136 Factory* factory = isolate->factory();
137 v8::HandleScope scope(CcTest::isolate()); 137 v8::HandleScope scope(CcTest::isolate());
138 v8::Handle<v8::Context> env = v8::Context::New(CcTest::isolate()); 138 v8::Handle<v8::Context> env = v8::Context::New(CcTest::isolate());
139 env->Enter(); 139 env->Enter();
140 Handle<JSFunction> function = factory->NewFunctionWithPrototype( 140 Handle<JSFunction> function = factory->NewFunction(
141 factory->function_string(), factory->null_value()); 141 factory->function_string());
142 // Force the creation of an initial map and set the code to 142 // Force the creation of an initial map and set the code to
143 // something empty. 143 // something empty.
144 factory->NewJSObject(function); 144 factory->NewJSObject(function);
145 function->ReplaceCode(CcTest::i_isolate()->builtins()->builtin( 145 function->ReplaceCode(CcTest::i_isolate()->builtins()->builtin(
146 Builtins::kEmptyFunction)); 146 Builtins::kEmptyFunction));
147 // Patch the map to have an accessor for "get". 147 // Patch the map to have an accessor for "get".
148 Handle<Map> map(function->initial_map()); 148 Handle<Map> map(function->initial_map());
149 Handle<DescriptorArray> instance_descriptors(map->instance_descriptors()); 149 Handle<DescriptorArray> instance_descriptors(map->instance_descriptors());
150 ASSERT(instance_descriptors->IsEmpty()); 150 ASSERT(instance_descriptors->IsEmpty());
151 151
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 if (index < blocks.length() - 1) { 230 if (index < blocks.length() - 1) {
231 blocks[index] = blocks.RemoveLast(); 231 blocks[index] = blocks.RemoveLast();
232 } else { 232 } else {
233 blocks.RemoveLast(); 233 blocks.RemoveLast();
234 } 234 }
235 } 235 }
236 } 236 }
237 237
238 code_range.TearDown(); 238 code_range.TearDown();
239 } 239 }
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698