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 6545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6556 CcTest::heap()->CollectGarbage(i::NEW_SPACE); | 6556 CcTest::heap()->CollectGarbage(i::NEW_SPACE); |
6557 } | 6557 } |
6558 // A single GC should be enough to reclaim the memory, since we are using | 6558 // A single GC should be enough to reclaim the memory, since we are using |
6559 // phantom handles. | 6559 // phantom handles. |
6560 CHECK_LT(CcTest::heap()->SizeOfObjects(), big_heap_size - 200000); | 6560 CHECK_LT(CcTest::heap()->SizeOfObjects(), big_heap_size - 200000); |
6561 CHECK(object_a.flag); | 6561 CHECK(object_a.flag); |
6562 CHECK(object_b.flag); | 6562 CHECK(object_b.flag); |
6563 } | 6563 } |
6564 | 6564 |
6565 | 6565 |
6566 THREADED_TEST(IndependentWeakHandle) { | 6566 TEST(IndependentWeakHandle) { |
6567 IndependentWeakHandle(false, false); | 6567 IndependentWeakHandle(false, false); |
6568 IndependentWeakHandle(false, true); | 6568 IndependentWeakHandle(false, true); |
6569 IndependentWeakHandle(true, false); | 6569 IndependentWeakHandle(true, false); |
6570 IndependentWeakHandle(true, true); | 6570 IndependentWeakHandle(true, true); |
6571 } | 6571 } |
6572 | 6572 |
6573 | 6573 |
6574 class Trivial { | 6574 class Trivial { |
6575 public: | 6575 public: |
6576 explicit Trivial(int x) : x_(x) {} | 6576 explicit Trivial(int x) : x_(x) {} |
(...skipping 15316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21893 } | 21893 } |
21894 { | 21894 { |
21895 v8::TryCatch try_catch; | 21895 v8::TryCatch try_catch; |
21896 uint16_t* data = reinterpret_cast<uint16_t*>(buffer); | 21896 uint16_t* data = reinterpret_cast<uint16_t*>(buffer); |
21897 CHECK(v8::String::NewFromTwoByte(isolate, data, v8::String::kNormalString, | 21897 CHECK(v8::String::NewFromTwoByte(isolate, data, v8::String::kNormalString, |
21898 length).IsEmpty()); | 21898 length).IsEmpty()); |
21899 CHECK(!try_catch.HasCaught()); | 21899 CHECK(!try_catch.HasCaught()); |
21900 } | 21900 } |
21901 free(buffer); | 21901 free(buffer); |
21902 } | 21902 } |
OLD | NEW |