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 6132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6143 tracer->SampleAllocation(time3, counter3, 0); | 6143 tracer->SampleAllocation(time3, counter3, 0); |
6144 throughput = tracer->NewSpaceAllocationThroughputInBytesPerMillisecond(100); | 6144 throughput = tracer->NewSpaceAllocationThroughputInBytesPerMillisecond(100); |
6145 CHECK_EQ((counter3 - counter1) / (time3 - time1), throughput); | 6145 CHECK_EQ((counter3 - counter1) / (time3 - time1), throughput); |
6146 } | 6146 } |
6147 | 6147 |
6148 | 6148 |
6149 static void CheckLeak(const v8::FunctionCallbackInfo<v8::Value>& args) { | 6149 static void CheckLeak(const v8::FunctionCallbackInfo<v8::Value>& args) { |
6150 Isolate* isolate = CcTest::i_isolate(); | 6150 Isolate* isolate = CcTest::i_isolate(); |
6151 Object* message = | 6151 Object* message = |
6152 *reinterpret_cast<Object**>(isolate->pending_message_obj_address()); | 6152 *reinterpret_cast<Object**>(isolate->pending_message_obj_address()); |
6153 CHECK(message->IsTheHole()); | 6153 CHECK(message->IsTheHole(isolate)); |
6154 } | 6154 } |
6155 | 6155 |
6156 | 6156 |
6157 TEST(MessageObjectLeak) { | 6157 TEST(MessageObjectLeak) { |
6158 CcTest::InitializeVM(); | 6158 CcTest::InitializeVM(); |
6159 v8::Isolate* isolate = CcTest::isolate(); | 6159 v8::Isolate* isolate = CcTest::isolate(); |
6160 v8::HandleScope scope(isolate); | 6160 v8::HandleScope scope(isolate); |
6161 v8::Local<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate); | 6161 v8::Local<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate); |
6162 global->Set( | 6162 global->Set( |
6163 v8::String::NewFromUtf8(isolate, "check", v8::NewStringType::kNormal) | 6163 v8::String::NewFromUtf8(isolate, "check", v8::NewStringType::kNormal) |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6755 CHECK(marking->IsComplete()); | 6755 CHECK(marking->IsComplete()); |
6756 intptr_t size_before = heap->SizeOfObjects(); | 6756 intptr_t size_before = heap->SizeOfObjects(); |
6757 CcTest::heap()->CollectAllGarbage(); | 6757 CcTest::heap()->CollectAllGarbage(); |
6758 intptr_t size_after = heap->SizeOfObjects(); | 6758 intptr_t size_after = heap->SizeOfObjects(); |
6759 // Live size does not increase after garbage collection. | 6759 // Live size does not increase after garbage collection. |
6760 CHECK_LE(size_after, size_before); | 6760 CHECK_LE(size_after, size_before); |
6761 } | 6761 } |
6762 | 6762 |
6763 } // namespace internal | 6763 } // namespace internal |
6764 } // namespace v8 | 6764 } // namespace v8 |
OLD | NEW |