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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 0, | 114 0, |
115 0 | 115 0 |
116 }; | 116 }; |
117 | 117 |
118 | 118 |
119 TEST(StressJS) { | 119 TEST(StressJS) { |
120 v8::Persistent<v8::Context> env = v8::Context::New(); | 120 v8::Persistent<v8::Context> env = v8::Context::New(); |
121 v8::HandleScope scope; | 121 v8::HandleScope scope; |
122 env->Enter(); | 122 env->Enter(); |
123 Handle<JSFunction> function = | 123 Handle<JSFunction> function = |
124 FACTORY->NewFunction(FACTORY->function_symbol(), FACTORY->null_value()); | 124 FACTORY->NewFunction(FACTORY->function_string(), FACTORY->null_value()); |
125 // Force the creation of an initial map and set the code to | 125 // Force the creation of an initial map and set the code to |
126 // something empty. | 126 // something empty. |
127 FACTORY->NewJSObject(function); | 127 FACTORY->NewJSObject(function); |
128 function->ReplaceCode(Isolate::Current()->builtins()->builtin( | 128 function->ReplaceCode(Isolate::Current()->builtins()->builtin( |
129 Builtins::kEmptyFunction)); | 129 Builtins::kEmptyFunction)); |
130 // Patch the map to have an accessor for "get". | 130 // Patch the map to have an accessor for "get". |
131 Handle<Map> map(function->initial_map()); | 131 Handle<Map> map(function->initial_map()); |
132 Handle<DescriptorArray> instance_descriptors(map->instance_descriptors()); | 132 Handle<DescriptorArray> instance_descriptors(map->instance_descriptors()); |
133 Handle<Foreign> foreign = FACTORY->NewForeign(&kDescriptor); | 133 Handle<Foreign> foreign = FACTORY->NewForeign(&kDescriptor); |
134 Handle<String> name = | 134 Handle<String> name = |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 blocks[index] = blocks.RemoveLast(); | 220 blocks[index] = blocks.RemoveLast(); |
221 } else { | 221 } else { |
222 blocks.RemoveLast(); | 222 blocks.RemoveLast(); |
223 } | 223 } |
224 } | 224 } |
225 } | 225 } |
226 | 226 |
227 code_range->TearDown(); | 227 code_range->TearDown(); |
228 delete code_range; | 228 delete code_range; |
229 } | 229 } |
OLD | NEW |