| 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 "execution.h" | 5 #include "execution.h" |
| 6 | 6 |
| 7 #include "bootstrapper.h" | 7 #include "bootstrapper.h" |
| 8 #include "codegen.h" | 8 #include "codegen.h" |
| 9 #include "deoptimizer.h" | 9 #include "deoptimizer.h" |
| 10 #include "isolate-inl.h" | 10 #include "isolate-inl.h" |
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 Handle<Object> char_at = Object::GetProperty( | 733 Handle<Object> char_at = Object::GetProperty( |
| 734 isolate->js_builtins_object(), | 734 isolate->js_builtins_object(), |
| 735 factory->char_at_string()).ToHandleChecked(); | 735 factory->char_at_string()).ToHandleChecked(); |
| 736 if (!char_at->IsJSFunction()) { | 736 if (!char_at->IsJSFunction()) { |
| 737 return factory->undefined_value(); | 737 return factory->undefined_value(); |
| 738 } | 738 } |
| 739 | 739 |
| 740 Handle<Object> index_object = factory->NewNumberFromInt(int_index); | 740 Handle<Object> index_object = factory->NewNumberFromInt(int_index); |
| 741 Handle<Object> index_arg[] = { index_object }; | 741 Handle<Object> index_arg[] = { index_object }; |
| 742 Handle<Object> result; | 742 Handle<Object> result; |
| 743 ASSIGN_RETURN_ON_EXCEPTION_VALUE( | 743 if (!TryCall(Handle<JSFunction>::cast(char_at), |
| 744 isolate, result, | 744 string, |
| 745 TryCall(Handle<JSFunction>::cast(char_at), | 745 ARRAY_SIZE(index_arg), |
| 746 string, | 746 index_arg).ToHandle(&result)) { |
| 747 ARRAY_SIZE(index_arg), | 747 return factory->undefined_value(); |
| 748 index_arg), | 748 } |
| 749 factory->undefined_value()); | |
| 750 return result; | 749 return result; |
| 751 } | 750 } |
| 752 | 751 |
| 753 | 752 |
| 754 MaybeHandle<JSFunction> Execution::InstantiateFunction( | 753 MaybeHandle<JSFunction> Execution::InstantiateFunction( |
| 755 Handle<FunctionTemplateInfo> data) { | 754 Handle<FunctionTemplateInfo> data) { |
| 756 Isolate* isolate = data->GetIsolate(); | 755 Isolate* isolate = data->GetIsolate(); |
| 757 if (!data->do_not_cache()) { | 756 if (!data->do_not_cache()) { |
| 758 // Fast case: see if the function has already been instantiated | 757 // Fast case: see if the function has already been instantiated |
| 759 int serial_number = Smi::cast(data->serial_number())->value(); | 758 int serial_number = Smi::cast(data->serial_number())->value(); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 if (stack_guard->IsInstallCodeRequest()) { | 985 if (stack_guard->IsInstallCodeRequest()) { |
| 987 ASSERT(isolate->concurrent_recompilation_enabled()); | 986 ASSERT(isolate->concurrent_recompilation_enabled()); |
| 988 stack_guard->Continue(INSTALL_CODE); | 987 stack_guard->Continue(INSTALL_CODE); |
| 989 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); | 988 isolate->optimizing_compiler_thread()->InstallOptimizedFunctions(); |
| 990 } | 989 } |
| 991 isolate->runtime_profiler()->OptimizeNow(); | 990 isolate->runtime_profiler()->OptimizeNow(); |
| 992 return isolate->heap()->undefined_value(); | 991 return isolate->heap()->undefined_value(); |
| 993 } | 992 } |
| 994 | 993 |
| 995 } } // namespace v8::internal | 994 } } // namespace v8::internal |
| OLD | NEW |