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

Side by Side Diff: src/ast/prettyprinter.cc

Issue 2405253006: [builtins] implement Array.prototype[@@iterator] in TFJ builtins (Closed)
Patch Set: latest round Created 4 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
« no previous file with comments | « src/ast/ast-types.cc ('k') | src/bootstrapper.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/ast/prettyprinter.h" 5 #include "src/ast/prettyprinter.h"
6 6
7 #include <stdarg.h> 7 #include <stdarg.h>
8 8
9 #include "src/ast/ast-value-factory.h" 9 #include "src/ast/ast-value-factory.h"
10 #include "src/ast/scopes.h" 10 #include "src/ast/scopes.h"
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 } else if (object->IsJSArray()) { 522 } else if (object->IsJSArray()) {
523 Print("JS-array[%u]", 523 Print("JS-array[%u]",
524 Smi::cast(JSArray::cast(object)->length())->value()); 524 Smi::cast(JSArray::cast(object)->length())->value());
525 } else if (object->IsJSObject()) { 525 } else if (object->IsJSObject()) {
526 Print("JS-Object"); 526 Print("JS-Object");
527 } else { 527 } else {
528 Print("?UNKNOWN?"); 528 Print("?UNKNOWN?");
529 } 529 }
530 } else if (object->IsFixedArray()) { 530 } else if (object->IsFixedArray()) {
531 Print("FixedArray"); 531 Print("FixedArray");
532 } else if (object->IsSymbol()) {
533 // Symbols can only occur as literals if they were inserted by the parser.
534 Symbol* symbol = Symbol::cast(object);
535 if (symbol->name()->IsString()) {
536 int length = 0;
537 String* string = String::cast(symbol->name());
538 std::unique_ptr<char[]> desc = string->ToCString(
539 ALLOW_NULLS, FAST_STRING_TRAVERSAL, 0, string->length(), &length);
540 Print("Symbol(%*s)", length, desc.get());
541 } else {
542 Print("Symbol()");
543 }
532 } else { 544 } else {
533 Print("<unknown literal %p>", static_cast<void*>(object)); 545 Print("<unknown literal %p>", static_cast<void*>(object));
534 } 546 }
535 } 547 }
536 548
537 void AstPrinter::PrintLiteral(const AstRawString* value, bool quote) { 549 void AstPrinter::PrintLiteral(const AstRawString* value, bool quote) {
538 PrintLiteral(value->string(), quote); 550 PrintLiteral(value->string(), quote);
539 } 551 }
540 552
541 553
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
1190 1202
1191 void AstPrinter::VisitRewritableExpression(RewritableExpression* node) { 1203 void AstPrinter::VisitRewritableExpression(RewritableExpression* node) {
1192 Visit(node->expression()); 1204 Visit(node->expression());
1193 } 1205 }
1194 1206
1195 1207
1196 #endif // DEBUG 1208 #endif // DEBUG
1197 1209
1198 } // namespace internal 1210 } // namespace internal
1199 } // namespace v8 1211 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/ast-types.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698