OLD | NEW |
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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 bool PendingDelayedTask() { return delayed_task_ != nullptr; } | 74 bool PendingDelayedTask() { return delayed_task_ != nullptr; } |
75 | 75 |
76 void PerformDelayedTask() { | 76 void PerformDelayedTask() { |
77 Task* task = delayed_task_; | 77 Task* task = delayed_task_; |
78 delayed_task_ = nullptr; | 78 delayed_task_ = nullptr; |
79 task->Run(); | 79 task->Run(); |
80 delete task; | 80 delete task; |
81 } | 81 } |
82 | 82 |
| 83 uint64_t AddTraceEvent(char phase, const uint8_t* categoryEnabledFlag, |
| 84 const char* name, uint64_t id, uint64_t context_id, |
| 85 uint64_t bind_id, int numArgs, const char** argNames, |
| 86 const uint8_t* argTypes, const uint64_t* argValues, |
| 87 unsigned int flags) override { |
| 88 return 0; |
| 89 } |
| 90 |
| 91 void UpdateTraceEventDuration(const uint8_t* categoryEnabledFlag, |
| 92 const char* name, uint64_t handle) override {} |
| 93 |
| 94 const uint8_t* GetCategoryGroupEnabled(const char* name) override { |
| 95 static uint8_t no = 0; |
| 96 return &no; |
| 97 } |
| 98 |
| 99 const char* GetCategoryGroupName( |
| 100 const uint8_t* categoryEnabledFlag) override { |
| 101 static const char* dummy = "dummy"; |
| 102 return dummy; |
| 103 } |
| 104 |
83 private: | 105 private: |
84 v8::Platform* platform_; | 106 v8::Platform* platform_; |
85 IdleTask* idle_task_; | 107 IdleTask* idle_task_; |
86 Task* delayed_task_; | 108 Task* delayed_task_; |
87 }; | 109 }; |
88 | 110 |
89 | 111 |
90 TEST(IncrementalMarkingUsingIdleTasks) { | 112 TEST(IncrementalMarkingUsingIdleTasks) { |
91 if (!i::FLAG_incremental_marking) return; | 113 if (!i::FLAG_incremental_marking) return; |
92 CcTest::InitializeVM(); | 114 CcTest::InitializeVM(); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 181 } |
160 // Once we stop notifying idle task progress, the delayed tasks | 182 // Once we stop notifying idle task progress, the delayed tasks |
161 // should finish marking. | 183 // should finish marking. |
162 while (!marking->IsStopped() && platform.PendingDelayedTask()) { | 184 while (!marking->IsStopped() && platform.PendingDelayedTask()) { |
163 platform.PerformDelayedTask(); | 185 platform.PerformDelayedTask(); |
164 } | 186 } |
165 // There could be pending delayed task from memory reducer after GC finishes. | 187 // There could be pending delayed task from memory reducer after GC finishes. |
166 CHECK(marking->IsStopped()); | 188 CHECK(marking->IsStopped()); |
167 i::V8::SetPlatformForTesting(old_platform); | 189 i::V8::SetPlatformForTesting(old_platform); |
168 } | 190 } |
OLD | NEW |