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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 | 420 |
421 // Return types for traversing functions. | 421 // Return types for traversing functions. |
422 typedef Handle<String> Identifier; | 422 typedef Handle<String> Identifier; |
423 typedef v8::internal::Expression* Expression; | 423 typedef v8::internal::Expression* Expression; |
424 typedef ZoneList<v8::internal::Expression*>* ExpressionList; | 424 typedef ZoneList<v8::internal::Expression*>* ExpressionList; |
425 }; | 425 }; |
426 | 426 |
427 explicit ParserTraits(Parser* parser) : parser_(parser) {} | 427 explicit ParserTraits(Parser* parser) : parser_(parser) {} |
428 | 428 |
429 // Custom operations executed when FunctionStates are created and destructed. | 429 // Custom operations executed when FunctionStates are created and destructed. |
430 template<typename FS> | 430 template<typename FunctionState> |
431 static void SetUpFunctionState(FS* function_state, Zone* zone) { | 431 static void SetUpFunctionState(FunctionState* function_state, Zone* zone) { |
432 Isolate* isolate = zone->isolate(); | 432 Isolate* isolate = zone->isolate(); |
433 function_state->isolate_ = isolate; | 433 function_state->isolate_ = isolate; |
434 function_state->saved_ast_node_id_ = isolate->ast_node_id(); | 434 function_state->saved_ast_node_id_ = isolate->ast_node_id(); |
435 isolate->set_ast_node_id(BailoutId::FirstUsable().ToInt()); | 435 isolate->set_ast_node_id(BailoutId::FirstUsable().ToInt()); |
436 } | 436 } |
437 | 437 |
438 template<typename FS> | 438 template<typename FunctionState> |
439 static void TearDownFunctionState(FS* function_state) { | 439 static void TearDownFunctionState(FunctionState* function_state) { |
440 if (function_state->outer_function_state_ != NULL) { | 440 if (function_state->outer_function_state_ != NULL) { |
441 function_state->isolate_->set_ast_node_id( | 441 function_state->isolate_->set_ast_node_id( |
442 function_state->saved_ast_node_id_); | 442 function_state->saved_ast_node_id_); |
443 } | 443 } |
444 } | 444 } |
445 | 445 |
446 // Helper functions for recursive descent. | 446 // Helper functions for recursive descent. |
447 bool IsEvalOrArguments(Handle<String> identifier) const; | 447 bool IsEvalOrArguments(Handle<String> identifier) const; |
448 | 448 |
449 // Reporting errors. | 449 // Reporting errors. |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 private: | 786 private: |
787 static const int kLiteralTypeSlot = 0; | 787 static const int kLiteralTypeSlot = 0; |
788 static const int kElementsSlot = 1; | 788 static const int kElementsSlot = 1; |
789 | 789 |
790 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 790 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
791 }; | 791 }; |
792 | 792 |
793 } } // namespace v8::internal | 793 } } // namespace v8::internal |
794 | 794 |
795 #endif // V8_PARSER_H_ | 795 #endif // V8_PARSER_H_ |
OLD | NEW |