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 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
813 | 813 |
814 if (ok) { | 814 if (ok) { |
815 RewriteDestructuringAssignments(); | 815 RewriteDestructuringAssignments(); |
816 int parameter_count = parsing_module_ ? 1 : 0; | 816 int parameter_count = parsing_module_ ? 1 : 0; |
817 result = factory()->NewScriptOrEvalFunctionLiteral( | 817 result = factory()->NewScriptOrEvalFunctionLiteral( |
818 scope, body, function_state.materialized_literal_count(), | 818 scope, body, function_state.materialized_literal_count(), |
819 function_state.expected_property_count(), parameter_count); | 819 function_state.expected_property_count(), parameter_count); |
820 } | 820 } |
821 } | 821 } |
822 | 822 |
823 info->set_max_function_literal_id(GetLastFunctionLiteralId()); | |
Toon Verwaest
2016/12/06 21:10:14
Mmh. ParseInfo isn't exactly supposed to be a comm
jochen (gone - plz use gerrit)
2016/12/07 15:57:00
it's also what communicates the parsing result to
Toon Verwaest
2016/12/08 07:31:30
Oh ok.. buh. Follow-up cleanup then I guess...
Lan
| |
824 | |
823 // Make sure the target stack is empty. | 825 // Make sure the target stack is empty. |
824 DCHECK(target_stack_ == NULL); | 826 DCHECK(target_stack_ == NULL); |
825 | 827 |
826 return result; | 828 return result; |
827 } | 829 } |
828 | 830 |
829 FunctionLiteral* Parser::ParseFunction(Isolate* isolate, ParseInfo* info) { | 831 FunctionLiteral* Parser::ParseFunction(Isolate* isolate, ParseInfo* info) { |
830 // It's OK to use the Isolate & counters here, since this function is only | 832 // It's OK to use the Isolate & counters here, since this function is only |
831 // called in the main thread. | 833 // called in the main thread. |
832 DCHECK(parsing_on_main_thread_); | 834 DCHECK(parsing_on_main_thread_); |
(...skipping 4642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5475 | 5477 |
5476 return final_loop; | 5478 return final_loop; |
5477 } | 5479 } |
5478 | 5480 |
5479 #undef CHECK_OK | 5481 #undef CHECK_OK |
5480 #undef CHECK_OK_VOID | 5482 #undef CHECK_OK_VOID |
5481 #undef CHECK_FAILED | 5483 #undef CHECK_FAILED |
5482 | 5484 |
5483 } // namespace internal | 5485 } // namespace internal |
5484 } // namespace v8 | 5486 } // namespace v8 |
OLD | NEW |