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

Side by Side Diff: src/ast/ast-numbering.cc

Issue 2142333002: Refactor class declaration logic to the parser and runtime Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: minor cleanup per Adam Created 4 years, 5 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
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/ast-numbering.h" 5 #include "src/ast/ast-numbering.h"
6 6
7 #include "src/ast/ast.h" 7 #include "src/ast/ast.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 node->set_base_id(ReserveIdRange(ForStatement::num_ids())); 456 node->set_base_id(ReserveIdRange(ForStatement::num_ids()));
457 if (node->init() != NULL) Visit(node->init()); // Not part of loop. 457 if (node->init() != NULL) Visit(node->init()); // Not part of loop.
458 node->set_first_yield_id(yield_count_); 458 node->set_first_yield_id(yield_count_);
459 if (node->cond() != NULL) Visit(node->cond()); 459 if (node->cond() != NULL) Visit(node->cond());
460 if (node->next() != NULL) Visit(node->next()); 460 if (node->next() != NULL) Visit(node->next());
461 Visit(node->body()); 461 Visit(node->body());
462 node->set_yield_count(yield_count_ - node->first_yield_id()); 462 node->set_yield_count(yield_count_ - node->first_yield_id());
463 } 463 }
464 464
465 465
466 void AstNumberingVisitor::VisitClassLiteral(ClassLiteral* node) {
467 IncrementNodeCount();
468 DisableCrankshaft(kClassLiteral);
469 node->set_base_id(ReserveIdRange(node->num_ids()));
470 if (node->extends()) Visit(node->extends());
471 if (node->constructor()) Visit(node->constructor());
472 if (node->class_variable_proxy()) {
473 VisitVariableProxy(node->class_variable_proxy());
474 }
475 for (int i = 0; i < node->properties()->length(); i++) {
476 VisitObjectLiteralProperty(node->properties()->at(i));
477 }
478 ReserveFeedbackSlots(node);
479 }
480
481
482 void AstNumberingVisitor::VisitObjectLiteral(ObjectLiteral* node) { 466 void AstNumberingVisitor::VisitObjectLiteral(ObjectLiteral* node) {
483 IncrementNodeCount(); 467 IncrementNodeCount();
484 node->set_base_id(ReserveIdRange(node->num_ids())); 468 node->set_base_id(ReserveIdRange(node->num_ids()));
485 for (int i = 0; i < node->properties()->length(); i++) { 469 for (int i = 0; i < node->properties()->length(); i++) {
486 VisitObjectLiteralProperty(node->properties()->at(i)); 470 VisitObjectLiteralProperty(node->properties()->at(i));
487 } 471 }
488 node->BuildConstantProperties(isolate_); 472 node->BuildConstantProperties(isolate_);
489 // Mark all computed expressions that are bound to a key that 473 // Mark all computed expressions that are bound to a key that
490 // is shadowed by a later occurrence of the same key. For the 474 // is shadowed by a later occurrence of the same key. For the
491 // marked expressions, no store code will be is emitted. 475 // marked expressions, no store code will be is emitted.
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 } 584 }
601 585
602 586
603 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, 587 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone,
604 FunctionLiteral* function) { 588 FunctionLiteral* function) {
605 AstNumberingVisitor visitor(isolate, zone); 589 AstNumberingVisitor visitor(isolate, zone);
606 return visitor.Renumber(function); 590 return visitor.Renumber(function);
607 } 591 }
608 } // namespace internal 592 } // namespace internal
609 } // namespace v8 593 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698