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 4016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4027 Handle<JSFunction> bar_handle = | 4027 Handle<JSFunction> bar_handle = |
4028 v8::Utils::OpenHandle( | 4028 v8::Utils::OpenHandle( |
4029 *v8::Handle<v8::Function>::Cast( | 4029 *v8::Handle<v8::Function>::Cast( |
4030 CcTest::global()->Get(v8_str("bar")))); | 4030 CcTest::global()->Get(v8_str("bar")))); |
4031 CHECK_EQ(bar_handle->code(), function_bar); | 4031 CHECK_EQ(bar_handle->code(), function_bar); |
4032 } | 4032 } |
4033 | 4033 |
4034 // Now make sure that a gc should get rid of the function, even though we | 4034 // Now make sure that a gc should get rid of the function, even though we |
4035 // still have the allocation site alive. | 4035 // still have the allocation site alive. |
4036 for (int i = 0; i < 4; i++) { | 4036 for (int i = 0; i < 4; i++) { |
4037 heap->CollectAllGarbage(Heap::kNoGCFlags); | 4037 heap->CollectAllGarbage(Heap::kReduceMemoryFootprintMask); |
4038 } | 4038 } |
4039 | 4039 |
4040 // The site still exists because of our global handle, but the code is no | 4040 // The site still exists because of our global handle, but the code is no |
4041 // longer referred to by dependent_code(). | 4041 // longer referred to by dependent_code(). |
4042 DependentCode::GroupStartIndexes starts(site->dependent_code()); | 4042 DependentCode::GroupStartIndexes starts(site->dependent_code()); |
4043 int index = starts.at(DependentCode::kAllocationSiteTransitionChangedGroup); | 4043 int index = starts.at(DependentCode::kAllocationSiteTransitionChangedGroup); |
4044 CHECK(!(site->dependent_code()->is_code_at(index))); | 4044 CHECK(!(site->dependent_code()->is_code_at(index))); |
4045 } | 4045 } |
4046 | 4046 |
4047 | 4047 |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4745 #ifdef DEBUG | 4745 #ifdef DEBUG |
4746 TEST(PathTracer) { | 4746 TEST(PathTracer) { |
4747 CcTest::InitializeVM(); | 4747 CcTest::InitializeVM(); |
4748 v8::HandleScope scope(CcTest::isolate()); | 4748 v8::HandleScope scope(CcTest::isolate()); |
4749 | 4749 |
4750 v8::Local<v8::Value> result = CompileRun("'abc'"); | 4750 v8::Local<v8::Value> result = CompileRun("'abc'"); |
4751 Handle<Object> o = v8::Utils::OpenHandle(*result); | 4751 Handle<Object> o = v8::Utils::OpenHandle(*result); |
4752 CcTest::i_isolate()->heap()->TracePathToObject(*o); | 4752 CcTest::i_isolate()->heap()->TracePathToObject(*o); |
4753 } | 4753 } |
4754 #endif // DEBUG | 4754 #endif // DEBUG |
OLD | NEW |