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 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1041 } | 1041 } |
1042 | 1042 |
1043 bool Compiler::ParseAndAnalyze(ParseInfo* info) { | 1043 bool Compiler::ParseAndAnalyze(ParseInfo* info) { |
1044 if (!Parser::ParseStatic(info)) return false; | 1044 if (!Parser::ParseStatic(info)) return false; |
1045 if (!Compiler::Analyze(info)) return false; | 1045 if (!Compiler::Analyze(info)) return false; |
1046 DCHECK_NOT_NULL(info->literal()); | 1046 DCHECK_NOT_NULL(info->literal()); |
1047 DCHECK_NOT_NULL(info->scope()); | 1047 DCHECK_NOT_NULL(info->scope()); |
1048 return true; | 1048 return true; |
1049 } | 1049 } |
1050 | 1050 |
| 1051 Handle<SharedFunctionInfo> Compiler::NewSharedFunctionInfoFromLiteral( |
| 1052 Isolate* isolate, FunctionLiteral* literal, Handle<Script> script) { |
| 1053 return NewSharedFunctionInfoForLiteral(isolate, literal, script); |
| 1054 } |
| 1055 |
1051 bool Compiler::Compile(Handle<JSFunction> function, ClearExceptionFlag flag) { | 1056 bool Compiler::Compile(Handle<JSFunction> function, ClearExceptionFlag flag) { |
1052 if (function->is_compiled()) return true; | 1057 if (function->is_compiled()) return true; |
1053 Isolate* isolate = function->GetIsolate(); | 1058 Isolate* isolate = function->GetIsolate(); |
1054 DCHECK(AllowCompilation::IsAllowed(isolate)); | 1059 DCHECK(AllowCompilation::IsAllowed(isolate)); |
1055 | 1060 |
1056 // Start a compilation. | 1061 // Start a compilation. |
1057 Handle<Code> code; | 1062 Handle<Code> code; |
1058 if (!GetLazyCode(function).ToHandle(&code)) { | 1063 if (!GetLazyCode(function).ToHandle(&code)) { |
1059 if (flag == CLEAR_EXCEPTION) { | 1064 if (flag == CLEAR_EXCEPTION) { |
1060 isolate->clear_pending_exception(); | 1065 isolate->clear_pending_exception(); |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1726 DCHECK(shared->is_compiled()); | 1731 DCHECK(shared->is_compiled()); |
1727 function->set_literals(cached.literals); | 1732 function->set_literals(cached.literals); |
1728 } else if (shared->is_compiled()) { | 1733 } else if (shared->is_compiled()) { |
1729 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1734 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1730 JSFunction::EnsureLiterals(function); | 1735 JSFunction::EnsureLiterals(function); |
1731 } | 1736 } |
1732 } | 1737 } |
1733 | 1738 |
1734 } // namespace internal | 1739 } // namespace internal |
1735 } // namespace v8 | 1740 } // namespace v8 |
OLD | NEW |