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 2458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 if (!o->IsUnboxedDoubleField(idx2)) { | 2479 CHECK(CcTest::heap()->InOldDataSpace(o->RawFastPropertyAt(idx2))); |
2480 CHECK(CcTest::heap()->InOldDataSpace(o->RawFastPropertyAt(idx2))); | |
2481 } else { | |
2482 CHECK_EQ(1.1, o->RawFastDoublePropertyAt(idx2)); | |
2483 } | |
2484 | 2480 |
2485 JSObject* inner_object = | 2481 JSObject* inner_object = |
2486 reinterpret_cast<JSObject*>(o->RawFastPropertyAt(idx1)); | 2482 reinterpret_cast<JSObject*>(o->RawFastPropertyAt(idx1)); |
2487 CHECK(CcTest::heap()->InOldPointerSpace(inner_object)); | 2483 CHECK(CcTest::heap()->InOldPointerSpace(inner_object)); |
2488 if (!inner_object->IsUnboxedDoubleField(idx1)) { | 2484 CHECK(CcTest::heap()->InOldDataSpace(inner_object->RawFastPropertyAt(idx1))); |
2489 CHECK( | |
2490 CcTest::heap()->InOldDataSpace(inner_object->RawFastPropertyAt(idx1))); | |
2491 } else { | |
2492 CHECK_EQ(2.2, inner_object->RawFastDoublePropertyAt(idx1)); | |
2493 } | |
2494 CHECK(CcTest::heap()->InOldPointerSpace( | 2485 CHECK(CcTest::heap()->InOldPointerSpace( |
2495 inner_object->RawFastPropertyAt(idx2))); | 2486 inner_object->RawFastPropertyAt(idx2))); |
2496 } | 2487 } |
2497 | 2488 |
2498 | 2489 |
2499 TEST(OptimizedPretenuringDoubleArrayProperties) { | 2490 TEST(OptimizedPretenuringDoubleArrayProperties) { |
2500 i::FLAG_allow_natives_syntax = true; | 2491 i::FLAG_allow_natives_syntax = true; |
2501 i::FLAG_expose_gc = true; | 2492 i::FLAG_expose_gc = true; |
2502 CcTest::InitializeVM(); | 2493 CcTest::InitializeVM(); |
2503 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; | 2494 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; |
(...skipping 2250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4754 #ifdef DEBUG | 4745 #ifdef DEBUG |
4755 TEST(PathTracer) { | 4746 TEST(PathTracer) { |
4756 CcTest::InitializeVM(); | 4747 CcTest::InitializeVM(); |
4757 v8::HandleScope scope(CcTest::isolate()); | 4748 v8::HandleScope scope(CcTest::isolate()); |
4758 | 4749 |
4759 v8::Local<v8::Value> result = CompileRun("'abc'"); | 4750 v8::Local<v8::Value> result = CompileRun("'abc'"); |
4760 Handle<Object> o = v8::Utils::OpenHandle(*result); | 4751 Handle<Object> o = v8::Utils::OpenHandle(*result); |
4761 CcTest::i_isolate()->heap()->TracePathToObject(*o); | 4752 CcTest::i_isolate()->heap()->TracePathToObject(*o); |
4762 } | 4753 } |
4763 #endif // DEBUG | 4754 #endif // DEBUG |
OLD | NEW |