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

Unified Diff: test/cctest/test-heap.cc

Issue 151163005: A64: Synchronize with r16356. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-global-handles.cc ('k') | test/cctest/test-javascript-a64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index 32cc4191616a99b5a27d162446f2704d1ad42c28..c38a121bb97b7d5d0d050b4039ecd5c2cf75327e 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -2115,6 +2115,78 @@ TEST(OptimizedAllocationAlwaysInNewSpace) {
}
+TEST(OptimizedPretenuringAllocationFolding) {
+ i::FLAG_allow_natives_syntax = true;
+ CcTest::InitializeVM();
+ if (!i::V8::UseCrankshaft() || i::FLAG_always_opt) return;
+ if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
+ v8::HandleScope scope(CcTest::isolate());
+ HEAP->SetNewSpaceHighPromotionModeActive(true);
+
+ v8::Local<v8::Value> res = CompileRun(
+ "function DataObject() {"
+ " this.a = 1.1;"
+ " this.b = [{}];"
+ " this.c = 1.2;"
+ " this.d = [{}];"
+ " this.e = 1.3;"
+ " this.f = [{}];"
+ "}"
+ "function f() {"
+ " return new DataObject();"
+ "};"
+ "f(); f(); f();"
+ "%OptimizeFunctionOnNextCall(f);"
+ "f();");
+
+ Handle<JSObject> o =
+ v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res));
+
+ CHECK(HEAP->InOldDataSpace(o->RawFastPropertyAt(0)));
+ CHECK(HEAP->InOldPointerSpace(o->RawFastPropertyAt(1)));
+ CHECK(HEAP->InOldDataSpace(o->RawFastPropertyAt(2)));
+ CHECK(HEAP->InOldPointerSpace(o->RawFastPropertyAt(3)));
+ CHECK(HEAP->InOldDataSpace(o->RawFastPropertyAt(4)));
+ CHECK(HEAP->InOldPointerSpace(o->RawFastPropertyAt(5)));
+}
+
+
+TEST(OptimizedPretenuringAllocationFoldingBlocks) {
+ i::FLAG_allow_natives_syntax = true;
+ CcTest::InitializeVM();
+ if (!i::V8::UseCrankshaft() || i::FLAG_always_opt) return;
+ if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
+ v8::HandleScope scope(CcTest::isolate());
+ HEAP->SetNewSpaceHighPromotionModeActive(true);
+
+ v8::Local<v8::Value> res = CompileRun(
+ "function DataObject() {"
+ " this.a = [{}];"
+ " this.b = [{}];"
+ " this.c = 1.1;"
+ " this.d = 1.2;"
+ " this.e = [{}];"
+ " this.f = 1.3;"
+ "}"
+ "function f() {"
+ " return new DataObject();"
+ "};"
+ "f(); f(); f();"
+ "%OptimizeFunctionOnNextCall(f);"
+ "f();");
+
+ Handle<JSObject> o =
+ v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res));
+
+ CHECK(HEAP->InOldPointerSpace(o->RawFastPropertyAt(0)));
+ CHECK(HEAP->InOldPointerSpace(o->RawFastPropertyAt(1)));
+ CHECK(HEAP->InOldDataSpace(o->RawFastPropertyAt(2)));
+ CHECK(HEAP->InOldDataSpace(o->RawFastPropertyAt(3)));
+ CHECK(HEAP->InOldPointerSpace(o->RawFastPropertyAt(4)));
+ CHECK(HEAP->InOldDataSpace(o->RawFastPropertyAt(5)));
+}
+
+
TEST(OptimizedPretenuringObjectArrayLiterals) {
i::FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
@@ -2826,7 +2898,7 @@ void ReleaseStackTraceDataTest(const char* source, const char* accessor) {
// to check whether the data is being released since the external string
// resource's callback is fired when the external string is GC'ed.
FLAG_use_ic = false; // ICs retain objects.
- FLAG_parallel_recompilation = false;
+ FLAG_concurrent_recompilation = false;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
SourceResource* resource = new SourceResource(i::StrDup(source));
« no previous file with comments | « test/cctest/test-global-handles.cc ('k') | test/cctest/test-javascript-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698