2014-04-01 11:16:13 +00:00
|
|
|
// Copyright 2014 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.
|
2008-07-03 15:10:15 +00:00
|
|
|
|
2014-04-01 11:16:13 +00:00
|
|
|
#include "property.h"
|
|
|
|
|
|
|
|
#include "handles-inl.h"
|
2008-07-03 15:10:15 +00:00
|
|
|
|
2009-05-25 10:05:56 +00:00
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
2008-07-03 15:10:15 +00:00
|
|
|
|
2011-10-18 11:18:55 +00:00
|
|
|
void LookupResult::Iterate(ObjectVisitor* visitor) {
|
|
|
|
LookupResult* current = this; // Could be NULL.
|
|
|
|
while (current != NULL) {
|
|
|
|
visitor->VisitPointer(BitCast<Object**>(¤t->holder_));
|
2014-02-18 12:19:32 +00:00
|
|
|
visitor->VisitPointer(BitCast<Object**>(¤t->transition_));
|
2011-10-18 11:18:55 +00:00
|
|
|
current = current->next_;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-12-20 10:38:19 +00:00
|
|
|
#ifdef OBJECT_PRINT
|
|
|
|
void LookupResult::Print(FILE* out) {
|
2010-02-18 15:10:35 +00:00
|
|
|
if (!IsFound()) {
|
2010-12-20 10:38:19 +00:00
|
|
|
PrintF(out, "Not Found\n");
|
2008-07-03 15:10:15 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-12-20 10:38:19 +00:00
|
|
|
PrintF(out, "LookupResult:\n");
|
|
|
|
PrintF(out, " -cacheable = %s\n", IsCacheable() ? "true" : "false");
|
|
|
|
PrintF(out, " -attributes = %x\n", GetAttributes());
|
2014-04-04 04:49:07 +00:00
|
|
|
if (IsTransition()) {
|
2014-04-15 07:36:47 +00:00
|
|
|
PrintF(out, " -transition target:\n");
|
|
|
|
GetTransitionTarget()->Print(out);
|
|
|
|
PrintF(out, "\n");
|
|
|
|
}
|
|
|
|
switch (type()) {
|
|
|
|
case NORMAL:
|
|
|
|
PrintF(out, " -type = normal\n");
|
|
|
|
PrintF(out, " -entry = %d", GetDictionaryEntry());
|
|
|
|
break;
|
|
|
|
case CONSTANT:
|
|
|
|
PrintF(out, " -type = constant\n");
|
|
|
|
PrintF(out, " -value:\n");
|
|
|
|
GetConstant()->Print(out);
|
|
|
|
PrintF(out, "\n");
|
|
|
|
break;
|
|
|
|
case FIELD:
|
|
|
|
PrintF(out, " -type = field\n");
|
|
|
|
PrintF(out, " -index = %d\n", GetFieldIndex().field_index());
|
|
|
|
PrintF(out, " -field type:\n");
|
|
|
|
GetFieldType()->TypePrint(out);
|
|
|
|
break;
|
|
|
|
case CALLBACKS:
|
|
|
|
PrintF(out, " -type = call backs\n");
|
|
|
|
PrintF(out, " -callback object:\n");
|
|
|
|
GetCallbackObject()->Print(out);
|
|
|
|
break;
|
|
|
|
case HANDLER:
|
|
|
|
PrintF(out, " -type = lookup proxy\n");
|
|
|
|
break;
|
|
|
|
case INTERCEPTOR:
|
|
|
|
PrintF(out, " -type = lookup interceptor\n");
|
|
|
|
break;
|
|
|
|
case NONEXISTENT:
|
|
|
|
UNREACHABLE();
|
|
|
|
break;
|
2008-07-03 15:10:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-12-20 10:38:19 +00:00
|
|
|
void Descriptor::Print(FILE* out) {
|
|
|
|
PrintF(out, "Descriptor ");
|
|
|
|
GetKey()->ShortPrint(out);
|
|
|
|
PrintF(out, " @ ");
|
|
|
|
GetValue()->ShortPrint(out);
|
2008-07-03 15:10:15 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
} } // namespace v8::internal
|