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

Side by Side Diff: src/prettyprinter.cc

Issue 3031005: [Isolates] Avoid dereferencing Isolate::Current() to check oddball identities... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 10 years, 4 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-inl.h ('k') | src/runtime.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 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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 507
508 void PrettyPrinter::PrintLiteral(Handle<Object> value, bool quote) { 508 void PrettyPrinter::PrintLiteral(Handle<Object> value, bool quote) {
509 Object* object = *value; 509 Object* object = *value;
510 if (object->IsString()) { 510 if (object->IsString()) {
511 String* string = String::cast(object); 511 String* string = String::cast(object);
512 if (quote) Print("\""); 512 if (quote) Print("\"");
513 for (int i = 0; i < string->length(); i++) { 513 for (int i = 0; i < string->length(); i++) {
514 Print("%c", string->Get(i)); 514 Print("%c", string->Get(i));
515 } 515 }
516 if (quote) Print("\""); 516 if (quote) Print("\"");
517 } else if (object == HEAP->null_value()) { 517 } else if (object->IsNull()) {
518 Print("null"); 518 Print("null");
519 } else if (object == HEAP->true_value()) { 519 } else if (object->IsTrue()) {
520 Print("true"); 520 Print("true");
521 } else if (object == HEAP->false_value()) { 521 } else if (object->IsFalse()) {
522 Print("false"); 522 Print("false");
523 } else if (object == HEAP->undefined_value()) { 523 } else if (object->IsUndefined()) {
524 Print("undefined"); 524 Print("undefined");
525 } else if (object->IsNumber()) { 525 } else if (object->IsNumber()) {
526 Print("%g", object->Number()); 526 Print("%g", object->Number());
527 } else if (object->IsJSObject()) { 527 } else if (object->IsJSObject()) {
528 // regular expression 528 // regular expression
529 if (object->IsJSFunction()) { 529 if (object->IsJSFunction()) {
530 Print("JS-Function"); 530 Print("JS-Function");
531 } else if (object->IsJSArray()) { 531 } else if (object->IsJSArray()) {
532 Print("JS-array[%u]", JSArray::cast(object)->length()); 532 Print("JS-array[%u]", JSArray::cast(object)->length());
533 } else if (object->IsJSObject()) { 533 } else if (object->IsJSObject()) {
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after
1512 AddAttribute("mode", Variable::Mode2String(decl->mode())); 1512 AddAttribute("mode", Variable::Mode2String(decl->mode()));
1513 } 1513 }
1514 Visit(decl->proxy()); 1514 Visit(decl->proxy());
1515 if (decl->fun() != NULL) Visit(decl->fun()); 1515 if (decl->fun() != NULL) Visit(decl->fun());
1516 } 1516 }
1517 1517
1518 1518
1519 #endif // DEBUG 1519 #endif // DEBUG
1520 1520
1521 } } // namespace v8::internal 1521 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698