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 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileCode"); | 955 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"), "V8.CompileCode"); |
956 PostponeInterruptsScope postpone(isolate); | 956 PostponeInterruptsScope postpone(isolate); |
957 DCHECK(!isolate->native_context().is_null()); | 957 DCHECK(!isolate->native_context().is_null()); |
958 ParseInfo* parse_info = info->parse_info(); | 958 ParseInfo* parse_info = info->parse_info(); |
959 Handle<Script> script = parse_info->script(); | 959 Handle<Script> script = parse_info->script(); |
960 | 960 |
961 // TODO(svenpanne) Obscure place for this, perhaps move to OnBeforeCompile? | 961 // TODO(svenpanne) Obscure place for this, perhaps move to OnBeforeCompile? |
962 FixedArray* array = isolate->native_context()->embedder_data(); | 962 FixedArray* array = isolate->native_context()->embedder_data(); |
963 script->set_context_data(array->get(v8::Context::kDebugIdIndex)); | 963 script->set_context_data(array->get(v8::Context::kDebugIdIndex)); |
964 | 964 |
965 isolate->debug()->OnBeforeCompile(script); | |
966 | |
967 Handle<SharedFunctionInfo> result; | 965 Handle<SharedFunctionInfo> result; |
968 | 966 |
969 { VMState<COMPILER> state(info->isolate()); | 967 { VMState<COMPILER> state(info->isolate()); |
970 if (parse_info->literal() == nullptr && | 968 if (parse_info->literal() == nullptr && |
971 !parsing::ParseProgram(parse_info)) { | 969 !parsing::ParseProgram(parse_info)) { |
972 return Handle<SharedFunctionInfo>::null(); | 970 return Handle<SharedFunctionInfo>::null(); |
973 } | 971 } |
974 | 972 |
975 FunctionLiteral* lit = parse_info->literal(); | 973 FunctionLiteral* lit = parse_info->literal(); |
976 | 974 |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1723 DCHECK(shared->is_compiled()); | 1721 DCHECK(shared->is_compiled()); |
1724 function->set_literals(cached.literals); | 1722 function->set_literals(cached.literals); |
1725 } else if (shared->is_compiled()) { | 1723 } else if (shared->is_compiled()) { |
1726 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1724 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1727 JSFunction::EnsureLiterals(function); | 1725 JSFunction::EnsureLiterals(function); |
1728 } | 1726 } |
1729 } | 1727 } |
1730 | 1728 |
1731 } // namespace internal | 1729 } // namespace internal |
1732 } // namespace v8 | 1730 } // namespace v8 |
OLD | NEW |