Chromium Code Reviews| 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 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1113 function->ReplaceCode(*code); | 1113 function->ReplaceCode(*code); |
| 1114 JSFunction::EnsureLiterals(function); | 1114 JSFunction::EnsureLiterals(function); |
| 1115 | 1115 |
| 1116 // Check postconditions on success. | 1116 // Check postconditions on success. |
| 1117 DCHECK(!isolate->has_pending_exception()); | 1117 DCHECK(!isolate->has_pending_exception()); |
| 1118 DCHECK(function->shared()->is_compiled()); | 1118 DCHECK(function->shared()->is_compiled()); |
| 1119 DCHECK(function->is_compiled()); | 1119 DCHECK(function->is_compiled()); |
| 1120 return true; | 1120 return true; |
| 1121 } | 1121 } |
| 1122 | 1122 |
| 1123 bool Compiler::CompileDebugCode(Handle<JSFunction> function) { | |
| 1124 return CompileDebugCode(handle(function->shared())); | |
| 1125 } | |
| 1126 | |
| 1127 bool Compiler::CompileDebugCode(Handle<SharedFunctionInfo> shared) { | 1123 bool Compiler::CompileDebugCode(Handle<SharedFunctionInfo> shared) { |
| 1128 Isolate* isolate = shared->GetIsolate(); | 1124 Isolate* isolate = shared->GetIsolate(); |
| 1125 // Code that cannot be compiled lazily are internal and not debuggable. | |
| 1126 DCHECK(shared->allows_lazy_compilation()); | |
|
Michael Starzinger
2016/11/14 09:19:11
I don't fully understand why this became a pre-con
| |
| 1129 DCHECK(AllowCompilation::IsAllowed(isolate)); | 1127 DCHECK(AllowCompilation::IsAllowed(isolate)); |
| 1130 | 1128 |
| 1131 // Start a compilation. | 1129 // Start a compilation. |
| 1132 Zone zone(isolate->allocator(), ZONE_NAME); | 1130 Zone zone(isolate->allocator(), ZONE_NAME); |
| 1133 ParseInfo parse_info(&zone, shared); | 1131 ParseInfo parse_info(&zone, shared); |
| 1134 CompilationInfo info(&parse_info, Handle<JSFunction>::null()); | 1132 CompilationInfo info(&parse_info, Handle<JSFunction>::null()); |
| 1135 info.MarkAsDebug(); | 1133 info.MarkAsDebug(); |
| 1136 if (GetUnoptimizedCode(&info).is_null()) { | 1134 if (GetUnoptimizedCode(&info).is_null()) { |
| 1137 isolate->clear_pending_exception(); | 1135 isolate->clear_pending_exception(); |
| 1138 return false; | 1136 return false; |
| (...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1715 DCHECK(shared->is_compiled()); | 1713 DCHECK(shared->is_compiled()); |
| 1716 function->set_literals(cached.literals); | 1714 function->set_literals(cached.literals); |
| 1717 } else if (shared->is_compiled()) { | 1715 } else if (shared->is_compiled()) { |
| 1718 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1716 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
| 1719 JSFunction::EnsureLiterals(function); | 1717 JSFunction::EnsureLiterals(function); |
| 1720 } | 1718 } |
| 1721 } | 1719 } |
| 1722 | 1720 |
| 1723 } // namespace internal | 1721 } // namespace internal |
| 1724 } // namespace v8 | 1722 } // namespace v8 |
| OLD | NEW |