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

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

Issue 391693002: In-object double fields unboxing (for 64-bit only). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebasing Created 6 years, 1 month 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/cctest.gyp ('k') | test/cctest/test-unboxed-doubles.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 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 2458 matching lines...) Expand 10 before | Expand all | Expand 10 after
2469 2469
2470 v8::Local<v8::Value> res = CompileRun(source.start()); 2470 v8::Local<v8::Value> res = CompileRun(source.start());
2471 2471
2472 Handle<JSObject> o = 2472 Handle<JSObject> o =
2473 v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res)); 2473 v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(res));
2474 2474
2475 CHECK(CcTest::heap()->InOldPointerSpace(*o)); 2475 CHECK(CcTest::heap()->InOldPointerSpace(*o));
2476 FieldIndex idx1 = FieldIndex::ForPropertyIndex(o->map(), 0); 2476 FieldIndex idx1 = FieldIndex::ForPropertyIndex(o->map(), 0);
2477 FieldIndex idx2 = FieldIndex::ForPropertyIndex(o->map(), 1); 2477 FieldIndex idx2 = FieldIndex::ForPropertyIndex(o->map(), 1);
2478 CHECK(CcTest::heap()->InOldPointerSpace(o->RawFastPropertyAt(idx1))); 2478 CHECK(CcTest::heap()->InOldPointerSpace(o->RawFastPropertyAt(idx1)));
2479 CHECK(CcTest::heap()->InOldDataSpace(o->RawFastPropertyAt(idx2))); 2479 if (!o->IsUnboxedDoubleField(idx2)) {
2480 CHECK(CcTest::heap()->InOldDataSpace(o->RawFastPropertyAt(idx2)));
2481 } else {
2482 CHECK_EQ(1.1, o->RawFastDoublePropertyAt(idx2));
2483 }
2480 2484
2481 JSObject* inner_object = 2485 JSObject* inner_object =
2482 reinterpret_cast<JSObject*>(o->RawFastPropertyAt(idx1)); 2486 reinterpret_cast<JSObject*>(o->RawFastPropertyAt(idx1));
2483 CHECK(CcTest::heap()->InOldPointerSpace(inner_object)); 2487 CHECK(CcTest::heap()->InOldPointerSpace(inner_object));
2484 CHECK(CcTest::heap()->InOldDataSpace(inner_object->RawFastPropertyAt(idx1))); 2488 if (!inner_object->IsUnboxedDoubleField(idx1)) {
2489 CHECK(
2490 CcTest::heap()->InOldDataSpace(inner_object->RawFastPropertyAt(idx1)));
2491 } else {
2492 CHECK_EQ(2.2, inner_object->RawFastDoublePropertyAt(idx1));
2493 }
2485 CHECK(CcTest::heap()->InOldPointerSpace( 2494 CHECK(CcTest::heap()->InOldPointerSpace(
2486 inner_object->RawFastPropertyAt(idx2))); 2495 inner_object->RawFastPropertyAt(idx2)));
2487 } 2496 }
2488 2497
2489 2498
2490 TEST(OptimizedPretenuringDoubleArrayProperties) { 2499 TEST(OptimizedPretenuringDoubleArrayProperties) {
2491 i::FLAG_allow_natives_syntax = true; 2500 i::FLAG_allow_natives_syntax = true;
2492 i::FLAG_expose_gc = true; 2501 i::FLAG_expose_gc = true;
2493 CcTest::InitializeVM(); 2502 CcTest::InitializeVM();
2494 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; 2503 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return;
(...skipping 2250 matching lines...) Expand 10 before | Expand all | Expand 10 after
4745 #ifdef DEBUG 4754 #ifdef DEBUG
4746 TEST(PathTracer) { 4755 TEST(PathTracer) {
4747 CcTest::InitializeVM(); 4756 CcTest::InitializeVM();
4748 v8::HandleScope scope(CcTest::isolate()); 4757 v8::HandleScope scope(CcTest::isolate());
4749 4758
4750 v8::Local<v8::Value> result = CompileRun("'abc'"); 4759 v8::Local<v8::Value> result = CompileRun("'abc'");
4751 Handle<Object> o = v8::Utils::OpenHandle(*result); 4760 Handle<Object> o = v8::Utils::OpenHandle(*result);
4752 CcTest::i_isolate()->heap()->TracePathToObject(*o); 4761 CcTest::i_isolate()->heap()->TracePathToObject(*o);
4753 } 4762 }
4754 #endif // DEBUG 4763 #endif // DEBUG
OLDNEW
« no previous file with comments | « test/cctest/cctest.gyp ('k') | test/cctest/test-unboxed-doubles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698