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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 } |
OLD | NEW |