Home | History | Annotate | Download | only in src

Lines Matching refs:Node

36 class GlobalHandles::Node : public Malloced {
47 Node() {
51 explicit Node(Object* object) {
57 ~Node() {
78 Node* next() { return next_; }
79 void set_next(Node* value) { next_ = value; }
80 Node** next_addr() { return &next_; }
82 // Accessors for next free node in the free list.
83 Node* next_free() {
87 void set_next_free(Node* value) {
93 static Node* FromLocation(Object** location) {
94 ASSERT(OFFSET_OF(Node, object_) == 0);
95 return reinterpret_cast<Node*>(location);
152 if (state_ != Node::PENDING) return false;
205 Node* next_free;
209 Node* next_;
212 TRACK_MEMORY("GlobalHandles::Node")
225 Node* Allocate() {
248 Node nodes[kNodesPerChunk];
251 Node* SlowAllocate() {
256 Node* new_nodes = current_->nodes;
263 Node* next_;
264 Node* limit_;
273 Node* result;
275 // Take the first node in the free list.
285 // Allocate a new node.
298 Node* node = Node::FromLocation(location);
299 node->Destroy();
301 node->set_next_free(first_free());
302 set_first_free(node);
309 Node::FromLocation(location)->MakeWeak(parameter, callback);
314 Node::FromLocation(location)->ClearWeakness();
319 return Node::FromLocation(location)->IsNearDeath();
324 return Node::FromLocation(location)->IsWeak();
331 for (Node* current = head_; current != NULL; current = current->next()) {
332 if (current->state_ == Node::WEAK
333 || current->state_ == Node::PENDING
334 || current->state_ == Node::NEAR_DEATH) {
343 for (Node* current = head_; current != NULL; current = current->next()) {
352 for (Node* current = head_; current != NULL; current = current->next()) {
353 if (current->state_ == Node::WEAK) {
355 current->state_ = Node::PENDING;
372 Node** p = &head_;
377 // PostGarbageCollection processing. The current node might
383 if ((*p)->state_ == Node::DESTROYED) {
385 Node* node = *p;
386 *p = node->next(); // Update the link.
388 first_deallocated()->set_next(node);
390 node->set_next_free(first_deallocated());
391 set_first_deallocated(node);
405 for (Node* current = head_; current != NULL; current = current->next()) {
406 if (current->state_ == Node::NORMAL) {
414 for (Node* current = head_; current != NULL; current = current->next()) {
415 if (current->state_ != Node::DESTROYED) {
434 GlobalHandles::Node* GlobalHandles::head_ = NULL;
435 GlobalHandles::Node* GlobalHandles::first_free_ = NULL;
436 GlobalHandles::Node* GlobalHandles::first_deallocated_ = NULL;
444 for (Node* current = head_; current != NULL; current = current->next()) {
446 if (current->state_ == Node::WEAK) {
448 } else if (current->state_ == Node::PENDING) {
450 } else if (current->state_ == Node::NEAR_DEATH) {
452 } else if (current->state_ == Node::DESTROYED) {
467 for (Node* current = head_; current != NULL; current = current->next()) {
469 if (current->state_ == Node::WEAK) weak++;
470 if (current->state_ == Node::PENDING) pending++;
471 if (current->state_ == Node::NEAR_DEATH) near_death++;
472 if (current->state_ == Node::DESTROYED) destroyed++;
476 PrintF(" allocated memory = %dB\n", sizeof(Node) * total);
486 for (Node* current = head_; current != NULL; current = current->next()) {
488 *current->handle(), current->state_ == Node::WEAK);