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

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

Issue 45010: Remove all uses of StringShape variables, since that has proven... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 9 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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 484
485 void JSValue::JSValueVerify() { 485 void JSValue::JSValueVerify() {
486 Object* v = value(); 486 Object* v = value();
487 if (v->IsHeapObject()) { 487 if (v->IsHeapObject()) {
488 VerifyHeapPointer(v); 488 VerifyHeapPointer(v);
489 } 489 }
490 } 490 }
491 491
492 492
493 void String::StringPrint() { 493 void String::StringPrint() {
494 StringShape shape(this); 494 if (StringShape(this).IsSymbol()) {
495 if (shape.IsSymbol()) {
496 PrintF("#"); 495 PrintF("#");
497 } else if (shape.IsCons()) { 496 } else if (StringShape(this).IsCons()) {
498 PrintF("c\""); 497 PrintF("c\"");
499 } else { 498 } else {
500 PrintF("\""); 499 PrintF("\"");
501 } 500 }
502 501
503 for (int i = 0; i < length(); i++) { 502 for (int i = 0; i < length(); i++) {
504 PrintF("%c", Get(shape, i)); 503 PrintF("%c", Get(i));
505 } 504 }
506 505
507 if (!shape.IsSymbol()) PrintF("\""); 506 if (!StringShape(this).IsSymbol()) PrintF("\"");
508 } 507 }
509 508
510 509
511 void String::StringVerify() { 510 void String::StringVerify() {
512 CHECK(IsString()); 511 CHECK(IsString());
513 CHECK(length() >= 0 && length() <= Smi::kMaxValue); 512 CHECK(length() >= 0 && length() <= Smi::kMaxValue);
514 if (IsSymbol()) { 513 if (IsSymbol()) {
515 CHECK(!Heap::InNewSpace(this)); 514 CHECK(!Heap::InNewSpace(this));
516 } 515 }
517 } 516 }
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 } 1085 }
1087 current = hash; 1086 current = hash;
1088 } 1087 }
1089 return true; 1088 return true;
1090 } 1089 }
1091 1090
1092 1091
1093 #endif // DEBUG 1092 #endif // DEBUG
1094 1093
1095 } } // namespace v8::internal 1094 } } // 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