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 5685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5696 | 5696 |
5697 TEST(Regress388880) { | 5697 TEST(Regress388880) { |
5698 i::FLAG_expose_gc = true; | 5698 i::FLAG_expose_gc = true; |
5699 CcTest::InitializeVM(); | 5699 CcTest::InitializeVM(); |
5700 v8::HandleScope scope(CcTest::isolate()); | 5700 v8::HandleScope scope(CcTest::isolate()); |
5701 Isolate* isolate = CcTest::i_isolate(); | 5701 Isolate* isolate = CcTest::i_isolate(); |
5702 Factory* factory = isolate->factory(); | 5702 Factory* factory = isolate->factory(); |
5703 Heap* heap = isolate->heap(); | 5703 Heap* heap = isolate->heap(); |
5704 | 5704 |
5705 Handle<Map> map1 = Map::Create(isolate, 1); | 5705 Handle<Map> map1 = Map::Create(isolate, 1); |
| 5706 Handle<String> name = factory->NewStringFromStaticChars("foo"); |
| 5707 name = factory->InternalizeString(name); |
5706 Handle<Map> map2 = | 5708 Handle<Map> map2 = |
5707 Map::CopyWithField(map1, factory->NewStringFromStaticChars("foo"), | 5709 Map::CopyWithField(map1, name, FieldType::Any(isolate), NONE, |
5708 FieldType::Any(isolate), NONE, | |
5709 Representation::Tagged(), OMIT_TRANSITION) | 5710 Representation::Tagged(), OMIT_TRANSITION) |
5710 .ToHandleChecked(); | 5711 .ToHandleChecked(); |
5711 | 5712 |
5712 int desired_offset = Page::kPageSize - map1->instance_size(); | 5713 int desired_offset = Page::kPageSize - map1->instance_size(); |
5713 | 5714 |
5714 // Allocate padding objects in old pointer space so, that object allocated | 5715 // Allocate padding objects in old pointer space so, that object allocated |
5715 // afterwards would end at the end of the page. | 5716 // afterwards would end at the end of the page. |
5716 SimulateFullSpace(heap->old_space()); | 5717 SimulateFullSpace(heap->old_space()); |
5717 int padding_size = desired_offset - Page::kObjectStartOffset; | 5718 int padding_size = desired_offset - Page::kObjectStartOffset; |
5718 CreatePadding(heap, padding_size, TENURED); | 5719 CreatePadding(heap, padding_size, TENURED); |
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6525 byte_array->set(j, 0x31); | 6526 byte_array->set(j, 0x31); |
6526 } | 6527 } |
6527 } | 6528 } |
6528 // Re-enable old space expansion to avoid OOM crash. | 6529 // Re-enable old space expansion to avoid OOM crash. |
6529 heap->set_force_oom(false); | 6530 heap->set_force_oom(false); |
6530 heap->CollectGarbage(NEW_SPACE); | 6531 heap->CollectGarbage(NEW_SPACE); |
6531 } | 6532 } |
6532 | 6533 |
6533 } // namespace internal | 6534 } // namespace internal |
6534 } // namespace v8 | 6535 } // namespace v8 |
OLD | NEW |