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/compiler.h" | 5 #include "src/compiler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "src/ast/ast-numbering.h" | 9 #include "src/ast/ast-numbering.h" |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1515 } | 1515 } |
1516 if (!script_name.is_null()) { | 1516 if (!script_name.is_null()) { |
1517 script->set_name(*script_name); | 1517 script->set_name(*script_name); |
1518 script->set_line_offset(line_offset); | 1518 script->set_line_offset(line_offset); |
1519 script->set_column_offset(column_offset); | 1519 script->set_column_offset(column_offset); |
1520 } | 1520 } |
1521 script->set_origin_options(resource_options); | 1521 script->set_origin_options(resource_options); |
1522 if (!source_map_url.is_null()) { | 1522 if (!source_map_url.is_null()) { |
1523 script->set_source_mapping_url(*source_map_url); | 1523 script->set_source_mapping_url(*source_map_url); |
1524 } | 1524 } |
1525 script->set_is_module(is_module); | |
1525 | 1526 |
1526 // Compile the function and add it to the cache. | 1527 // Compile the function and add it to the cache. |
1527 Zone zone(isolate->allocator()); | 1528 Zone zone(isolate->allocator()); |
1528 ParseInfo parse_info(&zone, script); | 1529 ParseInfo parse_info(&zone, script); |
1529 CompilationInfo info(&parse_info, Handle<JSFunction>::null()); | 1530 CompilationInfo info(&parse_info, Handle<JSFunction>::null()); |
1530 if (is_module) { | |
1531 parse_info.set_module(); | |
1532 } else { | |
1533 parse_info.set_global(); | |
1534 } | |
vogelheim
2016/06/14 15:20:49
You've moved this into the ParseInfo constructor.
mike3
2016/06/19 16:58:59
Acknowledged.
| |
1535 if (compile_options != ScriptCompiler::kNoCompileOptions) { | 1531 if (compile_options != ScriptCompiler::kNoCompileOptions) { |
1536 parse_info.set_cached_data(cached_data); | 1532 parse_info.set_cached_data(cached_data); |
1537 } | 1533 } |
1538 parse_info.set_compile_options(compile_options); | 1534 parse_info.set_compile_options(compile_options); |
1539 parse_info.set_extension(extension); | 1535 parse_info.set_extension(extension); |
1540 parse_info.set_context(context); | 1536 parse_info.set_context(context); |
1541 if (FLAG_serialize_toplevel && | 1537 if (FLAG_serialize_toplevel && |
1542 compile_options == ScriptCompiler::kProduceCodeCache) { | 1538 compile_options == ScriptCompiler::kProduceCodeCache) { |
1543 info.PrepareForSerializing(); | 1539 info.PrepareForSerializing(); |
1544 } | 1540 } |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1805 DCHECK(shared->is_compiled()); | 1801 DCHECK(shared->is_compiled()); |
1806 function->set_literals(cached.literals); | 1802 function->set_literals(cached.literals); |
1807 } else if (shared->is_compiled()) { | 1803 } else if (shared->is_compiled()) { |
1808 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1804 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1809 JSFunction::EnsureLiterals(function); | 1805 JSFunction::EnsureLiterals(function); |
1810 } | 1806 } |
1811 } | 1807 } |
1812 | 1808 |
1813 } // namespace internal | 1809 } // namespace internal |
1814 } // namespace v8 | 1810 } // namespace v8 |
OLD | NEW |