OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2576 | 2576 |
2577 const char* names[] = {"", "start", "f_0_0"}; | 2577 const char* names[] = {"", "start", "f_0_0"}; |
2578 AllocationTraceNode* node = FindNode(tracker, ArrayVector(names)); | 2578 AllocationTraceNode* node = FindNode(tracker, ArrayVector(names)); |
2579 CHECK(node); | 2579 CHECK(node); |
2580 CHECK_GE(node->allocation_count(), 12u); | 2580 CHECK_GE(node->allocation_count(), 12u); |
2581 CHECK_GE(node->allocation_size(), 4 * node->allocation_count()); | 2581 CHECK_GE(node->allocation_size(), 4 * node->allocation_count()); |
2582 heap_profiler->StopTrackingHeapObjects(); | 2582 heap_profiler->StopTrackingHeapObjects(); |
2583 } | 2583 } |
2584 | 2584 |
2585 TEST(TrackHeapAllocationsWithoutInlining) { | 2585 TEST(TrackHeapAllocationsWithoutInlining) { |
2586 i::FLAG_turbo_inlining = false; | |
2587 i::FLAG_max_inlined_source_size = 0; // Disable inlining | 2586 i::FLAG_max_inlined_source_size = 0; // Disable inlining |
2588 v8::HandleScope scope(v8::Isolate::GetCurrent()); | 2587 v8::HandleScope scope(v8::Isolate::GetCurrent()); |
2589 LocalContext env; | 2588 LocalContext env; |
2590 | 2589 |
2591 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler(); | 2590 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler(); |
2592 heap_profiler->StartTrackingHeapObjects(true); | 2591 heap_profiler->StartTrackingHeapObjects(true); |
2593 | 2592 |
2594 CompileRun(record_trace_tree_source); | 2593 CompileRun(record_trace_tree_source); |
2595 | 2594 |
2596 AllocationTracker* tracker = | 2595 AllocationTracker* tracker = |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3111 " a[i] = i;\n" | 3110 " a[i] = i;\n" |
3112 " for (var i = 0; i < 3; ++i)\n" | 3111 " for (var i = 0; i < 3; ++i)\n" |
3113 " a.shift();\n" | 3112 " a.shift();\n" |
3114 "}\n"); | 3113 "}\n"); |
3115 | 3114 |
3116 CcTest::CollectGarbage(v8::internal::NEW_SPACE); | 3115 CcTest::CollectGarbage(v8::internal::NEW_SPACE); |
3117 // Should not crash. | 3116 // Should not crash. |
3118 | 3117 |
3119 heap_profiler->StopSamplingHeapProfiler(); | 3118 heap_profiler->StopSamplingHeapProfiler(); |
3120 } | 3119 } |
OLD | NEW |