| 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/parsing/parser.h" | 5 #include "src/parsing/parser.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "src/api.h" | 9 #include "src/api.h" |
| 10 #include "src/ast/ast-expression-rewriter.h" | 10 #include "src/ast/ast-expression-rewriter.h" |
| (...skipping 3807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3818 | 3818 |
| 3819 bool Parser::Parse(ParseInfo* info) { | 3819 bool Parser::Parse(ParseInfo* info) { |
| 3820 DCHECK(info->literal() == NULL); | 3820 DCHECK(info->literal() == NULL); |
| 3821 FunctionLiteral* result = NULL; | 3821 FunctionLiteral* result = NULL; |
| 3822 // Ok to use Isolate here; this function is only called in the main thread. | 3822 // Ok to use Isolate here; this function is only called in the main thread. |
| 3823 DCHECK(parsing_on_main_thread_); | 3823 DCHECK(parsing_on_main_thread_); |
| 3824 Isolate* isolate = info->isolate(); | 3824 Isolate* isolate = info->isolate(); |
| 3825 pre_parse_timer_ = isolate->counters()->pre_parse(); | 3825 pre_parse_timer_ = isolate->counters()->pre_parse(); |
| 3826 | 3826 |
| 3827 if (!info->shared_info().is_null() && info->shared_info()->is_function()) { | 3827 if (!info->shared_info().is_null() && info->shared_info()->is_function()) { |
| 3828 DCHECK(!info->is_eval()); | |
| 3829 result = ParseLazy(isolate, info); | 3828 result = ParseLazy(isolate, info); |
| 3830 } else { | 3829 } else { |
| 3831 SetCachedData(info); | 3830 SetCachedData(info); |
| 3832 result = ParseProgram(isolate, info); | 3831 result = ParseProgram(isolate, info); |
| 3833 } | 3832 } |
| 3834 info->set_literal(result); | 3833 info->set_literal(result); |
| 3835 | 3834 |
| 3836 Internalize(isolate, info->script(), result == NULL); | 3835 Internalize(isolate, info->script(), result == NULL); |
| 3837 return (result != NULL); | 3836 return (result != NULL); |
| 3838 } | 3837 } |
| (...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5456 | 5455 |
| 5457 return final_loop; | 5456 return final_loop; |
| 5458 } | 5457 } |
| 5459 | 5458 |
| 5460 #undef CHECK_OK | 5459 #undef CHECK_OK |
| 5461 #undef CHECK_OK_VOID | 5460 #undef CHECK_OK_VOID |
| 5462 #undef CHECK_FAILED | 5461 #undef CHECK_FAILED |
| 5463 | 5462 |
| 5464 } // namespace internal | 5463 } // namespace internal |
| 5465 } // namespace v8 | 5464 } // namespace v8 |
| OLD | NEW |