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 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1173 } | 1173 } |
1174 | 1174 |
1175 bool Compiler::ParseAndAnalyze(ParseInfo* info) { | 1175 bool Compiler::ParseAndAnalyze(ParseInfo* info) { |
1176 if (!Parse(info)) return false; | 1176 if (!Parse(info)) return false; |
1177 if (!Compiler::Analyze(info)) return false; | 1177 if (!Compiler::Analyze(info)) return false; |
1178 DCHECK_NOT_NULL(info->literal()); | 1178 DCHECK_NOT_NULL(info->literal()); |
1179 DCHECK_NOT_NULL(info->scope()); | 1179 DCHECK_NOT_NULL(info->scope()); |
1180 return true; | 1180 return true; |
1181 } | 1181 } |
1182 | 1182 |
| 1183 Handle<SharedFunctionInfo> Compiler::NewSharedFunctionInfoFromLiteral( |
| 1184 Isolate* isolate, FunctionLiteral* literal, Handle<Script> script) { |
| 1185 return NewSharedFunctionInfoForLiteral(isolate, literal, script); |
| 1186 } |
| 1187 |
1183 bool Compiler::Compile(Handle<JSFunction> function, ClearExceptionFlag flag) { | 1188 bool Compiler::Compile(Handle<JSFunction> function, ClearExceptionFlag flag) { |
1184 if (function->is_compiled()) return true; | 1189 if (function->is_compiled()) return true; |
1185 Isolate* isolate = function->GetIsolate(); | 1190 Isolate* isolate = function->GetIsolate(); |
1186 DCHECK(AllowCompilation::IsAllowed(isolate)); | 1191 DCHECK(AllowCompilation::IsAllowed(isolate)); |
1187 | 1192 |
1188 // Start a compilation. | 1193 // Start a compilation. |
1189 Handle<Code> code; | 1194 Handle<Code> code; |
1190 if (!GetLazyCode(function).ToHandle(&code)) { | 1195 if (!GetLazyCode(function).ToHandle(&code)) { |
1191 if (flag == CLEAR_EXCEPTION) { | 1196 if (flag == CLEAR_EXCEPTION) { |
1192 isolate->clear_pending_exception(); | 1197 isolate->clear_pending_exception(); |
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1913 DCHECK(shared->is_compiled()); | 1918 DCHECK(shared->is_compiled()); |
1914 function->set_literals(cached.literals); | 1919 function->set_literals(cached.literals); |
1915 } else if (shared->is_compiled()) { | 1920 } else if (shared->is_compiled()) { |
1916 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1921 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
1917 JSFunction::EnsureLiterals(function); | 1922 JSFunction::EnsureLiterals(function); |
1918 } | 1923 } |
1919 } | 1924 } |
1920 | 1925 |
1921 } // namespace internal | 1926 } // namespace internal |
1922 } // namespace v8 | 1927 } // namespace v8 |
OLD | NEW |