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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/ast.h" | 8 #include "src/ast.h" |
9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 4808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4819 result->capture_count = capture_count; | 4819 result->capture_count = capture_count; |
4820 } | 4820 } |
4821 return !parser.failed(); | 4821 return !parser.failed(); |
4822 } | 4822 } |
4823 | 4823 |
4824 | 4824 |
4825 bool Parser::Parse() { | 4825 bool Parser::Parse() { |
4826 DCHECK(info()->function() == NULL); | 4826 DCHECK(info()->function() == NULL); |
4827 FunctionLiteral* result = NULL; | 4827 FunctionLiteral* result = NULL; |
4828 pre_parse_timer_ = isolate()->counters()->pre_parse(); | 4828 pre_parse_timer_ = isolate()->counters()->pre_parse(); |
4829 if (allow_natives_syntax() || extension_ != NULL) { | 4829 if (FLAG_trace_parse || allow_natives_syntax() || extension_ != NULL) { |
4830 // If intrinsics are allowed, the Parser cannot operate independent of the | 4830 // If intrinsics are allowed, the Parser cannot operate independent of the |
4831 // V8 heap because of Runtime. Tell the string table to internalize strings | 4831 // V8 heap because of Runtime. Tell the string table to internalize strings |
4832 // and values right after they're created. | 4832 // and values right after they're created. |
4833 ast_value_factory_->Internalize(isolate()); | 4833 ast_value_factory_->Internalize(isolate()); |
4834 } | 4834 } |
4835 | 4835 |
4836 if (info()->is_lazy()) { | 4836 if (info()->is_lazy()) { |
4837 DCHECK(!info()->is_eval()); | 4837 DCHECK(!info()->is_eval()); |
4838 if (info()->shared_info()->is_function()) { | 4838 if (info()->shared_info()->is_function()) { |
4839 result = ParseLazy(); | 4839 result = ParseLazy(); |
(...skipping 10 matching lines...) Expand all Loading... |
4850 DCHECK(ast_value_factory_->IsInternalized()); | 4850 DCHECK(ast_value_factory_->IsInternalized()); |
4851 // info takes ownership of ast_value_factory_. | 4851 // info takes ownership of ast_value_factory_. |
4852 if (info()->ast_value_factory() == NULL) { | 4852 if (info()->ast_value_factory() == NULL) { |
4853 info()->SetAstValueFactory(ast_value_factory_); | 4853 info()->SetAstValueFactory(ast_value_factory_); |
4854 } | 4854 } |
4855 ast_value_factory_ = NULL; | 4855 ast_value_factory_ = NULL; |
4856 return (result != NULL); | 4856 return (result != NULL); |
4857 } | 4857 } |
4858 | 4858 |
4859 } } // namespace v8::internal | 4859 } } // namespace v8::internal |
OLD | NEW |