Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: test/cctest/test-heap-profiler.cc

Issue 2189643004: Fix performance regression of heap snapshot generator that was (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/profiler/heap-snapshot-generator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 } 486 }
487 487
488 488
489 void CheckSimdSnapshot(const char* program, const char* var_name) { 489 void CheckSimdSnapshot(const char* program, const char* var_name) {
490 i::FLAG_harmony_simd = true; 490 i::FLAG_harmony_simd = true;
491 LocalContext env; 491 LocalContext env;
492 v8::HandleScope scope(env->GetIsolate()); 492 v8::HandleScope scope(env->GetIsolate());
493 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler(); 493 v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler();
494 494
495 CompileRun(program); 495 CompileRun(program);
496 // The TakeHeapSnapshot function does not do enough GCs to ensure
497 // that all garbage is collected. We perform addition GC here
498 // to reclaim a floating AllocationSite and to fix the following failure:
499 // # Check failed: ValidateSnapshot(snapshot).
500 // Stdout:
501 // 28 @ 13523 entry with no retainer: /hidden/ system / AllocationSite
502 // 44 @ 767 $map: /hidden/ system / Map
503 // 44 @ 59 $map: /hidden/ system / Map
504 CcTest::heap()->CollectAllGarbage();
505
496 const v8::HeapSnapshot* snapshot = heap_profiler->TakeHeapSnapshot(); 506 const v8::HeapSnapshot* snapshot = heap_profiler->TakeHeapSnapshot();
497 CHECK(ValidateSnapshot(snapshot)); 507 CHECK(ValidateSnapshot(snapshot));
498 const v8::HeapGraphNode* global = GetGlobalObject(snapshot); 508 const v8::HeapGraphNode* global = GetGlobalObject(snapshot);
499 const v8::HeapGraphNode* var = 509 const v8::HeapGraphNode* var =
500 GetProperty(global, v8::HeapGraphEdge::kProperty, var_name); 510 GetProperty(global, v8::HeapGraphEdge::kProperty, var_name);
501 CHECK(var); 511 CHECK(var);
502 CHECK_EQ(var->GetType(), v8::HeapGraphNode::kSimdValue); 512 CHECK_EQ(var->GetType(), v8::HeapGraphNode::kSimdValue);
503 } 513 }
504 514
505 515
(...skipping 2544 matching lines...) Expand 10 before | Expand all | Expand 10 after
3050 " a[i] = i;\n" 3060 " a[i] = i;\n"
3051 " for (var i = 0; i < 3; ++i)\n" 3061 " for (var i = 0; i < 3; ++i)\n"
3052 " a.shift();\n" 3062 " a.shift();\n"
3053 "}\n"); 3063 "}\n");
3054 3064
3055 CcTest::heap()->CollectGarbage(v8::internal::NEW_SPACE); 3065 CcTest::heap()->CollectGarbage(v8::internal::NEW_SPACE);
3056 // Should not crash. 3066 // Should not crash.
3057 3067
3058 heap_profiler->StopSamplingHeapProfiler(); 3068 heap_profiler->StopSamplingHeapProfiler();
3059 } 3069 }
OLDNEW
« no previous file with comments | « src/profiler/heap-snapshot-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698