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

Side by Side Diff: test/cctest/heap/test-incremental-marking.cc

Issue 988893003: Implement tracing interface for v8 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update BUILD.gn to include trace_event_common.h Created 5 years 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 | « test/cctest/cctest.gyp ('k') | test/cctest/test-trace-event.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdlib.h> 5 #include <stdlib.h>
6 6
7 #ifdef __linux__ 7 #ifdef __linux__
8 #include <errno.h> 8 #include <errno.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <sys/stat.h> 10 #include <sys/stat.h>
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 bool PendingDelayedTask() { return delayed_task_ != nullptr; } 79 bool PendingDelayedTask() { return delayed_task_ != nullptr; }
80 80
81 void PerformDelayedTask() { 81 void PerformDelayedTask() {
82 Task* task = delayed_task_; 82 Task* task = delayed_task_;
83 delayed_task_ = nullptr; 83 delayed_task_ = nullptr;
84 task->Run(); 84 task->Run();
85 delete task; 85 delete task;
86 } 86 }
87 87
88 uint64_t AddTraceEvent(char phase, const uint8_t* categoryEnabledFlag,
89 const char* name, uint64_t id, uint64_t bind_id,
90 int numArgs, const char** argNames,
91 const uint8_t* argTypes, const uint64_t* argValues,
92 unsigned int flags) override {
93 return 0;
94 }
95
96 void UpdateTraceEventDuration(const uint8_t* categoryEnabledFlag,
97 const char* name, uint64_t handle) override {}
98
99 const uint8_t* GetCategoryGroupEnabled(const char* name) override {
100 static uint8_t no = 0;
101 return &no;
102 }
103
104 const char* GetCategoryGroupName(
105 const uint8_t* categoryEnabledFlag) override {
106 static const char* dummy = "dummy";
107 return dummy;
108 }
109
88 private: 110 private:
89 v8::Platform* platform_; 111 v8::Platform* platform_;
90 IdleTask* idle_task_; 112 IdleTask* idle_task_;
91 Task* delayed_task_; 113 Task* delayed_task_;
92 }; 114 };
93 115
94 116
95 TEST(IncrementalMarkingUsingIdleTasks) { 117 TEST(IncrementalMarkingUsingIdleTasks) {
96 if (!i::FLAG_incremental_marking) return; 118 if (!i::FLAG_incremental_marking) return;
97 CcTest::InitializeVM(); 119 CcTest::InitializeVM();
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 while (!marking->IsStopped() && platform.PendingDelayedTask()) { 189 while (!marking->IsStopped() && platform.PendingDelayedTask()) {
168 platform.PerformDelayedTask(); 190 platform.PerformDelayedTask();
169 } 191 }
170 // There could be pending delayed task from memory reducer after GC finishes. 192 // There could be pending delayed task from memory reducer after GC finishes.
171 CHECK(marking->IsStopped()); 193 CHECK(marking->IsStopped());
172 i::V8::SetPlatformForTesting(old_platform); 194 i::V8::SetPlatformForTesting(old_platform);
173 } 195 }
174 196
175 } // namespace internal 197 } // namespace internal
176 } // namespace v8 198 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/cctest.gyp ('k') | test/cctest/test-trace-event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698