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

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

Issue 2028983002: Introduce IsUndefined(Isolate*) and IsTheHole(Isolate*) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase master Created 4 years, 6 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
« no previous file with comments | « src/objects-inl.h ('k') | src/ppc/code-stubs-ppc.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/objects.h" 5 #include "src/objects.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/interpreter/bytecodes.h" 9 #include "src/interpreter/bytecodes.h"
10 #include "src/objects-inl.h" 10 #include "src/objects-inl.h"
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 os << "\n - context = " << Brief(context()); 458 os << "\n - context = " << Brief(context());
459 os << " - scope_info = " << Brief(scope_info()); 459 os << " - scope_info = " << Brief(scope_info());
460 JSObjectPrintBody(os, this); 460 JSObjectPrintBody(os, this);
461 } 461 }
462 462
463 463
464 void Symbol::SymbolPrint(std::ostream& os) { // NOLINT 464 void Symbol::SymbolPrint(std::ostream& os) { // NOLINT
465 HeapObject::PrintHeader(os, "Symbol"); 465 HeapObject::PrintHeader(os, "Symbol");
466 os << "\n - hash: " << Hash(); 466 os << "\n - hash: " << Hash();
467 os << "\n - name: " << Brief(name()); 467 os << "\n - name: " << Brief(name());
468 if (name()->IsUndefined()) { 468 if (name()->IsUndefined(GetIsolate())) {
469 os << " (" << PrivateSymbolToName() << ")"; 469 os << " (" << PrivateSymbolToName() << ")";
470 } 470 }
471 os << "\n - private: " << is_private(); 471 os << "\n - private: " << is_private();
472 os << "\n"; 472 os << "\n";
473 } 473 }
474 474
475 475
476 void Map::MapPrint(std::ostream& os) { // NOLINT 476 void Map::MapPrint(std::ostream& os) { // NOLINT
477 HeapObject::PrintHeader(os, "Map"); 477 HeapObject::PrintHeader(os, "Map");
478 os << "\n - type: " << instance_type(); 478 os << "\n - type: " << instance_type();
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 1215
1216 #if TRACE_MAPS 1216 #if TRACE_MAPS
1217 1217
1218 1218
1219 void Name::NameShortPrint() { 1219 void Name::NameShortPrint() {
1220 if (this->IsString()) { 1220 if (this->IsString()) {
1221 PrintF("%s", String::cast(this)->ToCString().get()); 1221 PrintF("%s", String::cast(this)->ToCString().get());
1222 } else { 1222 } else {
1223 DCHECK(this->IsSymbol()); 1223 DCHECK(this->IsSymbol());
1224 Symbol* s = Symbol::cast(this); 1224 Symbol* s = Symbol::cast(this);
1225 if (s->name()->IsUndefined()) { 1225 if (s->name()->IsUndefined(GetIsolate())) {
1226 PrintF("#<%s>", s->PrivateSymbolToName()); 1226 PrintF("#<%s>", s->PrivateSymbolToName());
1227 } else { 1227 } else {
1228 PrintF("<%s>", String::cast(s->name())->ToCString().get()); 1228 PrintF("<%s>", String::cast(s->name())->ToCString().get());
1229 } 1229 }
1230 } 1230 }
1231 } 1231 }
1232 1232
1233 1233
1234 int Name::NameShortPrint(Vector<char> str) { 1234 int Name::NameShortPrint(Vector<char> str) {
1235 if (this->IsString()) { 1235 if (this->IsString()) {
1236 return SNPrintF(str, "%s", String::cast(this)->ToCString().get()); 1236 return SNPrintF(str, "%s", String::cast(this)->ToCString().get());
1237 } else { 1237 } else {
1238 DCHECK(this->IsSymbol()); 1238 DCHECK(this->IsSymbol());
1239 Symbol* s = Symbol::cast(this); 1239 Symbol* s = Symbol::cast(this);
1240 if (s->name()->IsUndefined()) { 1240 if (s->name()->IsUndefined(GetIsolate())) {
1241 return SNPrintF(str, "#<%s>", s->PrivateSymbolToName()); 1241 return SNPrintF(str, "#<%s>", s->PrivateSymbolToName());
1242 } else { 1242 } else {
1243 return SNPrintF(str, "<%s>", String::cast(s->name())->ToCString().get()); 1243 return SNPrintF(str, "<%s>", String::cast(s->name())->ToCString().get());
1244 } 1244 }
1245 } 1245 }
1246 } 1246 }
1247 1247
1248 1248
1249 #endif // TRACE_MAPS 1249 #endif // TRACE_MAPS
1250 1250
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1341 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT 1341 void JSObject::PrintTransitions(std::ostream& os) { // NOLINT
1342 Object* transitions = map()->raw_transitions(); 1342 Object* transitions = map()->raw_transitions();
1343 int num_transitions = TransitionArray::NumberOfTransitions(transitions); 1343 int num_transitions = TransitionArray::NumberOfTransitions(transitions);
1344 if (num_transitions == 0) return; 1344 if (num_transitions == 0) return;
1345 os << "\n - transitions"; 1345 os << "\n - transitions";
1346 TransitionArray::PrintTransitions(os, transitions, false); 1346 TransitionArray::PrintTransitions(os, transitions, false);
1347 } 1347 }
1348 #endif // defined(DEBUG) || defined(OBJECT_PRINT) 1348 #endif // defined(DEBUG) || defined(OBJECT_PRINT)
1349 } // namespace internal 1349 } // namespace internal
1350 } // namespace v8 1350 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/ppc/code-stubs-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698