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 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 DCHECK(!isolate->has_pending_exception()); | 1235 DCHECK(!isolate->has_pending_exception()); |
1236 DCHECK(shared->is_compiled()); | 1236 DCHECK(shared->is_compiled()); |
1237 DCHECK(shared->HasDebugCode()); | 1237 DCHECK(shared->HasDebugCode()); |
1238 return true; | 1238 return true; |
1239 } | 1239 } |
1240 | 1240 |
1241 bool Compiler::CompileForLiveEdit(Handle<Script> script) { | 1241 bool Compiler::CompileForLiveEdit(Handle<Script> script) { |
1242 Isolate* isolate = script->GetIsolate(); | 1242 Isolate* isolate = script->GetIsolate(); |
1243 DCHECK(AllowCompilation::IsAllowed(isolate)); | 1243 DCHECK(AllowCompilation::IsAllowed(isolate)); |
1244 | 1244 |
1245 // Get rid of old list of shared function infos. | |
1246 script->set_shared_function_infos(Smi::FromInt(0)); | |
1247 | |
1248 // Start a compilation. | 1245 // Start a compilation. |
1249 Zone zone(isolate->allocator()); | 1246 Zone zone(isolate->allocator()); |
1250 ParseInfo parse_info(&zone, script); | 1247 ParseInfo parse_info(&zone, script); |
1251 CompilationInfo info(&parse_info, Handle<JSFunction>::null()); | 1248 CompilationInfo info(&parse_info, Handle<JSFunction>::null()); |
1252 parse_info.set_global(); | 1249 parse_info.set_global(); |
1253 info.MarkAsDebug(); | 1250 info.MarkAsDebug(); |
1254 // TODO(635): support extensions. | 1251 // TODO(635): support extensions. |
1255 if (CompileToplevel(&info).is_null()) { | 1252 if (CompileToplevel(&info).is_null()) { |
1256 return false; | 1253 return false; |
1257 } | 1254 } |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1763 MaybeHandle<Code> code; | 1760 MaybeHandle<Code> code; |
1764 if (cached.code != nullptr) code = handle(cached.code); | 1761 if (cached.code != nullptr) code = handle(cached.code); |
1765 Handle<Context> native_context(function->context()->native_context()); | 1762 Handle<Context> native_context(function->context()->native_context()); |
1766 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, | 1763 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, |
1767 literals, BailoutId::None()); | 1764 literals, BailoutId::None()); |
1768 } | 1765 } |
1769 } | 1766 } |
1770 | 1767 |
1771 } // namespace internal | 1768 } // namespace internal |
1772 } // namespace v8 | 1769 } // namespace v8 |
OLD | NEW |