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

Unified Diff: src/unbound-queue-inl.h

Issue 1356223004: Move heap and CPU profilers into a dedicated directory. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebaseline Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/unbound-queue.h ('k') | src/v8.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/unbound-queue-inl.h
diff --git a/src/unbound-queue-inl.h b/src/unbound-queue-inl.h
deleted file mode 100644
index 6782281680046fd8e78a68e452ea82fcd1afa6e0..0000000000000000000000000000000000000000
--- a/src/unbound-queue-inl.h
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2010 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef V8_UNBOUND_QUEUE_INL_H_
-#define V8_UNBOUND_QUEUE_INL_H_
-
-#include "src/unbound-queue.h"
-
-namespace v8 {
-namespace internal {
-
-template<typename Record>
-struct UnboundQueue<Record>::Node: public Malloced {
- explicit Node(const Record& value)
- : value(value), next(NULL) {
- }
-
- Record value;
- Node* next;
-};
-
-
-template<typename Record>
-UnboundQueue<Record>::UnboundQueue() {
- first_ = new Node(Record());
- divider_ = last_ = reinterpret_cast<base::AtomicWord>(first_);
-}
-
-
-template<typename Record>
-UnboundQueue<Record>::~UnboundQueue() {
- while (first_ != NULL) DeleteFirst();
-}
-
-
-template<typename Record>
-void UnboundQueue<Record>::DeleteFirst() {
- Node* tmp = first_;
- first_ = tmp->next;
- delete tmp;
-}
-
-
-template<typename Record>
-bool UnboundQueue<Record>::Dequeue(Record* rec) {
- if (divider_ == base::Acquire_Load(&last_)) return false;
- Node* next = reinterpret_cast<Node*>(divider_)->next;
- *rec = next->value;
- base::Release_Store(&divider_, reinterpret_cast<base::AtomicWord>(next));
- return true;
-}
-
-
-template<typename Record>
-void UnboundQueue<Record>::Enqueue(const Record& rec) {
- Node*& next = reinterpret_cast<Node*>(last_)->next;
- next = new Node(rec);
- base::Release_Store(&last_, reinterpret_cast<base::AtomicWord>(next));
-
- while (first_ != reinterpret_cast<Node*>(base::Acquire_Load(&divider_))) {
- DeleteFirst();
- }
-}
-
-
-template<typename Record>
-bool UnboundQueue<Record>::IsEmpty() const {
- return base::NoBarrier_Load(&divider_) == base::NoBarrier_Load(&last_);
-}
-
-
-template<typename Record>
-Record* UnboundQueue<Record>::Peek() const {
- if (divider_ == base::Acquire_Load(&last_)) return NULL;
- Node* next = reinterpret_cast<Node*>(divider_)->next;
- return &next->value;
-}
-
-} } // namespace v8::internal
-
-#endif // V8_UNBOUND_QUEUE_INL_H_
« no previous file with comments | « src/unbound-queue.h ('k') | src/v8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698