| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
| 6 | 6 |
| 7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
| 8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
| 9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
| 10 #include "src/frames-inl.h" | 10 #include "src/frames-inl.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 // Compile the target function. | 34 // Compile the target function. |
| 35 DCHECK(function->shared()->allows_lazy_compilation()); | 35 DCHECK(function->shared()->allows_lazy_compilation()); |
| 36 | 36 |
| 37 Handle<Code> code; | 37 Handle<Code> code; |
| 38 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, code, | 38 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, code, |
| 39 Compiler::GetLazyCode(function)); | 39 Compiler::GetLazyCode(function)); |
| 40 DCHECK(code->IsJavaScriptCode()); | 40 DCHECK(code->IsJavaScriptCode()); |
| 41 | 41 |
| 42 function->ReplaceCode(*code); | 42 function->ReplaceCode(*code); |
| 43 JSFunction::EnsureLiterals(function); |
| 43 return *code; | 44 return *code; |
| 44 } | 45 } |
| 45 | 46 |
| 46 | 47 |
| 47 namespace { | 48 namespace { |
| 48 | 49 |
| 49 Object* CompileOptimized(Isolate* isolate, Handle<JSFunction> function, | 50 Object* CompileOptimized(Isolate* isolate, Handle<JSFunction> function, |
| 50 Compiler::ConcurrencyMode mode) { | 51 Compiler::ConcurrencyMode mode) { |
| 51 StackLimitCheck check(isolate); | 52 StackLimitCheck check(isolate); |
| 52 if (check.JsHasOverflowed(1 * KB)) return isolate->StackOverflow(); | 53 if (check.JsHasOverflowed(1 * KB)) return isolate->StackOverflow(); |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 DCHECK(is_valid_language_mode(args.smi_at(3))); | 425 DCHECK(is_valid_language_mode(args.smi_at(3))); |
| 425 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); | 426 LanguageMode language_mode = static_cast<LanguageMode>(args.smi_at(3)); |
| 426 DCHECK(args[4]->IsSmi()); | 427 DCHECK(args[4]->IsSmi()); |
| 427 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), | 428 Handle<SharedFunctionInfo> outer_info(args.at<JSFunction>(2)->shared(), |
| 428 isolate); | 429 isolate); |
| 429 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, | 430 return CompileGlobalEval(isolate, args.at<String>(1), outer_info, |
| 430 language_mode, args.smi_at(4)); | 431 language_mode, args.smi_at(4)); |
| 431 } | 432 } |
| 432 } // namespace internal | 433 } // namespace internal |
| 433 } // namespace v8 | 434 } // namespace v8 |
| OLD | NEW |