| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 class IterationStatement: public BreakableStatement { | 376 class IterationStatement: public BreakableStatement { |
| 377 public: | 377 public: |
| 378 // Type testing & conversion. | 378 // Type testing & conversion. |
| 379 virtual IterationStatement* AsIterationStatement() { return this; } | 379 virtual IterationStatement* AsIterationStatement() { return this; } |
| 380 | 380 |
| 381 Statement* body() const { return body_; } | 381 Statement* body() const { return body_; } |
| 382 | 382 |
| 383 // Bailout support. | 383 // Bailout support. |
| 384 int OsrEntryId() const { return osr_entry_id_; } | 384 int OsrEntryId() const { return osr_entry_id_; } |
| 385 virtual int ContinueId() const = 0; | 385 virtual int ContinueId() const = 0; |
| 386 virtual int StackCheckId() const = 0; |
| 386 | 387 |
| 387 // Code generation | 388 // Code generation |
| 388 Label* continue_target() { return &continue_target_; } | 389 Label* continue_target() { return &continue_target_; } |
| 389 | 390 |
| 390 protected: | 391 protected: |
| 391 explicit inline IterationStatement(ZoneStringList* labels); | 392 explicit inline IterationStatement(ZoneStringList* labels); |
| 392 | 393 |
| 393 void Initialize(Statement* body) { | 394 void Initialize(Statement* body) { |
| 394 body_ = body; | 395 body_ = body; |
| 395 } | 396 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 414 | 415 |
| 415 Expression* cond() const { return cond_; } | 416 Expression* cond() const { return cond_; } |
| 416 | 417 |
| 417 // Position where condition expression starts. We need it to make | 418 // Position where condition expression starts. We need it to make |
| 418 // the loop's condition a breakable location. | 419 // the loop's condition a breakable location. |
| 419 int condition_position() { return condition_position_; } | 420 int condition_position() { return condition_position_; } |
| 420 void set_condition_position(int pos) { condition_position_ = pos; } | 421 void set_condition_position(int pos) { condition_position_ = pos; } |
| 421 | 422 |
| 422 // Bailout support. | 423 // Bailout support. |
| 423 virtual int ContinueId() const { return continue_id_; } | 424 virtual int ContinueId() const { return continue_id_; } |
| 425 virtual int StackCheckId() const { return back_edge_id_; } |
| 424 int BackEdgeId() const { return back_edge_id_; } | 426 int BackEdgeId() const { return back_edge_id_; } |
| 425 | 427 |
| 426 virtual bool IsInlineable() const; | 428 virtual bool IsInlineable() const; |
| 427 | 429 |
| 428 private: | 430 private: |
| 429 Expression* cond_; | 431 Expression* cond_; |
| 430 int condition_position_; | 432 int condition_position_; |
| 431 int continue_id_; | 433 int continue_id_; |
| 432 int back_edge_id_; | 434 int back_edge_id_; |
| 433 }; | 435 }; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 448 bool may_have_function_literal() const { | 450 bool may_have_function_literal() const { |
| 449 return may_have_function_literal_; | 451 return may_have_function_literal_; |
| 450 } | 452 } |
| 451 void set_may_have_function_literal(bool value) { | 453 void set_may_have_function_literal(bool value) { |
| 452 may_have_function_literal_ = value; | 454 may_have_function_literal_ = value; |
| 453 } | 455 } |
| 454 virtual bool IsInlineable() const; | 456 virtual bool IsInlineable() const; |
| 455 | 457 |
| 456 // Bailout support. | 458 // Bailout support. |
| 457 virtual int ContinueId() const { return EntryId(); } | 459 virtual int ContinueId() const { return EntryId(); } |
| 460 virtual int StackCheckId() const { return body_id_; } |
| 458 int BodyId() const { return body_id_; } | 461 int BodyId() const { return body_id_; } |
| 459 | 462 |
| 460 private: | 463 private: |
| 461 Expression* cond_; | 464 Expression* cond_; |
| 462 // True if there is a function literal subexpression in the condition. | 465 // True if there is a function literal subexpression in the condition. |
| 463 bool may_have_function_literal_; | 466 bool may_have_function_literal_; |
| 464 int body_id_; | 467 int body_id_; |
| 465 }; | 468 }; |
| 466 | 469 |
| 467 | 470 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 487 | 490 |
| 488 bool may_have_function_literal() const { | 491 bool may_have_function_literal() const { |
| 489 return may_have_function_literal_; | 492 return may_have_function_literal_; |
| 490 } | 493 } |
| 491 void set_may_have_function_literal(bool value) { | 494 void set_may_have_function_literal(bool value) { |
| 492 may_have_function_literal_ = value; | 495 may_have_function_literal_ = value; |
| 493 } | 496 } |
| 494 | 497 |
| 495 // Bailout support. | 498 // Bailout support. |
| 496 virtual int ContinueId() const { return continue_id_; } | 499 virtual int ContinueId() const { return continue_id_; } |
| 500 virtual int StackCheckId() const { return body_id_; } |
| 497 int BodyId() const { return body_id_; } | 501 int BodyId() const { return body_id_; } |
| 498 | 502 |
| 499 bool is_fast_smi_loop() { return loop_variable_ != NULL; } | 503 bool is_fast_smi_loop() { return loop_variable_ != NULL; } |
| 500 Variable* loop_variable() { return loop_variable_; } | 504 Variable* loop_variable() { return loop_variable_; } |
| 501 void set_loop_variable(Variable* var) { loop_variable_ = var; } | 505 void set_loop_variable(Variable* var) { loop_variable_ = var; } |
| 502 virtual bool IsInlineable() const; | 506 virtual bool IsInlineable() const; |
| 503 | 507 |
| 504 private: | 508 private: |
| 505 Statement* init_; | 509 Statement* init_; |
| 506 Expression* cond_; | 510 Expression* cond_; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 525 enumerable_ = enumerable; | 529 enumerable_ = enumerable; |
| 526 } | 530 } |
| 527 | 531 |
| 528 Expression* each() const { return each_; } | 532 Expression* each() const { return each_; } |
| 529 Expression* enumerable() const { return enumerable_; } | 533 Expression* enumerable() const { return enumerable_; } |
| 530 virtual bool IsInlineable() const; | 534 virtual bool IsInlineable() const; |
| 531 | 535 |
| 532 // Bailout support. | 536 // Bailout support. |
| 533 int AssignmentId() const { return assignment_id_; } | 537 int AssignmentId() const { return assignment_id_; } |
| 534 virtual int ContinueId() const { return EntryId(); } | 538 virtual int ContinueId() const { return EntryId(); } |
| 539 virtual int StackCheckId() const { return EntryId(); } |
| 535 | 540 |
| 536 private: | 541 private: |
| 537 Expression* each_; | 542 Expression* each_; |
| 538 Expression* enumerable_; | 543 Expression* enumerable_; |
| 539 int assignment_id_; | 544 int assignment_id_; |
| 540 }; | 545 }; |
| 541 | 546 |
| 542 | 547 |
| 543 class ExpressionStatement: public Statement { | 548 class ExpressionStatement: public Statement { |
| 544 public: | 549 public: |
| (...skipping 1600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2145 | 2150 |
| 2146 private: | 2151 private: |
| 2147 Isolate* isolate_; | 2152 Isolate* isolate_; |
| 2148 bool stack_overflow_; | 2153 bool stack_overflow_; |
| 2149 }; | 2154 }; |
| 2150 | 2155 |
| 2151 | 2156 |
| 2152 } } // namespace v8::internal | 2157 } } // namespace v8::internal |
| 2153 | 2158 |
| 2154 #endif // V8_AST_H_ | 2159 #endif // V8_AST_H_ |
| OLD | NEW |