| 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 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1155 void Compiler::CompileForLiveEdit(Handle<Script> script) { | 1155 void Compiler::CompileForLiveEdit(Handle<Script> script) { |
| 1156 // TODO(635): support extensions. | 1156 // TODO(635): support extensions. |
| 1157 Zone zone; | 1157 Zone zone; |
| 1158 ParseInfo parse_info(&zone, script); | 1158 ParseInfo parse_info(&zone, script); |
| 1159 CompilationInfo info(&parse_info); | 1159 CompilationInfo info(&parse_info); |
| 1160 PostponeInterruptsScope postpone(info.isolate()); | 1160 PostponeInterruptsScope postpone(info.isolate()); |
| 1161 VMState<COMPILER> state(info.isolate()); | 1161 VMState<COMPILER> state(info.isolate()); |
| 1162 | 1162 |
| 1163 // Get rid of old list of shared function infos. | 1163 // Get rid of old list of shared function infos. |
| 1164 info.MarkAsFirstCompile(); | 1164 info.MarkAsFirstCompile(); |
| 1165 info.MarkAsDebug(); |
| 1165 info.parse_info()->set_global(); | 1166 info.parse_info()->set_global(); |
| 1166 if (!Parser::ParseStatic(info.parse_info())) return; | 1167 if (!Parser::ParseStatic(info.parse_info())) return; |
| 1167 | 1168 |
| 1168 LiveEditFunctionTracker tracker(info.isolate(), parse_info.literal()); | 1169 LiveEditFunctionTracker tracker(info.isolate(), parse_info.literal()); |
| 1169 if (!CompileUnoptimizedCode(&info)) return; | 1170 if (!CompileUnoptimizedCode(&info)) return; |
| 1170 if (info.has_shared_info()) { | 1171 if (info.has_shared_info()) { |
| 1171 Handle<ScopeInfo> scope_info = | 1172 Handle<ScopeInfo> scope_info = |
| 1172 ScopeInfo::Create(info.isolate(), info.zone(), info.scope()); | 1173 ScopeInfo::Create(info.isolate(), info.zone(), info.scope()); |
| 1173 info.shared_info()->set_scope_info(*scope_info); | 1174 info.shared_info()->set_scope_info(*scope_info); |
| 1174 } | 1175 } |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1802 } | 1803 } |
| 1803 | 1804 |
| 1804 #if DEBUG | 1805 #if DEBUG |
| 1805 void CompilationInfo::PrintAstForTesting() { | 1806 void CompilationInfo::PrintAstForTesting() { |
| 1806 PrintF("--- Source from AST ---\n%s\n", | 1807 PrintF("--- Source from AST ---\n%s\n", |
| 1807 PrettyPrinter(isolate()).PrintProgram(literal())); | 1808 PrettyPrinter(isolate()).PrintProgram(literal())); |
| 1808 } | 1809 } |
| 1809 #endif | 1810 #endif |
| 1810 } // namespace internal | 1811 } // namespace internal |
| 1811 } // namespace v8 | 1812 } // namespace v8 |
| OLD | NEW |