| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 heap->AllocateByteArray(100, TENURED).ToObjectChecked(); | 59 heap->AllocateByteArray(100, TENURED).ToObjectChecked(); |
| 60 | 60 |
| 61 // Old pointer space. | 61 // Old pointer space. |
| 62 SimulateFullSpace(heap->old_pointer_space()); | 62 SimulateFullSpace(heap->old_pointer_space()); |
| 63 heap->AllocateFixedArray(10000, TENURED).ToObjectChecked(); | 63 heap->AllocateFixedArray(10000, TENURED).ToObjectChecked(); |
| 64 | 64 |
| 65 // Large object space. | 65 // Large object space. |
| 66 static const int kLargeObjectSpaceFillerLength = 300000; | 66 static const int kLargeObjectSpaceFillerLength = 300000; |
| 67 static const int kLargeObjectSpaceFillerSize = FixedArray::SizeFor( | 67 static const int kLargeObjectSpaceFillerSize = FixedArray::SizeFor( |
| 68 kLargeObjectSpaceFillerLength); | 68 kLargeObjectSpaceFillerLength); |
| 69 ASSERT(kLargeObjectSpaceFillerSize > heap->old_pointer_space()->AreaSize()); | 69 DCHECK(kLargeObjectSpaceFillerSize > heap->old_pointer_space()->AreaSize()); |
| 70 while (heap->OldGenerationSpaceAvailable() > kLargeObjectSpaceFillerSize) { | 70 while (heap->OldGenerationSpaceAvailable() > kLargeObjectSpaceFillerSize) { |
| 71 heap->AllocateFixedArray( | 71 heap->AllocateFixedArray( |
| 72 kLargeObjectSpaceFillerLength, TENURED).ToObjectChecked(); | 72 kLargeObjectSpaceFillerLength, TENURED).ToObjectChecked(); |
| 73 } | 73 } |
| 74 heap->AllocateFixedArray( | 74 heap->AllocateFixedArray( |
| 75 kLargeObjectSpaceFillerLength, TENURED).ToObjectChecked(); | 75 kLargeObjectSpaceFillerLength, TENURED).ToObjectChecked(); |
| 76 | 76 |
| 77 // Map space. | 77 // Map space. |
| 78 SimulateFullSpace(heap->map_space()); | 78 SimulateFullSpace(heap->map_space()); |
| 79 int instance_size = JSObject::kHeaderSize; | 79 int instance_size = JSObject::kHeaderSize; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 Handle<JSFunction> function = factory->NewFunction( | 139 Handle<JSFunction> function = factory->NewFunction( |
| 140 factory->function_string()); | 140 factory->function_string()); |
| 141 // Force the creation of an initial map and set the code to | 141 // Force the creation of an initial map and set the code to |
| 142 // something empty. | 142 // something empty. |
| 143 factory->NewJSObject(function); | 143 factory->NewJSObject(function); |
| 144 function->ReplaceCode(CcTest::i_isolate()->builtins()->builtin( | 144 function->ReplaceCode(CcTest::i_isolate()->builtins()->builtin( |
| 145 Builtins::kEmptyFunction)); | 145 Builtins::kEmptyFunction)); |
| 146 // Patch the map to have an accessor for "get". | 146 // Patch the map to have an accessor for "get". |
| 147 Handle<Map> map(function->initial_map()); | 147 Handle<Map> map(function->initial_map()); |
| 148 Handle<DescriptorArray> instance_descriptors(map->instance_descriptors()); | 148 Handle<DescriptorArray> instance_descriptors(map->instance_descriptors()); |
| 149 ASSERT(instance_descriptors->IsEmpty()); | 149 DCHECK(instance_descriptors->IsEmpty()); |
| 150 | 150 |
| 151 PropertyAttributes attrs = static_cast<PropertyAttributes>(0); | 151 PropertyAttributes attrs = static_cast<PropertyAttributes>(0); |
| 152 Handle<AccessorInfo> foreign = TestAccessorInfo(isolate, attrs); | 152 Handle<AccessorInfo> foreign = TestAccessorInfo(isolate, attrs); |
| 153 Map::EnsureDescriptorSlack(map, 1); | 153 Map::EnsureDescriptorSlack(map, 1); |
| 154 | 154 |
| 155 CallbacksDescriptor d(Handle<Name>(Name::cast(foreign->name())), | 155 CallbacksDescriptor d(Handle<Name>(Name::cast(foreign->name())), |
| 156 foreign, attrs); | 156 foreign, attrs); |
| 157 map->AppendDescriptor(&d); | 157 map->AppendDescriptor(&d); |
| 158 | 158 |
| 159 // Add the Foo constructor the global object. | 159 // Add the Foo constructor the global object. |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 if (index < blocks.length() - 1) { | 229 if (index < blocks.length() - 1) { |
| 230 blocks[index] = blocks.RemoveLast(); | 230 blocks[index] = blocks.RemoveLast(); |
| 231 } else { | 231 } else { |
| 232 blocks.RemoveLast(); | 232 blocks.RemoveLast(); |
| 233 } | 233 } |
| 234 } | 234 } |
| 235 } | 235 } |
| 236 | 236 |
| 237 code_range.TearDown(); | 237 code_range.TearDown(); |
| 238 } | 238 } |
| OLD | NEW |