OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_PARSING_PARSER_H_ | 5 #ifndef V8_PARSING_PARSER_H_ |
6 #define V8_PARSING_PARSER_H_ | 6 #define V8_PARSING_PARSER_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 //-------------------------------------------------------------------------- | 124 //-------------------------------------------------------------------------- |
125 // TODO(titzer): these should not be part of ParseInfo. | 125 // TODO(titzer): these should not be part of ParseInfo. |
126 //-------------------------------------------------------------------------- | 126 //-------------------------------------------------------------------------- |
127 Isolate* isolate() { return isolate_; } | 127 Isolate* isolate() { return isolate_; } |
128 Handle<JSFunction> closure() { return closure_; } | 128 Handle<JSFunction> closure() { return closure_; } |
129 Handle<SharedFunctionInfo> shared_info() { return shared_; } | 129 Handle<SharedFunctionInfo> shared_info() { return shared_; } |
130 Handle<Script> script() { return script_; } | 130 Handle<Script> script() { return script_; } |
131 Handle<Context> context() { return context_; } | 131 Handle<Context> context() { return context_; } |
132 void clear_script() { script_ = Handle<Script>::null(); } | 132 void clear_script() { script_ = Handle<Script>::null(); } |
133 void set_isolate(Isolate* isolate) { isolate_ = isolate; } | 133 void set_isolate(Isolate* isolate) { isolate_ = isolate; } |
| 134 void set_shared_info(Handle<SharedFunctionInfo> shared) { shared_ = shared; } |
134 void set_context(Handle<Context> context) { context_ = context; } | 135 void set_context(Handle<Context> context) { context_ = context; } |
135 void set_script(Handle<Script> script) { script_ = script; } | 136 void set_script(Handle<Script> script) { script_ = script; } |
136 //-------------------------------------------------------------------------- | 137 //-------------------------------------------------------------------------- |
137 | 138 |
138 LanguageMode language_mode() { | 139 LanguageMode language_mode() { |
139 return construct_language_mode(is_strict_mode()); | 140 return construct_language_mode(is_strict_mode()); |
140 } | 141 } |
141 void set_language_mode(LanguageMode language_mode) { | 142 void set_language_mode(LanguageMode language_mode) { |
142 STATIC_ASSERT(LANGUAGE_END == 3); | 143 STATIC_ASSERT(LANGUAGE_END == 3); |
143 set_strict_mode(is_strict(language_mode)); | 144 set_strict_mode(is_strict(language_mode)); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 AstValueFactory* ast_value_factory_; // used if available, otherwise new. | 196 AstValueFactory* ast_value_factory_; // used if available, otherwise new. |
196 | 197 |
197 //----------- Outputs of parsing and scope analysis ------------------------ | 198 //----------- Outputs of parsing and scope analysis ------------------------ |
198 FunctionLiteral* literal_; // produced by full parser. | 199 FunctionLiteral* literal_; // produced by full parser. |
199 Scope* scope_; // produced by scope analysis. | 200 Scope* scope_; // produced by scope analysis. |
200 | 201 |
201 void SetFlag(Flag f) { flags_ |= f; } | 202 void SetFlag(Flag f) { flags_ |= f; } |
202 void SetFlag(Flag f, bool v) { flags_ = v ? flags_ | f : flags_ & ~f; } | 203 void SetFlag(Flag f, bool v) { flags_ = v ? flags_ | f : flags_ & ~f; } |
203 bool GetFlag(Flag f) const { return (flags_ & f) != 0; } | 204 bool GetFlag(Flag f) const { return (flags_ & f) != 0; } |
204 | 205 |
205 void set_shared_info(Handle<SharedFunctionInfo> shared) { shared_ = shared; } | |
206 void set_closure(Handle<JSFunction> closure) { closure_ = closure; } | 206 void set_closure(Handle<JSFunction> closure) { closure_ = closure; } |
207 }; | 207 }; |
208 | 208 |
209 class FunctionEntry BASE_EMBEDDED { | 209 class FunctionEntry BASE_EMBEDDED { |
210 public: | 210 public: |
211 enum { | 211 enum { |
212 kStartPositionIndex, | 212 kStartPositionIndex, |
213 kEndPositionIndex, | 213 kEndPositionIndex, |
214 kLiteralCountIndex, | 214 kLiteralCountIndex, |
215 kPropertyCountIndex, | 215 kPropertyCountIndex, |
(...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1252 | 1252 |
1253 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { | 1253 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { |
1254 return parser_->ParseDoExpression(ok); | 1254 return parser_->ParseDoExpression(ok); |
1255 } | 1255 } |
1256 | 1256 |
1257 | 1257 |
1258 } // namespace internal | 1258 } // namespace internal |
1259 } // namespace v8 | 1259 } // namespace v8 |
1260 | 1260 |
1261 #endif // V8_PARSING_PARSER_H_ | 1261 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |