| 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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 | 545 |
| 546 // Decide if a property should be in the object boilerplate. | 546 // Decide if a property should be in the object boilerplate. |
| 547 bool IsBoilerplateProperty(ObjectLiteral::Property* property); | 547 bool IsBoilerplateProperty(ObjectLiteral::Property* property); |
| 548 // If the expression is a literal, return the literal value; | 548 // If the expression is a literal, return the literal value; |
| 549 // if the expression is a materialized literal and is simple return a | 549 // if the expression is a materialized literal and is simple return a |
| 550 // compile time value as encoded by CompileTimeValue::GetValue(). | 550 // compile time value as encoded by CompileTimeValue::GetValue(). |
| 551 // Otherwise, return undefined literal as the placeholder | 551 // Otherwise, return undefined literal as the placeholder |
| 552 // in the object literal boilerplate. | 552 // in the object literal boilerplate. |
| 553 Handle<Object> GetBoilerplateValue(Expression* expression); | 553 Handle<Object> GetBoilerplateValue(Expression* expression); |
| 554 | 554 |
| 555 enum FunctionLiteralType { | |
| 556 EXPRESSION, | |
| 557 DECLARATION | |
| 558 }; | |
| 559 | |
| 560 ZoneList<Expression*>* ParseArguments(bool* ok); | 555 ZoneList<Expression*>* ParseArguments(bool* ok); |
| 561 FunctionLiteral* ParseFunctionLiteral(Handle<String> var_name, | 556 FunctionLiteral* ParseFunctionLiteral(Handle<String> var_name, |
| 562 bool name_is_reserved, | 557 bool name_is_reserved, |
| 563 int function_token_position, | 558 int function_token_position, |
| 564 FunctionLiteralType type, | 559 FunctionLiteral::Type type, |
| 565 bool* ok); | 560 bool* ok); |
| 566 | 561 |
| 567 | 562 |
| 568 // Magical syntax support. | 563 // Magical syntax support. |
| 569 Expression* ParseV8Intrinsic(bool* ok); | 564 Expression* ParseV8Intrinsic(bool* ok); |
| 570 | 565 |
| 571 INLINE(Token::Value peek()) { | 566 INLINE(Token::Value peek()) { |
| 572 if (stack_overflow_) return Token::ILLEGAL; | 567 if (stack_overflow_) return Token::ILLEGAL; |
| 573 return scanner().peek(); | 568 return scanner().peek(); |
| 574 } | 569 } |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 private: | 746 private: |
| 752 static const int kTypeSlot = 0; | 747 static const int kTypeSlot = 0; |
| 753 static const int kElementsSlot = 1; | 748 static const int kElementsSlot = 1; |
| 754 | 749 |
| 755 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 750 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
| 756 }; | 751 }; |
| 757 | 752 |
| 758 } } // namespace v8::internal | 753 } } // namespace v8::internal |
| 759 | 754 |
| 760 #endif // V8_PARSER_H_ | 755 #endif // V8_PARSER_H_ |
| OLD | NEW |