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 11 matching lines...) Expand all Loading... |
22 #ifdef OBJECT_PRINT | 22 #ifdef OBJECT_PRINT |
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 switch (type()) { | 32 if (IsTransition()) { |
33 case NORMAL: | 33 switch (type()) { |
34 PrintF(out, " -type = normal\n"); | 34 case FIELD: |
35 PrintF(out, " -entry = %d", GetDictionaryEntry()); | 35 PrintF(out, " -type = map transition\n"); |
36 break; | 36 PrintF(out, " -map:\n"); |
37 case CONSTANT: | 37 GetTransitionTarget()->Print(out); |
38 PrintF(out, " -type = constant\n"); | 38 PrintF(out, "\n"); |
39 PrintF(out, " -value:\n"); | 39 break; |
40 GetConstant()->Print(out); | 40 case CONSTANT: |
41 PrintF(out, "\n"); | 41 PrintF(out, " -type = constant property transition\n"); |
42 break; | 42 PrintF(out, " -map:\n"); |
43 case FIELD: | 43 GetTransitionTarget()->Print(out); |
44 PrintF(out, " -type = field\n"); | 44 PrintF(out, "\n"); |
45 PrintF(out, " -index = %d", GetFieldIndex().field_index()); | 45 break; |
46 PrintF(out, "\n"); | 46 case CALLBACKS: |
47 break; | 47 PrintF(out, " -type = callbacks transition\n"); |
48 case CALLBACKS: | 48 PrintF(out, " -callback object:\n"); |
49 PrintF(out, " -type = call backs\n"); | 49 GetCallbackObject()->Print(out); |
50 PrintF(out, " -callback object:\n"); | 50 break; |
51 GetCallbackObject()->Print(out); | 51 default: |
52 break; | 52 UNREACHABLE(); |
53 case HANDLER: | 53 break; |
54 PrintF(out, " -type = lookup proxy\n"); | 54 } |
55 break; | 55 } else { |
56 case INTERCEPTOR: | 56 switch (type()) { |
57 PrintF(out, " -type = lookup interceptor\n"); | 57 case NORMAL: |
58 break; | 58 PrintF(out, " -type = normal\n"); |
59 case TRANSITION: | 59 PrintF(out, " -entry = %d", GetDictionaryEntry()); |
60 switch (GetTransitionDetails().type()) { | 60 break; |
61 case FIELD: | 61 case CONSTANT: |
62 PrintF(out, " -type = map transition\n"); | 62 PrintF(out, " -type = constant\n"); |
63 PrintF(out, " -map:\n"); | 63 PrintF(out, " -value:\n"); |
64 GetTransitionTarget()->Print(out); | 64 GetConstant()->Print(out); |
65 PrintF(out, "\n"); | 65 PrintF(out, "\n"); |
66 return; | 66 break; |
67 case CONSTANT: | 67 case FIELD: |
68 PrintF(out, " -type = constant property transition\n"); | 68 PrintF(out, " -type = field\n"); |
69 PrintF(out, " -map:\n"); | 69 PrintF(out, " -index = %d", GetFieldIndex().field_index()); |
70 GetTransitionTarget()->Print(out); | 70 PrintF(out, "\n"); |
71 PrintF(out, "\n"); | 71 break; |
72 return; | 72 case CALLBACKS: |
73 case CALLBACKS: | 73 PrintF(out, " -type = call backs\n"); |
74 PrintF(out, " -type = callbacks transition\n"); | 74 PrintF(out, " -callback object:\n"); |
75 PrintF(out, " -callback object:\n"); | 75 GetCallbackObject()->Print(out); |
76 GetCallbackObject()->Print(out); | 76 break; |
77 return; | 77 case HANDLER: |
78 default: | 78 PrintF(out, " -type = lookup proxy\n"); |
79 UNREACHABLE(); | 79 break; |
80 return; | 80 case INTERCEPTOR: |
81 } | 81 PrintF(out, " -type = lookup interceptor\n"); |
82 case NONEXISTENT: | 82 break; |
83 UNREACHABLE(); | 83 case NONEXISTENT: |
84 break; | 84 UNREACHABLE(); |
| 85 break; |
| 86 } |
85 } | 87 } |
86 } | 88 } |
87 | 89 |
88 | 90 |
89 void Descriptor::Print(FILE* out) { | 91 void Descriptor::Print(FILE* out) { |
90 PrintF(out, "Descriptor "); | 92 PrintF(out, "Descriptor "); |
91 GetKey()->ShortPrint(out); | 93 GetKey()->ShortPrint(out); |
92 PrintF(out, " @ "); | 94 PrintF(out, " @ "); |
93 GetValue()->ShortPrint(out); | 95 GetValue()->ShortPrint(out); |
94 } | 96 } |
95 #endif | 97 #endif |
96 | 98 |
97 } } // namespace v8::internal | 99 } } // namespace v8::internal |
OLD | NEW |