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

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

Issue 9537011: Merge r10809 into 3.7 branch (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.7/
Patch Set: Created 8 years, 9 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
« no previous file with comments | « test/cctest/test-alloc.cc ('k') | test/cctest/test-mark-compact.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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, TENURED); 814 objs[next_objs_index++] = FACTORY->NewJSArray(10, 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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
1498 v8::HandleScope scope; 1498 v8::HandleScope scope;
1499 v8::Handle<v8::Object> global = v8::Context::GetCurrent()->Global(); 1499 v8::Handle<v8::Object> global = v8::Context::GetCurrent()->Global();
1500 v8::Handle<v8::Function> g = 1500 v8::Handle<v8::Function> g =
1501 v8::Handle<v8::Function>::Cast(global->Get(v8_str("g"))); 1501 v8::Handle<v8::Function>::Cast(global->Get(v8_str("g")));
1502 g->Call(global, 0, NULL); 1502 g->Call(global, 0, NULL);
1503 } 1503 }
1504 1504
1505 HEAP->incremental_marking()->set_should_hurry(true); 1505 HEAP->incremental_marking()->set_should_hurry(true);
1506 HEAP->CollectGarbage(OLD_POINTER_SPACE); 1506 HEAP->CollectGarbage(OLD_POINTER_SPACE);
1507 } 1507 }
OLDNEW
« no previous file with comments | « test/cctest/test-alloc.cc ('k') | test/cctest/test-mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698