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 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/asmjs/asm-js.h" | 10 #include "src/asmjs/asm-js.h" |
(...skipping 1760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 // shared function info for this function literal has been created for the | 1771 // shared function info for this function literal has been created for the |
1772 // first time. It may have already been compiled previously. | 1772 // first time. It may have already been compiled previously. |
1773 result->set_never_compiled(outer_info->shared_info()->never_compiled()); | 1773 result->set_never_compiled(outer_info->shared_info()->never_compiled()); |
1774 } | 1774 } |
1775 | 1775 |
1776 Zone zone(isolate->allocator()); | 1776 Zone zone(isolate->allocator()); |
1777 ParseInfo parse_info(&zone, script); | 1777 ParseInfo parse_info(&zone, script); |
1778 CompilationInfo info(&parse_info, Handle<JSFunction>::null()); | 1778 CompilationInfo info(&parse_info, Handle<JSFunction>::null()); |
1779 parse_info.set_literal(literal); | 1779 parse_info.set_literal(literal); |
1780 parse_info.set_shared_info(result); | 1780 parse_info.set_shared_info(result); |
1781 parse_info.set_scope(literal->scope()); | |
1782 parse_info.set_language_mode(literal->scope()->language_mode()); | 1781 parse_info.set_language_mode(literal->scope()->language_mode()); |
1783 if (outer_info->will_serialize()) info.PrepareForSerializing(); | 1782 if (outer_info->will_serialize()) info.PrepareForSerializing(); |
1784 if (outer_info->is_debug()) info.MarkAsDebug(); | 1783 if (outer_info->is_debug()) info.MarkAsDebug(); |
1785 | 1784 |
1786 // Determine if the function can be lazily compiled. This is necessary to | 1785 // Determine if the function can be lazily compiled. This is necessary to |
1787 // allow some of our builtin JS files to be lazily compiled. These | 1786 // allow some of our builtin JS files to be lazily compiled. These |
1788 // builtins cannot be handled lazily by the parser, since we have to know | 1787 // builtins cannot be handled lazily by the parser, since we have to know |
1789 // if a function uses the special natives syntax, which is something the | 1788 // if a function uses the special natives syntax, which is something the |
1790 // parser records. | 1789 // parser records. |
1791 // If the debugger requests compilation for break points, we cannot be | 1790 // If the debugger requests compilation for break points, we cannot be |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1945 DCHECK(shared->is_compiled()); | 1944 DCHECK(shared->is_compiled()); |
1946 function->set_literals(cached.literals); | 1945 function->set_literals(cached.literals); |
1947 } else if (shared->is_compiled()) { | 1946 } else if (shared->is_compiled()) { |
1948 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1947 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1949 JSFunction::EnsureLiterals(function); | 1948 JSFunction::EnsureLiterals(function); |
1950 } | 1949 } |
1951 } | 1950 } |
1952 | 1951 |
1953 } // namespace internal | 1952 } // namespace internal |
1954 } // namespace v8 | 1953 } // namespace v8 |
OLD | NEW |