Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: test/cctest/test-heap.cc

Issue 9452002: Ensure that executable pages are properly guarded. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 2
3 #include <stdlib.h> 3 #include <stdlib.h>
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #include "execution.h" 7 #include "execution.h"
8 #include "factory.h" 8 #include "factory.h"
9 #include "macro-assembler.h" 9 #include "macro-assembler.h"
10 #include "global-handles.h" 10 #include "global-handles.h"
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 objs[next_objs_index++] = FACTORY->NewJSArray(10); 813 objs[next_objs_index++] = FACTORY->NewJSArray(10);
814 objs[next_objs_index++] = FACTORY->NewJSArray(10, FAST_ELEMENTS, TENURED); 814 objs[next_objs_index++] = FACTORY->NewJSArray(10, FAST_ELEMENTS, TENURED);
815 815
816 // Allocate a small string to OLD_DATA_SPACE and NEW_SPACE 816 // Allocate a small string to OLD_DATA_SPACE and NEW_SPACE
817 objs[next_objs_index++] = 817 objs[next_objs_index++] =
818 FACTORY->NewStringFromAscii(CStrVector("abcdefghij")); 818 FACTORY->NewStringFromAscii(CStrVector("abcdefghij"));
819 objs[next_objs_index++] = 819 objs[next_objs_index++] =
820 FACTORY->NewStringFromAscii(CStrVector("abcdefghij"), TENURED); 820 FACTORY->NewStringFromAscii(CStrVector("abcdefghij"), TENURED);
821 821
822 // Allocate a large string (for large object space). 822 // Allocate a large string (for large object space).
823 int large_size = HEAP->MaxObjectSizeInPagedSpace() + 1; 823 int large_size = Page::kMaxNonCodeHeapObjectSize + 1;
824 char* str = new char[large_size]; 824 char* str = new char[large_size];
825 for (int i = 0; i < large_size - 1; ++i) str[i] = 'a'; 825 for (int i = 0; i < large_size - 1; ++i) str[i] = 'a';
826 str[large_size - 1] = '\0'; 826 str[large_size - 1] = '\0';
827 objs[next_objs_index++] = 827 objs[next_objs_index++] =
828 FACTORY->NewStringFromAscii(CStrVector(str), TENURED); 828 FACTORY->NewStringFromAscii(CStrVector(str), TENURED);
829 delete[] str; 829 delete[] str;
830 830
831 // Add a Map object to look for. 831 // Add a Map object to look for.
832 objs[next_objs_index++] = Handle<Map>(HeapObject::cast(*objs[0])->map()); 832 objs[next_objs_index++] = Handle<Map>(HeapObject::cast(*objs[0])->map());
833 833
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 // clearing correctly records slots in prototype transition array. 1590 // clearing correctly records slots in prototype transition array.
1591 i::FLAG_always_compact = true; 1591 i::FLAG_always_compact = true;
1592 Handle<Map> map(baseObject->map()); 1592 Handle<Map> map(baseObject->map());
1593 CHECK(!space->LastPage()->Contains(map->prototype_transitions()->address())); 1593 CHECK(!space->LastPage()->Contains(map->prototype_transitions()->address()));
1594 CHECK(space->LastPage()->Contains(prototype->address())); 1594 CHECK(space->LastPage()->Contains(prototype->address()));
1595 baseObject->SetPrototype(*prototype, false)->ToObjectChecked(); 1595 baseObject->SetPrototype(*prototype, false)->ToObjectChecked();
1596 CHECK(map->GetPrototypeTransition(*prototype)->IsMap()); 1596 CHECK(map->GetPrototypeTransition(*prototype)->IsMap());
1597 HEAP->CollectAllGarbage(Heap::kNoGCFlags); 1597 HEAP->CollectAllGarbage(Heap::kNoGCFlags);
1598 CHECK(map->GetPrototypeTransition(*prototype)->IsMap()); 1598 CHECK(map->GetPrototypeTransition(*prototype)->IsMap());
1599 } 1599 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698