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 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1392 | 1392 |
1393 CompilationCache* compilation_cache = isolate->compilation_cache(); | 1393 CompilationCache* compilation_cache = isolate->compilation_cache(); |
1394 MaybeHandle<SharedFunctionInfo> maybe_shared_info = | 1394 MaybeHandle<SharedFunctionInfo> maybe_shared_info = |
1395 compilation_cache->LookupEval(source, outer_info, context, language_mode, | 1395 compilation_cache->LookupEval(source, outer_info, context, language_mode, |
1396 eval_scope_position); | 1396 eval_scope_position); |
1397 Handle<SharedFunctionInfo> shared_info; | 1397 Handle<SharedFunctionInfo> shared_info; |
1398 | 1398 |
1399 Handle<Script> script; | 1399 Handle<Script> script; |
1400 if (!maybe_shared_info.ToHandle(&shared_info)) { | 1400 if (!maybe_shared_info.ToHandle(&shared_info)) { |
1401 script = isolate->factory()->NewScript(source); | 1401 script = isolate->factory()->NewScript(source); |
| 1402 if (FLAG_trace_deopt) Script::InitLineEnds(script); |
1402 if (!script_name.is_null()) { | 1403 if (!script_name.is_null()) { |
1403 script->set_name(*script_name); | 1404 script->set_name(*script_name); |
1404 script->set_line_offset(line_offset); | 1405 script->set_line_offset(line_offset); |
1405 script->set_column_offset(column_offset); | 1406 script->set_column_offset(column_offset); |
1406 } | 1407 } |
1407 script->set_origin_options(options); | 1408 script->set_origin_options(options); |
1408 script->set_compilation_type(Script::COMPILATION_TYPE_EVAL); | 1409 script->set_compilation_type(Script::COMPILATION_TYPE_EVAL); |
1409 Script::SetEvalOrigin(script, outer_info, eval_position); | 1410 Script::SetEvalOrigin(script, outer_info, eval_position); |
1410 | 1411 |
1411 Zone zone(isolate->allocator(), ZONE_NAME); | 1412 Zone zone(isolate->allocator(), ZONE_NAME); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1551 timer.Start(); | 1552 timer.Start(); |
1552 } | 1553 } |
1553 | 1554 |
1554 if (!maybe_result.ToHandle(&result) || | 1555 if (!maybe_result.ToHandle(&result) || |
1555 (FLAG_serialize_toplevel && | 1556 (FLAG_serialize_toplevel && |
1556 compile_options == ScriptCompiler::kProduceCodeCache)) { | 1557 compile_options == ScriptCompiler::kProduceCodeCache)) { |
1557 // No cache entry found, or embedder wants a code cache. Compile the script. | 1558 // No cache entry found, or embedder wants a code cache. Compile the script. |
1558 | 1559 |
1559 // Create a script object describing the script to be compiled. | 1560 // Create a script object describing the script to be compiled. |
1560 Handle<Script> script = isolate->factory()->NewScript(source); | 1561 Handle<Script> script = isolate->factory()->NewScript(source); |
| 1562 if (FLAG_trace_deopt) Script::InitLineEnds(script); |
1561 if (natives == NATIVES_CODE) { | 1563 if (natives == NATIVES_CODE) { |
1562 script->set_type(Script::TYPE_NATIVE); | 1564 script->set_type(Script::TYPE_NATIVE); |
1563 script->set_hide_source(true); | 1565 script->set_hide_source(true); |
1564 } else if (natives == EXTENSION_CODE) { | 1566 } else if (natives == EXTENSION_CODE) { |
1565 script->set_type(Script::TYPE_EXTENSION); | 1567 script->set_type(Script::TYPE_EXTENSION); |
1566 script->set_hide_source(true); | 1568 script->set_hide_source(true); |
1567 } | 1569 } |
1568 if (!script_name.is_null()) { | 1570 if (!script_name.is_null()) { |
1569 script->set_name(*script_name); | 1571 script->set_name(*script_name); |
1570 script->set_line_offset(line_offset); | 1572 script->set_line_offset(line_offset); |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1824 DCHECK(shared->is_compiled()); | 1826 DCHECK(shared->is_compiled()); |
1825 function->set_literals(cached.literals); | 1827 function->set_literals(cached.literals); |
1826 } else if (shared->is_compiled()) { | 1828 } else if (shared->is_compiled()) { |
1827 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1829 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1828 JSFunction::EnsureLiterals(function); | 1830 JSFunction::EnsureLiterals(function); |
1829 } | 1831 } |
1830 } | 1832 } |
1831 | 1833 |
1832 } // namespace internal | 1834 } // namespace internal |
1833 } // namespace v8 | 1835 } // namespace v8 |
OLD | NEW |