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

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

Issue 7341: Allocate room for expected number of properties based on the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 months 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 | Annotate | Revision Log
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 256
257 void JSObject::PrintProperties() { 257 void JSObject::PrintProperties() {
258 if (HasFastProperties()) { 258 if (HasFastProperties()) {
259 for (DescriptorReader r(map()->instance_descriptors()); 259 for (DescriptorReader r(map()->instance_descriptors());
260 !r.eos(); 260 !r.eos();
261 r.advance()) { 261 r.advance()) {
262 PrintF(" "); 262 PrintF(" ");
263 r.GetKey()->StringPrint(); 263 r.GetKey()->StringPrint();
264 PrintF(": "); 264 PrintF(": ");
265 if (r.type() == FIELD) { 265 if (r.type() == FIELD) {
266 properties()->get(r.GetFieldIndex())->ShortPrint(); 266 FastPropertyAt(r.GetFieldIndex())->ShortPrint();
267 PrintF(" (field at offset %d)\n", r.GetFieldIndex()); 267 PrintF(" (field at offset %d)\n", r.GetFieldIndex());
268 } else if (r.type() == CONSTANT_FUNCTION) { 268 } else if (r.type() == CONSTANT_FUNCTION) {
269 r.GetConstantFunction()->ShortPrint(); 269 r.GetConstantFunction()->ShortPrint();
270 PrintF(" (constant function)\n"); 270 PrintF(" (constant function)\n");
271 } else if (r.type() == CALLBACKS) { 271 } else if (r.type() == CALLBACKS) {
272 r.GetCallbacksObject()->ShortPrint(); 272 r.GetCallbacksObject()->ShortPrint();
273 PrintF(" (callback)\n"); 273 PrintF(" (callback)\n");
274 } else if (r.type() == MAP_TRANSITION) { 274 } else if (r.type() == MAP_TRANSITION) {
275 PrintF(" (map transition)\n"); 275 PrintF(" (map transition)\n");
276 } else { 276 } else {
(...skipping 29 matching lines...) Expand all
306 PrintElements(); 306 PrintElements();
307 PrintF(" }\n"); 307 PrintF(" }\n");
308 } 308 }
309 309
310 310
311 void JSObject::JSObjectVerify() { 311 void JSObject::JSObjectVerify() {
312 VerifyHeapPointer(properties()); 312 VerifyHeapPointer(properties());
313 VerifyHeapPointer(elements()); 313 VerifyHeapPointer(elements());
314 if (HasFastProperties()) { 314 if (HasFastProperties()) {
315 CHECK(map()->unused_property_fields() == 315 CHECK(map()->unused_property_fields() ==
316 (properties()->length() - map()->NextFreePropertyIndex())); 316 (map()->inobject_properties() + properties()->length() -
317 map()->NextFreePropertyIndex()));
317 } 318 }
318 } 319 }
319 320
320 321
321 static const char* TypeToString(InstanceType type) { 322 static const char* TypeToString(InstanceType type) {
322 switch (type) { 323 switch (type) {
323 case MAP_TYPE: return "MAP"; 324 case MAP_TYPE: return "MAP";
324 case HEAP_NUMBER_TYPE: return "HEAP_NUMBER"; 325 case HEAP_NUMBER_TYPE: return "HEAP_NUMBER";
325 case SHORT_SYMBOL_TYPE: 326 case SHORT_SYMBOL_TYPE:
326 case MEDIUM_SYMBOL_TYPE: 327 case MEDIUM_SYMBOL_TYPE:
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 } 1015 }
1015 current = hash; 1016 current = hash;
1016 } 1017 }
1017 return true; 1018 return true;
1018 } 1019 }
1019 1020
1020 1021
1021 #endif // DEBUG 1022 #endif // DEBUG
1022 1023
1023 } } // namespace v8::internal 1024 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698