| 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 5299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5310 for (int i = 0; i < Heap::kStrongRootListLength; ++i) { | 5310 for (int i = 0; i < Heap::kStrongRootListLength; ++i) { |
| 5311 Heap::RootListIndex root_index = static_cast<Heap::RootListIndex>(i); | 5311 Heap::RootListIndex root_index = static_cast<Heap::RootListIndex>(i); |
| 5312 bool writable = Heap::RootCanBeWrittenAfterInitialization(root_index); | 5312 bool writable = Heap::RootCanBeWrittenAfterInitialization(root_index); |
| 5313 bool immortal = Heap::RootIsImmortalImmovable(root_index); | 5313 bool immortal = Heap::RootIsImmortalImmovable(root_index); |
| 5314 // A root value can be writable, immortal, or neither, but not both. | 5314 // A root value can be writable, immortal, or neither, but not both. |
| 5315 CHECK(!immortal || !writable); | 5315 CHECK(!immortal || !writable); |
| 5316 } | 5316 } |
| 5317 } | 5317 } |
| 5318 | 5318 |
| 5319 | 5319 |
| 5320 static void TestRightTrimFixedTypedArray(v8::ExternalArrayType type, | 5320 static void TestRightTrimFixedTypedArray(i::ExternalArrayType type, |
| 5321 int initial_length, | 5321 int initial_length, |
| 5322 int elements_to_trim) { | 5322 int elements_to_trim) { |
| 5323 v8::HandleScope scope(CcTest::isolate()); | 5323 v8::HandleScope scope(CcTest::isolate()); |
| 5324 Isolate* isolate = CcTest::i_isolate(); | 5324 Isolate* isolate = CcTest::i_isolate(); |
| 5325 Factory* factory = isolate->factory(); | 5325 Factory* factory = isolate->factory(); |
| 5326 Heap* heap = isolate->heap(); | 5326 Heap* heap = isolate->heap(); |
| 5327 | 5327 |
| 5328 Handle<FixedTypedArrayBase> array = | 5328 Handle<FixedTypedArrayBase> array = |
| 5329 factory->NewFixedTypedArray(initial_length, type); | 5329 factory->NewFixedTypedArray(initial_length, type); |
| 5330 int old_size = array->size(); | 5330 int old_size = array->size(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 5346 | 5346 |
| 5347 | 5347 |
| 5348 TEST(Regress472513) { | 5348 TEST(Regress472513) { |
| 5349 CcTest::InitializeVM(); | 5349 CcTest::InitializeVM(); |
| 5350 v8::HandleScope scope(CcTest::isolate()); | 5350 v8::HandleScope scope(CcTest::isolate()); |
| 5351 | 5351 |
| 5352 // The combination of type/initial_length/elements_to_trim triggered | 5352 // The combination of type/initial_length/elements_to_trim triggered |
| 5353 // typed array header smashing with free space filler (crbug/472513). | 5353 // typed array header smashing with free space filler (crbug/472513). |
| 5354 | 5354 |
| 5355 // 64-bit cases. | 5355 // 64-bit cases. |
| 5356 TestRightTrimFixedTypedArray(v8::kExternalUint8Array, 32, 6); | 5356 TestRightTrimFixedTypedArray(i::kExternalUint8Array, 32, 6); |
| 5357 TestRightTrimFixedTypedArray(v8::kExternalUint8Array, 32 - 7, 6); | 5357 TestRightTrimFixedTypedArray(i::kExternalUint8Array, 32 - 7, 6); |
| 5358 TestRightTrimFixedTypedArray(v8::kExternalUint16Array, 16, 6); | 5358 TestRightTrimFixedTypedArray(i::kExternalUint16Array, 16, 6); |
| 5359 TestRightTrimFixedTypedArray(v8::kExternalUint16Array, 16 - 3, 6); | 5359 TestRightTrimFixedTypedArray(i::kExternalUint16Array, 16 - 3, 6); |
| 5360 TestRightTrimFixedTypedArray(v8::kExternalUint32Array, 8, 6); | 5360 TestRightTrimFixedTypedArray(i::kExternalUint32Array, 8, 6); |
| 5361 TestRightTrimFixedTypedArray(v8::kExternalUint32Array, 8 - 1, 6); | 5361 TestRightTrimFixedTypedArray(i::kExternalUint32Array, 8 - 1, 6); |
| 5362 | 5362 |
| 5363 // 32-bit cases. | 5363 // 32-bit cases. |
| 5364 TestRightTrimFixedTypedArray(v8::kExternalUint8Array, 16, 3); | 5364 TestRightTrimFixedTypedArray(i::kExternalUint8Array, 16, 3); |
| 5365 TestRightTrimFixedTypedArray(v8::kExternalUint8Array, 16 - 3, 3); | 5365 TestRightTrimFixedTypedArray(i::kExternalUint8Array, 16 - 3, 3); |
| 5366 TestRightTrimFixedTypedArray(v8::kExternalUint16Array, 8, 3); | 5366 TestRightTrimFixedTypedArray(i::kExternalUint16Array, 8, 3); |
| 5367 TestRightTrimFixedTypedArray(v8::kExternalUint16Array, 8 - 1, 3); | 5367 TestRightTrimFixedTypedArray(i::kExternalUint16Array, 8 - 1, 3); |
| 5368 TestRightTrimFixedTypedArray(v8::kExternalUint32Array, 4, 3); | 5368 TestRightTrimFixedTypedArray(i::kExternalUint32Array, 4, 3); |
| 5369 } | 5369 } |
| OLD | NEW |