| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/disassembler.h" | 7 #include "src/disassembler.h" |
| 8 #include "src/disasm.h" | 8 #include "src/disasm.h" |
| 9 #include "src/jsregexp.h" | 9 #include "src/jsregexp.h" |
| 10 #include "src/objects-visiting.h" | 10 #include "src/objects-visiting.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 225 |
| 226 void JSObject::PrintProperties(FILE* out) { | 226 void JSObject::PrintProperties(FILE* out) { |
| 227 if (HasFastProperties()) { | 227 if (HasFastProperties()) { |
| 228 DescriptorArray* descs = map()->instance_descriptors(); | 228 DescriptorArray* descs = map()->instance_descriptors(); |
| 229 for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) { | 229 for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) { |
| 230 PrintF(out, " "); | 230 PrintF(out, " "); |
| 231 descs->GetKey(i)->NamePrint(out); | 231 descs->GetKey(i)->NamePrint(out); |
| 232 PrintF(out, ": "); | 232 PrintF(out, ": "); |
| 233 switch (descs->GetType(i)) { | 233 switch (descs->GetType(i)) { |
| 234 case FIELD: { | 234 case FIELD: { |
| 235 int index = descs->GetFieldIndex(i); | 235 FieldIndex index = FieldIndex::ForDescriptor(map(), i); |
| 236 RawFastPropertyAt(index)->ShortPrint(out); | 236 RawFastPropertyAt(index)->ShortPrint(out); |
| 237 PrintF(out, " (field at offset %d)\n", index); | 237 if (index.is_inobject()) { |
| 238 PrintF(out, " (inobject field at index %d)\n", |
| 239 index.property_index()); |
| 240 } else { |
| 241 PrintF(out, " (out-of-object field at index %d)\n", |
| 242 index.property_index()); |
| 243 } |
| 238 break; | 244 break; |
| 239 } | 245 } |
| 240 case CONSTANT: | 246 case CONSTANT: |
| 241 descs->GetConstant(i)->ShortPrint(out); | 247 descs->GetConstant(i)->ShortPrint(out); |
| 242 PrintF(out, " (constant)\n"); | 248 PrintF(out, " (constant)\n"); |
| 243 break; | 249 break; |
| 244 case CALLBACKS: | 250 case CALLBACKS: |
| 245 descs->GetCallbacksObject(i)->ShortPrint(out); | 251 descs->GetCallbacksObject(i)->ShortPrint(out); |
| 246 PrintF(out, " (callback)\n"); | 252 PrintF(out, " (callback)\n"); |
| 247 break; | 253 break; |
| (...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1257 } | 1263 } |
| 1258 } | 1264 } |
| 1259 PrintF(out, "\n"); | 1265 PrintF(out, "\n"); |
| 1260 } | 1266 } |
| 1261 | 1267 |
| 1262 | 1268 |
| 1263 #endif // OBJECT_PRINT | 1269 #endif // OBJECT_PRINT |
| 1264 | 1270 |
| 1265 | 1271 |
| 1266 } } // namespace v8::internal | 1272 } } // namespace v8::internal |
| OLD | NEW |