| 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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 | 401 |
| 402 // ---------------------------------------------------------------------------- | 402 // ---------------------------------------------------------------------------- |
| 403 // JAVASCRIPT PARSING | 403 // JAVASCRIPT PARSING |
| 404 | 404 |
| 405 class Parser; | 405 class Parser; |
| 406 class SingletonLogger; | 406 class SingletonLogger; |
| 407 | 407 |
| 408 class ParserTraits { | 408 class ParserTraits { |
| 409 public: | 409 public: |
| 410 struct Type { | 410 struct Type { |
| 411 // TODO(marja): To be removed. The Traits object should contain all the data |
| 412 // it needs. |
| 411 typedef v8::internal::Parser* Parser; | 413 typedef v8::internal::Parser* Parser; |
| 412 | 414 |
| 413 // Types used by FunctionState and BlockState. | 415 // Used by FunctionState and BlockState. |
| 414 typedef v8::internal::Scope Scope; | 416 typedef v8::internal::Scope Scope; |
| 415 typedef AstNodeFactory<AstConstructionVisitor> Factory; | |
| 416 typedef Variable GeneratorVariable; | 417 typedef Variable GeneratorVariable; |
| 417 typedef v8::internal::Zone Zone; | 418 typedef v8::internal::Zone Zone; |
| 418 | 419 |
| 419 // Return types for traversing functions. | 420 // Return types for traversing functions. |
| 420 typedef Handle<String> Identifier; | 421 typedef Handle<String> Identifier; |
| 421 typedef v8::internal::Expression* Expression; | 422 typedef v8::internal::Expression* Expression; |
| 422 typedef v8::internal::FunctionLiteral* FunctionLiteral; | 423 typedef v8::internal::FunctionLiteral* FunctionLiteral; |
| 423 typedef v8::internal::Literal* Literal; | 424 typedef v8::internal::Literal* Literal; |
| 424 typedef ObjectLiteral::Property* ObjectLiteralProperty; | 425 typedef ObjectLiteral::Property* ObjectLiteralProperty; |
| 425 typedef ZoneList<v8::internal::Expression*>* ExpressionList; | 426 typedef ZoneList<v8::internal::Expression*>* ExpressionList; |
| 426 typedef ZoneList<ObjectLiteral::Property*>* PropertyList; | 427 typedef ZoneList<ObjectLiteral::Property*>* PropertyList; |
| 428 |
| 429 // For constructing objects returned by the traversing functions. |
| 430 typedef AstNodeFactory<AstConstructionVisitor> Factory; |
| 427 }; | 431 }; |
| 428 | 432 |
| 429 explicit ParserTraits(Parser* parser) : parser_(parser) {} | 433 explicit ParserTraits(Parser* parser) : parser_(parser) {} |
| 430 | 434 |
| 431 // Custom operations executed when FunctionStates are created and destructed. | 435 // Custom operations executed when FunctionStates are created and destructed. |
| 432 template<typename FunctionState> | 436 template<typename FunctionState> |
| 433 static void SetUpFunctionState(FunctionState* function_state, Zone* zone) { | 437 static void SetUpFunctionState(FunctionState* function_state, Zone* zone) { |
| 434 Isolate* isolate = zone->isolate(); | 438 Isolate* isolate = zone->isolate(); |
| 435 function_state->isolate_ = isolate; | 439 function_state->isolate_ = isolate; |
| 436 function_state->saved_ast_node_id_ = isolate->ast_node_id(); | 440 function_state->saved_ast_node_id_ = isolate->ast_node_id(); |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 private: | 813 private: |
| 810 static const int kLiteralTypeSlot = 0; | 814 static const int kLiteralTypeSlot = 0; |
| 811 static const int kElementsSlot = 1; | 815 static const int kElementsSlot = 1; |
| 812 | 816 |
| 813 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 817 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
| 814 }; | 818 }; |
| 815 | 819 |
| 816 } } // namespace v8::internal | 820 } } // namespace v8::internal |
| 817 | 821 |
| 818 #endif // V8_PARSER_H_ | 822 #endif // V8_PARSER_H_ |
| OLD | NEW |