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 <stdlib.h> | 5 #include <stdlib.h> |
6 #include <limits> | 6 #include <limits> |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 8474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8485 PrintF("]\n"); | 8485 PrintF("]\n"); |
8486 } | 8486 } |
8487 #endif | 8487 #endif |
8488 | 8488 |
8489 // Compile the target function. | 8489 // Compile the target function. |
8490 DCHECK(function->shared()->allows_lazy_compilation()); | 8490 DCHECK(function->shared()->allows_lazy_compilation()); |
8491 | 8491 |
8492 Handle<Code> code; | 8492 Handle<Code> code; |
8493 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, code, | 8493 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, code, |
8494 Compiler::GetLazyCode(function)); | 8494 Compiler::GetLazyCode(function)); |
| 8495 DCHECK(code->kind() == Code::FUNCTION || |
| 8496 code->kind() == Code::OPTIMIZED_FUNCTION); |
8495 function->ReplaceCode(*code); | 8497 function->ReplaceCode(*code); |
8496 | |
8497 // All done. Return the compiled code. | |
8498 DCHECK(function->is_compiled()); | |
8499 DCHECK(function->code()->kind() == Code::FUNCTION || | |
8500 (FLAG_always_opt && | |
8501 function->code()->kind() == Code::OPTIMIZED_FUNCTION)); | |
8502 return *code; | 8498 return *code; |
8503 } | 8499 } |
8504 | 8500 |
8505 | 8501 |
8506 RUNTIME_FUNCTION(Runtime_CompileOptimized) { | 8502 RUNTIME_FUNCTION(Runtime_CompileOptimized) { |
8507 HandleScope scope(isolate); | 8503 HandleScope scope(isolate); |
8508 DCHECK(args.length() == 2); | 8504 DCHECK(args.length() == 2); |
8509 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); | 8505 CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
8510 CONVERT_BOOLEAN_ARG_CHECKED(concurrent, 1); | 8506 CONVERT_BOOLEAN_ARG_CHECKED(concurrent, 1); |
8511 | 8507 |
(...skipping 7231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15743 } | 15739 } |
15744 return NULL; | 15740 return NULL; |
15745 } | 15741 } |
15746 | 15742 |
15747 | 15743 |
15748 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15744 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15749 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15745 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15750 } | 15746 } |
15751 | 15747 |
15752 } } // namespace v8::internal | 15748 } } // namespace v8::internal |
OLD | NEW |