OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 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 | 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 "property.h" | 5 #include "property.h" |
6 | 6 |
7 #include "handles-inl.h" | 7 #include "handles-inl.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 12 matching lines...) Expand all Loading... |
23 void LookupResult::Print(FILE* out) { | 23 void LookupResult::Print(FILE* out) { |
24 if (!IsFound()) { | 24 if (!IsFound()) { |
25 PrintF(out, "Not Found\n"); | 25 PrintF(out, "Not Found\n"); |
26 return; | 26 return; |
27 } | 27 } |
28 | 28 |
29 PrintF(out, "LookupResult:\n"); | 29 PrintF(out, "LookupResult:\n"); |
30 PrintF(out, " -cacheable = %s\n", IsCacheable() ? "true" : "false"); | 30 PrintF(out, " -cacheable = %s\n", IsCacheable() ? "true" : "false"); |
31 PrintF(out, " -attributes = %x\n", GetAttributes()); | 31 PrintF(out, " -attributes = %x\n", GetAttributes()); |
32 if (IsTransition()) { | 32 if (IsTransition()) { |
33 PrintF(out, " -transition target:\n"); | 33 switch (type()) { |
34 GetTransitionTarget()->Print(out); | 34 case FIELD: |
35 PrintF(out, "\n"); | 35 PrintF(out, " -type = map transition\n"); |
36 } | 36 PrintF(out, " -map:\n"); |
37 switch (type()) { | 37 GetTransitionTarget()->Print(out); |
38 case NORMAL: | 38 PrintF(out, "\n"); |
39 PrintF(out, " -type = normal\n"); | 39 break; |
40 PrintF(out, " -entry = %d", GetDictionaryEntry()); | 40 case CONSTANT: |
41 break; | 41 PrintF(out, " -type = constant property transition\n"); |
42 case CONSTANT: | 42 PrintF(out, " -map:\n"); |
43 PrintF(out, " -type = constant\n"); | 43 GetTransitionTarget()->Print(out); |
44 PrintF(out, " -value:\n"); | 44 PrintF(out, "\n"); |
45 GetConstant()->Print(out); | 45 break; |
46 PrintF(out, "\n"); | 46 case CALLBACKS: |
47 break; | 47 PrintF(out, " -type = callbacks transition\n"); |
48 case FIELD: | 48 PrintF(out, " -callback object:\n"); |
49 PrintF(out, " -type = field\n"); | 49 GetCallbackObject()->Print(out); |
50 PrintF(out, " -index = %d\n", GetFieldIndex().field_index()); | 50 break; |
51 PrintF(out, " -field type:\n"); | 51 default: |
52 GetFieldType()->TypePrint(out); | 52 UNREACHABLE(); |
53 break; | 53 break; |
54 case CALLBACKS: | 54 } |
55 PrintF(out, " -type = call backs\n"); | 55 } else { |
56 PrintF(out, " -callback object:\n"); | 56 switch (type()) { |
57 GetCallbackObject()->Print(out); | 57 case NORMAL: |
58 break; | 58 PrintF(out, " -type = normal\n"); |
59 case HANDLER: | 59 PrintF(out, " -entry = %d", GetDictionaryEntry()); |
60 PrintF(out, " -type = lookup proxy\n"); | 60 break; |
61 break; | 61 case CONSTANT: |
62 case INTERCEPTOR: | 62 PrintF(out, " -type = constant\n"); |
63 PrintF(out, " -type = lookup interceptor\n"); | 63 PrintF(out, " -value:\n"); |
64 break; | 64 GetConstant()->Print(out); |
65 case NONEXISTENT: | 65 PrintF(out, "\n"); |
66 UNREACHABLE(); | 66 break; |
67 break; | 67 case FIELD: |
| 68 PrintF(out, " -type = field\n"); |
| 69 PrintF(out, " -index = %d", GetFieldIndex().field_index()); |
| 70 PrintF(out, "\n"); |
| 71 break; |
| 72 case CALLBACKS: |
| 73 PrintF(out, " -type = call backs\n"); |
| 74 PrintF(out, " -callback object:\n"); |
| 75 GetCallbackObject()->Print(out); |
| 76 break; |
| 77 case HANDLER: |
| 78 PrintF(out, " -type = lookup proxy\n"); |
| 79 break; |
| 80 case INTERCEPTOR: |
| 81 PrintF(out, " -type = lookup interceptor\n"); |
| 82 break; |
| 83 case NONEXISTENT: |
| 84 UNREACHABLE(); |
| 85 break; |
| 86 } |
68 } | 87 } |
69 } | 88 } |
70 | 89 |
71 | 90 |
72 void Descriptor::Print(FILE* out) { | 91 void Descriptor::Print(FILE* out) { |
73 PrintF(out, "Descriptor "); | 92 PrintF(out, "Descriptor "); |
74 GetKey()->ShortPrint(out); | 93 GetKey()->ShortPrint(out); |
75 PrintF(out, " @ "); | 94 PrintF(out, " @ "); |
76 GetValue()->ShortPrint(out); | 95 GetValue()->ShortPrint(out); |
77 } | 96 } |
78 #endif | 97 #endif |
79 | 98 |
80 } } // namespace v8::internal | 99 } } // namespace v8::internal |
OLD | NEW |