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

Side by Side Diff: src/ast.h

Issue 307593002: Preliminary support for block contexts in hydrogen. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Port to other architectures Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/arm64/lithium-codegen-arm64.cc ('k') | src/full-codegen.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 #ifndef V8_AST_H_ 5 #ifndef V8_AST_H_
6 #define V8_AST_H_ 6 #define V8_AST_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/assembler.h" 10 #include "src/assembler.h"
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 public: 434 public:
435 DECLARE_NODE_TYPE(Block) 435 DECLARE_NODE_TYPE(Block)
436 436
437 void AddStatement(Statement* statement, Zone* zone) { 437 void AddStatement(Statement* statement, Zone* zone) {
438 statements_.Add(statement, zone); 438 statements_.Add(statement, zone);
439 } 439 }
440 440
441 ZoneList<Statement*>* statements() { return &statements_; } 441 ZoneList<Statement*>* statements() { return &statements_; }
442 bool is_initializer_block() const { return is_initializer_block_; } 442 bool is_initializer_block() const { return is_initializer_block_; }
443 443
444 BailoutId DeclsId() const { return decls_id_; }
445
444 virtual bool IsJump() const V8_OVERRIDE { 446 virtual bool IsJump() const V8_OVERRIDE {
445 return !statements_.is_empty() && statements_.last()->IsJump() 447 return !statements_.is_empty() && statements_.last()->IsJump()
446 && labels() == NULL; // Good enough as an approximation... 448 && labels() == NULL; // Good enough as an approximation...
447 } 449 }
448 450
449 Scope* scope() const { return scope_; } 451 Scope* scope() const { return scope_; }
450 void set_scope(Scope* scope) { scope_ = scope; } 452 void set_scope(Scope* scope) { scope_ = scope; }
451 453
452 protected: 454 protected:
453 Block(Zone* zone, 455 Block(Zone* zone,
454 ZoneStringList* labels, 456 ZoneStringList* labels,
455 int capacity, 457 int capacity,
456 bool is_initializer_block, 458 bool is_initializer_block,
457 int pos) 459 int pos)
458 : BreakableStatement(zone, labels, TARGET_FOR_NAMED_ONLY, pos), 460 : BreakableStatement(zone, labels, TARGET_FOR_NAMED_ONLY, pos),
459 statements_(capacity, zone), 461 statements_(capacity, zone),
460 is_initializer_block_(is_initializer_block), 462 is_initializer_block_(is_initializer_block),
463 decls_id_(GetNextId(zone)),
461 scope_(NULL) { 464 scope_(NULL) {
462 } 465 }
463 466
464 private: 467 private:
465 ZoneList<Statement*> statements_; 468 ZoneList<Statement*> statements_;
466 bool is_initializer_block_; 469 bool is_initializer_block_;
470 const BailoutId decls_id_;
467 Scope* scope_; 471 Scope* scope_;
468 }; 472 };
469 473
470 474
471 class Declaration : public AstNode { 475 class Declaration : public AstNode {
472 public: 476 public:
473 VariableProxy* proxy() const { return proxy_; } 477 VariableProxy* proxy() const { return proxy_; }
474 VariableMode mode() const { return mode_; } 478 VariableMode mode() const { return mode_; }
475 Scope* scope() const { return scope_; } 479 Scope* scope() const { return scope_; }
476 virtual InitializationFlag initialization() const = 0; 480 virtual InitializationFlag initialization() const = 0;
(...skipping 2857 matching lines...) Expand 10 before | Expand all | Expand 10 after
3334 3338
3335 private: 3339 private:
3336 Zone* zone_; 3340 Zone* zone_;
3337 Visitor visitor_; 3341 Visitor visitor_;
3338 }; 3342 };
3339 3343
3340 3344
3341 } } // namespace v8::internal 3345 } } // namespace v8::internal
3342 3346
3343 #endif // V8_AST_H_ 3347 #endif // V8_AST_H_
OLDNEW
« no previous file with comments | « src/arm64/lithium-codegen-arm64.cc ('k') | src/full-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698