OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 bool only_simple_this_property_assignments_; | 529 bool only_simple_this_property_assignments_; |
530 Handle<FixedArray> this_property_assignments_; | 530 Handle<FixedArray> this_property_assignments_; |
531 | 531 |
532 Parser* parser_; | 532 Parser* parser_; |
533 FunctionState* outer_function_state_; | 533 FunctionState* outer_function_state_; |
534 Scope* outer_scope_; | 534 Scope* outer_scope_; |
535 int saved_ast_node_id_; | 535 int saved_ast_node_id_; |
536 AstNodeFactory<AstConstructionVisitor> factory_; | 536 AstNodeFactory<AstConstructionVisitor> factory_; |
537 }; | 537 }; |
538 | 538 |
| 539 class ParsingModeScope BASE_EMBEDDED { |
| 540 public: |
| 541 ParsingModeScope(Parser* parser, Mode mode) |
| 542 : parser_(parser), |
| 543 old_mode_(parser->mode()) { |
| 544 parser_->mode_ = mode; |
| 545 } |
| 546 ~ParsingModeScope() { |
| 547 parser_->mode_ = old_mode_; |
| 548 } |
539 | 549 |
540 | 550 private: |
| 551 Parser* parser_; |
| 552 Mode old_mode_; |
| 553 }; |
541 | 554 |
542 FunctionLiteral* ParseLazy(Utf16CharacterStream* source, | 555 FunctionLiteral* ParseLazy(Utf16CharacterStream* source, |
543 ZoneScope* zone_scope); | 556 ZoneScope* zone_scope); |
544 | 557 |
545 Isolate* isolate() { return isolate_; } | 558 Isolate* isolate() { return isolate_; } |
546 Zone* zone() const { return zone_; } | 559 Zone* zone() const { return zone_; } |
547 CompilationInfo* info() const { return info_; } | 560 CompilationInfo* info() const { return info_; } |
548 | 561 |
549 // Called by ParseProgram after setting up the scanner. | 562 // Called by ParseProgram after setting up the scanner. |
550 FunctionLiteral* DoParseProgram(CompilationInfo* info, | 563 FunctionLiteral* DoParseProgram(CompilationInfo* info, |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 private: | 878 private: |
866 static const int kTypeSlot = 0; | 879 static const int kTypeSlot = 0; |
867 static const int kElementsSlot = 1; | 880 static const int kElementsSlot = 1; |
868 | 881 |
869 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 882 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
870 }; | 883 }; |
871 | 884 |
872 } } // namespace v8::internal | 885 } } // namespace v8::internal |
873 | 886 |
874 #endif // V8_PARSER_H_ | 887 #endif // V8_PARSER_H_ |
OLD | NEW |