| 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 |
| 1245 // Start a compilation. | 1248 // Start a compilation. |
| 1246 Zone zone(isolate->allocator()); | 1249 Zone zone(isolate->allocator()); |
| 1247 ParseInfo parse_info(&zone, script); | 1250 ParseInfo parse_info(&zone, script); |
| 1248 CompilationInfo info(&parse_info, Handle<JSFunction>::null()); | 1251 CompilationInfo info(&parse_info, Handle<JSFunction>::null()); |
| 1249 parse_info.set_global(); | 1252 parse_info.set_global(); |
| 1250 info.MarkAsDebug(); | 1253 info.MarkAsDebug(); |
| 1251 // TODO(635): support extensions. | 1254 // TODO(635): support extensions. |
| 1252 if (CompileToplevel(&info).is_null()) { | 1255 if (CompileToplevel(&info).is_null()) { |
| 1253 return false; | 1256 return false; |
| 1254 } | 1257 } |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1760 MaybeHandle<Code> code; | 1763 MaybeHandle<Code> code; |
| 1761 if (cached.code != nullptr) code = handle(cached.code); | 1764 if (cached.code != nullptr) code = handle(cached.code); |
| 1762 Handle<Context> native_context(function->context()->native_context()); | 1765 Handle<Context> native_context(function->context()->native_context()); |
| 1763 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, | 1766 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, |
| 1764 literals, BailoutId::None()); | 1767 literals, BailoutId::None()); |
| 1765 } | 1768 } |
| 1766 } | 1769 } |
| 1767 | 1770 |
| 1768 } // namespace internal | 1771 } // namespace internal |
| 1769 } // namespace v8 | 1772 } // namespace v8 |
| OLD | NEW |