| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 // Force the creation of an initial map and set the code to | 147 // Force the creation of an initial map and set the code to |
| 148 // something empty. | 148 // something empty. |
| 149 factory->NewJSObject(function); | 149 factory->NewJSObject(function); |
| 150 function->ReplaceCode(CcTest::i_isolate()->builtins()->builtin( | 150 function->ReplaceCode(CcTest::i_isolate()->builtins()->builtin( |
| 151 Builtins::kEmptyFunction)); | 151 Builtins::kEmptyFunction)); |
| 152 // Patch the map to have an accessor for "get". | 152 // Patch the map to have an accessor for "get". |
| 153 Handle<Map> map(function->initial_map()); | 153 Handle<Map> map(function->initial_map()); |
| 154 Handle<DescriptorArray> instance_descriptors(map->instance_descriptors()); | 154 Handle<DescriptorArray> instance_descriptors(map->instance_descriptors()); |
| 155 DCHECK(instance_descriptors->IsEmpty()); | 155 DCHECK(instance_descriptors->IsEmpty()); |
| 156 | 156 |
| 157 PropertyAttributes attrs = static_cast<PropertyAttributes>(0); | 157 PropertyAttributes attrs = NONE; |
| 158 Handle<AccessorInfo> foreign = TestAccessorInfo(isolate, attrs); | 158 Handle<AccessorInfo> foreign = TestAccessorInfo(isolate, attrs); |
| 159 Map::EnsureDescriptorSlack(map, 1); | 159 Map::EnsureDescriptorSlack(map, 1); |
| 160 | 160 |
| 161 AccessorConstantDescriptor d(Handle<Name>(Name::cast(foreign->name())), | 161 AccessorConstantDescriptor d(Handle<Name>(Name::cast(foreign->name())), |
| 162 foreign, attrs); | 162 foreign, attrs); |
| 163 map->AppendDescriptor(&d); | 163 map->AppendDescriptor(&d); |
| 164 | 164 |
| 165 // Add the Foo constructor the global object. | 165 // Add the Foo constructor the global object. |
| 166 CHECK(env->Global() | 166 CHECK(env->Global() |
| 167 ->Set(env, v8::String::NewFromUtf8(CcTest::isolate(), "Foo", | 167 ->Set(env, v8::String::NewFromUtf8(CcTest::isolate(), "Foo", |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 code_range.FreeRawMemory(blocks[index].base, blocks[index].size); | 247 code_range.FreeRawMemory(blocks[index].base, blocks[index].size); |
| 248 current_allocated -= blocks[index].size; | 248 current_allocated -= blocks[index].size; |
| 249 if (index < blocks.length() - 1) { | 249 if (index < blocks.length() - 1) { |
| 250 blocks[index] = blocks.RemoveLast(); | 250 blocks[index] = blocks.RemoveLast(); |
| 251 } else { | 251 } else { |
| 252 blocks.RemoveLast(); | 252 blocks.RemoveLast(); |
| 253 } | 253 } |
| 254 } | 254 } |
| 255 } | 255 } |
| 256 } | 256 } |
| OLD | NEW |