Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: src/objects-printer.cc

Issue 805453002: Introduced PropertyType ACCESSOR_FIELD. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/objects.cc ('k') | src/property.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/disasm.h" 7 #include "src/disasm.h"
8 #include "src/disassembler.h" 8 #include "src/disassembler.h"
9 #include "src/heap/objects-visiting.h" 9 #include "src/heap/objects-visiting.h"
10 #include "src/jsregexp.h" 10 #include "src/jsregexp.h"
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 case FIELD: { 234 case FIELD: {
235 FieldIndex index = FieldIndex::ForDescriptor(map(), i); 235 FieldIndex index = FieldIndex::ForDescriptor(map(), i);
236 if (IsUnboxedDoubleField(index)) { 236 if (IsUnboxedDoubleField(index)) {
237 os << "<unboxed double> " << RawFastDoublePropertyAt(index); 237 os << "<unboxed double> " << RawFastDoublePropertyAt(index);
238 } else { 238 } else {
239 os << Brief(RawFastPropertyAt(index)); 239 os << Brief(RawFastPropertyAt(index));
240 } 240 }
241 os << " (field at offset " << index.property_index() << ")\n"; 241 os << " (field at offset " << index.property_index() << ")\n";
242 break; 242 break;
243 } 243 }
244 case ACCESSOR_FIELD: {
245 FieldIndex index = FieldIndex::ForDescriptor(map(), i);
246 os << " (accessor at offset " << index.property_index() << ")\n";
247 break;
248 }
244 case CONSTANT: 249 case CONSTANT:
245 os << Brief(descs->GetConstant(i)) << " (constant)\n"; 250 os << Brief(descs->GetConstant(i)) << " (constant)\n";
246 break; 251 break;
247 case CALLBACKS: 252 case CALLBACKS:
248 os << Brief(descs->GetCallbacksObject(i)) << " (callback)\n"; 253 os << Brief(descs->GetCallbacksObject(i)) << " (callbacks)\n";
249 break; 254 break;
250 } 255 }
251 } 256 }
252 } else { 257 } else {
253 property_dictionary()->Print(os); 258 property_dictionary()->Print(os);
254 } 259 }
255 } 260 }
256 261
257 262
258 template <class T> 263 template <class T>
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
1182 os << " (transition to sealed)"; 1187 os << " (transition to sealed)";
1183 } else if (key == GetHeap()->frozen_symbol()) { 1188 } else if (key == GetHeap()->frozen_symbol()) {
1184 os << " (transition to frozen)"; 1189 os << " (transition to frozen)";
1185 } else if (key == GetHeap()->elements_transition_symbol()) { 1190 } else if (key == GetHeap()->elements_transition_symbol()) {
1186 os << " (transition to " << ElementsKindToString(target->elements_kind()) 1191 os << " (transition to " << ElementsKindToString(target->elements_kind())
1187 << ")"; 1192 << ")";
1188 } else if (key == GetHeap()->observed_symbol()) { 1193 } else if (key == GetHeap()->observed_symbol()) {
1189 os << " (transition to Object.observe)"; 1194 os << " (transition to Object.observe)";
1190 } else { 1195 } else {
1191 PropertyDetails details = GetTargetDetails(key, target); 1196 PropertyDetails details = GetTargetDetails(key, target);
1192 switch (details.type()) { 1197 os << " (transition to ";
1193 case FIELD: { 1198 if (details.location() == IN_DESCRIPTOR) {
1194 os << " (transition to field)"; 1199 os << "immutable ";
1195 break;
1196 }
1197 case CONSTANT:
1198 os << " (transition to constant " << Brief(GetTargetValue(i)) << ")";
1199 break;
1200 case CALLBACKS:
1201 os << " (transition to callback " << Brief(GetTargetValue(i)) << ")";
1202 break;
1203 } 1200 }
1204 os << ", attrs: " << details.attributes(); 1201 os << (details.kind() == DATA ? "data" : "accessor");
1202 if (details.location() == IN_DESCRIPTOR) {
1203 os << " " << Brief(GetTargetValue(i));
1204 }
1205 os << "), attrs: " << details.attributes();
1205 } 1206 }
1206 os << " -> " << Brief(target) << "\n"; 1207 os << " -> " << Brief(target) << "\n";
1207 } 1208 }
1208 } 1209 }
1209 1210
1210 1211
1211 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT 1212 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT
1212 if (!map()->HasTransitionArray()) return; 1213 if (!map()->HasTransitionArray()) return;
1213 map()->transitions()->PrintTransitions(os, false); 1214 map()->transitions()->PrintTransitions(os, false);
1214 } 1215 }
1215 #endif // defined(DEBUG) || defined(OBJECT_PRINT) 1216 #endif // defined(DEBUG) || defined(OBJECT_PRINT)
1216 } } // namespace v8::internal 1217 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/property.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698