| Index: src/parser.h
|
| diff --git a/src/parser.h b/src/parser.h
|
| index 74f3944718f54b254d7b8aeebbcd3d39f34dbce7..b29064b5b2fe0e71cd5bdd405aa73466fafbf162 100644
|
| --- a/src/parser.h
|
| +++ b/src/parser.h
|
| @@ -26,6 +26,8 @@ class Target;
|
| template <typename T> class ZoneListWrapper;
|
|
|
|
|
| +// An entry in ScriptData containing everything we need to know to skip over a
|
| +// lazily-parsed function body.
|
| class FunctionEntry BASE_EMBEDDED {
|
| public:
|
| enum {
|
| @@ -34,6 +36,8 @@ class FunctionEntry BASE_EMBEDDED {
|
| kLiteralCountIndex,
|
| kPropertyCountIndex,
|
| kStrictModeIndex,
|
| + kCallsEvalIndex,
|
| + kIdentifierCountIndex,
|
| kSize
|
| };
|
|
|
| @@ -42,6 +46,30 @@ class FunctionEntry BASE_EMBEDDED {
|
|
|
| FunctionEntry() : backing_() { }
|
|
|
| + // Get the length (number of unsigned ints) of this FunctionEntry.
|
| + // This requires walking through all the identifiers in the FunctionEntry, so
|
| + // Size() is not a trivial accessor, and is typically only called once for
|
| + // each FunctionEntry.
|
| + int Size();
|
| +
|
| + class IdentifierIterator {
|
| + friend class FunctionEntry;
|
| +
|
| + public:
|
| + const AstRawString* Next(AstValueFactory* ast_value_factory);
|
| +
|
| + bool AtEnd() { return backing_.is_empty(); }
|
| +
|
| + private:
|
| + explicit IdentifierIterator(Vector<unsigned> backing) : backing_(backing) {}
|
| +
|
| + Vector<unsigned> backing_;
|
| + };
|
| +
|
| + IdentifierIterator Identifiers() {
|
| + return IdentifierIterator(backing_.SubVector(kSize, Size()));
|
| + }
|
| +
|
| int start_pos() { return backing_[kStartPositionIndex]; }
|
| int end_pos() { return backing_[kEndPositionIndex]; }
|
| int literal_count() { return backing_[kLiteralCountIndex]; }
|
| @@ -51,6 +79,9 @@ class FunctionEntry BASE_EMBEDDED {
|
| backing_[kStrictModeIndex] == STRICT);
|
| return static_cast<StrictMode>(backing_[kStrictModeIndex]);
|
| }
|
| + bool calls_eval() { return static_cast<bool>(backing_[kCallsEvalIndex]); }
|
| +
|
| + int identifier_count() { return backing_[kIdentifierCountIndex]; }
|
|
|
| bool is_valid() { return !backing_.is_empty(); }
|
|
|
| @@ -355,7 +386,6 @@ class ParserTraits {
|
| inline static Scope* ptr_to_scope(ScopePtr scope) { return scope; }
|
|
|
| typedef Variable GeneratorVariable;
|
| - typedef v8::internal::Zone Zone;
|
|
|
| typedef v8::internal::AstProperties AstProperties;
|
| typedef Vector<VariableProxy*> ParameterIdentifierVector;
|
| @@ -448,6 +478,8 @@ class ParserTraits {
|
| // in an assignment or with a increment/decrement operator.
|
| static Expression* MarkExpressionAsAssigned(Expression* expression);
|
|
|
| + static void RecordCurrentSymbolAsIdentifierExpression() {}
|
| +
|
| // Returns true if we have a binary expression between two numeric
|
| // literals. In that case, *x will be changed to an expression which is the
|
| // computed value.
|
|
|