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-numbering.h" | 9 #include "src/ast-numbering.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1047 | 1047 |
1048 void Compiler::CompileForLiveEdit(Handle<Script> script) { | 1048 void Compiler::CompileForLiveEdit(Handle<Script> script) { |
1049 // TODO(635): support extensions. | 1049 // TODO(635): support extensions. |
1050 Zone zone; | 1050 Zone zone; |
1051 ParseInfo parse_info(&zone, script); | 1051 ParseInfo parse_info(&zone, script); |
1052 CompilationInfo info(&parse_info); | 1052 CompilationInfo info(&parse_info); |
1053 PostponeInterruptsScope postpone(info.isolate()); | 1053 PostponeInterruptsScope postpone(info.isolate()); |
1054 VMState<COMPILER> state(info.isolate()); | 1054 VMState<COMPILER> state(info.isolate()); |
1055 | 1055 |
1056 // Get rid of old list of shared function infos. | 1056 // Get rid of old list of shared function infos. |
| 1057 script->set_shared_function_infos(Smi::FromInt(0)); |
1057 info.MarkAsFirstCompile(); | 1058 info.MarkAsFirstCompile(); |
1058 info.parse_info()->set_global(); | 1059 info.parse_info()->set_global(); |
1059 if (!Parser::ParseStatic(info.parse_info())) return; | 1060 if (!Parser::ParseStatic(info.parse_info())) return; |
1060 | 1061 |
1061 LiveEditFunctionTracker tracker(info.isolate(), info.function()); | 1062 LiveEditFunctionTracker tracker(info.isolate(), info.function()); |
1062 if (!CompileUnoptimizedCode(&info)) return; | 1063 if (!CompileUnoptimizedCode(&info)) return; |
1063 if (info.has_shared_info()) { | 1064 if (info.has_shared_info()) { |
1064 Handle<ScopeInfo> scope_info = | 1065 Handle<ScopeInfo> scope_info = |
1065 ScopeInfo::Create(info.isolate(), info.zone(), info.scope()); | 1066 ScopeInfo::Create(info.isolate(), info.zone(), info.scope()); |
1066 info.shared_info()->set_scope_info(*scope_info); | 1067 info.shared_info()->set_scope_info(*scope_info); |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1684 | 1685 |
1685 | 1686 |
1686 #if DEBUG | 1687 #if DEBUG |
1687 void CompilationInfo::PrintAstForTesting() { | 1688 void CompilationInfo::PrintAstForTesting() { |
1688 PrintF("--- Source from AST ---\n%s\n", | 1689 PrintF("--- Source from AST ---\n%s\n", |
1689 PrettyPrinter(isolate(), zone()).PrintProgram(function())); | 1690 PrettyPrinter(isolate(), zone()).PrintProgram(function())); |
1690 } | 1691 } |
1691 #endif | 1692 #endif |
1692 } // namespace internal | 1693 } // namespace internal |
1693 } // namespace v8 | 1694 } // namespace v8 |
OLD | NEW |