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 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1313 } | 1313 } |
1314 | 1314 |
1315 MaybeHandle<JSArray> Compiler::CompileForLiveEdit(Handle<Script> script) { | 1315 MaybeHandle<JSArray> Compiler::CompileForLiveEdit(Handle<Script> script) { |
1316 Isolate* isolate = script->GetIsolate(); | 1316 Isolate* isolate = script->GetIsolate(); |
1317 DCHECK(AllowCompilation::IsAllowed(isolate)); | 1317 DCHECK(AllowCompilation::IsAllowed(isolate)); |
1318 | 1318 |
1319 // In order to ensure that live edit function info collection finds the newly | 1319 // In order to ensure that live edit function info collection finds the newly |
1320 // generated shared function infos, clear the script's list temporarily | 1320 // generated shared function infos, clear the script's list temporarily |
1321 // and restore it at the end of this method. | 1321 // and restore it at the end of this method. |
1322 Handle<Object> old_function_infos(script->shared_function_infos(), isolate); | 1322 Handle<Object> old_function_infos(script->shared_function_infos(), isolate); |
1323 script->set_shared_function_infos(Smi::FromInt(0)); | 1323 script->set_shared_function_infos(Smi::kZero); |
1324 | 1324 |
1325 // Start a compilation. | 1325 // Start a compilation. |
1326 Zone zone(isolate->allocator()); | 1326 Zone zone(isolate->allocator()); |
1327 ParseInfo parse_info(&zone, script); | 1327 ParseInfo parse_info(&zone, script); |
1328 CompilationInfo info(&parse_info, Handle<JSFunction>::null()); | 1328 CompilationInfo info(&parse_info, Handle<JSFunction>::null()); |
1329 info.MarkAsDebug(); | 1329 info.MarkAsDebug(); |
1330 | 1330 |
1331 // TODO(635): support extensions. | 1331 // TODO(635): support extensions. |
1332 const bool compilation_succeeded = !CompileToplevel(&info).is_null(); | 1332 const bool compilation_succeeded = !CompileToplevel(&info).is_null(); |
1333 Handle<JSArray> infos; | 1333 Handle<JSArray> infos; |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1888 DCHECK(shared->is_compiled()); | 1888 DCHECK(shared->is_compiled()); |
1889 function->set_literals(cached.literals); | 1889 function->set_literals(cached.literals); |
1890 } else if (shared->is_compiled()) { | 1890 } else if (shared->is_compiled()) { |
1891 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1891 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1892 JSFunction::EnsureLiterals(function); | 1892 JSFunction::EnsureLiterals(function); |
1893 } | 1893 } |
1894 } | 1894 } |
1895 | 1895 |
1896 } // namespace internal | 1896 } // namespace internal |
1897 } // namespace v8 | 1897 } // namespace v8 |
OLD | NEW |