1// Copyright 2014 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "src/property.h"
6
7#include "src/handles-inl.h"
8#include "src/ostreams.h"
9
10namespace v8 {
11namespace internal {
12
13void LookupResult::Iterate(ObjectVisitor* visitor) {
14  LookupResult* current = this;  // Could be NULL.
15  while (current != NULL) {
16    visitor->VisitPointer(bit_cast<Object**>(&current->holder_));
17    visitor->VisitPointer(bit_cast<Object**>(&current->transition_));
18    current = current->next_;
19  }
20}
21
22
23OStream& operator<<(OStream& os, const LookupResult& r) {
24  if (!r.IsFound()) return os << "Not Found\n";
25
26  os << "LookupResult:\n";
27  if (r.IsTransition()) {
28    os << " -transition target:\n" << Brief(r.GetTransitionTarget()) << "\n";
29  }
30  return os;
31}
32
33
34OStream& operator<<(OStream& os, const Descriptor& d) {
35  return os << "Descriptor " << Brief(*d.GetKey()) << " @ "
36            << Brief(*d.GetValue());
37}
38
39} }  // namespace v8::internal
40