| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 set_strong_mode(language_mode & STRONG_BIT); | 144 set_strong_mode(language_mode & STRONG_BIT); |
| 145 } | 145 } |
| 146 | 146 |
| 147 void ReopenHandlesInNewHandleScope() { | 147 void ReopenHandlesInNewHandleScope() { |
| 148 closure_ = Handle<JSFunction>(*closure_); | 148 closure_ = Handle<JSFunction>(*closure_); |
| 149 shared_ = Handle<SharedFunctionInfo>(*shared_); | 149 shared_ = Handle<SharedFunctionInfo>(*shared_); |
| 150 script_ = Handle<Script>(*script_); | 150 script_ = Handle<Script>(*script_); |
| 151 context_ = Handle<Context>(*context_); | 151 context_ = Handle<Context>(*context_); |
| 152 } | 152 } |
| 153 | 153 |
| 154 #ifdef DEBUG |
| 155 bool script_is_native() { return script_->type() == Script::TYPE_NATIVE; } |
| 156 #endif // DEBUG |
| 157 |
| 154 private: | 158 private: |
| 155 // Various configuration flags for parsing. | 159 // Various configuration flags for parsing. |
| 156 enum Flag { | 160 enum Flag { |
| 157 // ---------- Input flags --------------------------- | 161 // ---------- Input flags --------------------------- |
| 158 kToplevel = 1 << 0, | 162 kToplevel = 1 << 0, |
| 159 kLazy = 1 << 1, | 163 kLazy = 1 << 1, |
| 160 kEval = 1 << 2, | 164 kEval = 1 << 2, |
| 161 kGlobal = 1 << 3, | 165 kGlobal = 1 << 3, |
| 162 kStrictMode = 1 << 4, | 166 kStrictMode = 1 << 4, |
| 163 kStrongMode = 1 << 5, | 167 kStrongMode = 1 << 5, |
| (...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1403 | 1407 |
| 1404 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { | 1408 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { |
| 1405 return parser_->ParseDoExpression(ok); | 1409 return parser_->ParseDoExpression(ok); |
| 1406 } | 1410 } |
| 1407 | 1411 |
| 1408 | 1412 |
| 1409 } // namespace internal | 1413 } // namespace internal |
| 1410 } // namespace v8 | 1414 } // namespace v8 |
| 1411 | 1415 |
| 1412 #endif // V8_PARSING_PARSER_H_ | 1416 #endif // V8_PARSING_PARSER_H_ |
| OLD | NEW |