| 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/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
| 9 #include "src/base/ieee754.h" | 9 #include "src/base/ieee754.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 2978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2989 | 2989 |
| 2990 DCHECK(context->IsNativeContext()); | 2990 DCHECK(context->IsNativeContext()); |
| 2991 | 2991 |
| 2992 Handle<JSFunction> fun = | 2992 Handle<JSFunction> fun = |
| 2993 isolate->factory()->NewFunctionFromSharedFunctionInfo(function_info, | 2993 isolate->factory()->NewFunctionFromSharedFunctionInfo(function_info, |
| 2994 context); | 2994 context); |
| 2995 Handle<Object> receiver = isolate->factory()->undefined_value(); | 2995 Handle<Object> receiver = isolate->factory()->undefined_value(); |
| 2996 | 2996 |
| 2997 // For non-extension scripts, run script to get the function wrapper. | 2997 // For non-extension scripts, run script to get the function wrapper. |
| 2998 Handle<Object> wrapper; | 2998 Handle<Object> wrapper; |
| 2999 if (!Execution::Call(isolate, fun, receiver, 0, NULL).ToHandle(&wrapper)) { | 2999 if (!Execution::TryCall(isolate, fun, receiver, 0, nullptr, |
| 3000 Execution::MessageHandling::kKeepPending, nullptr) |
| 3001 .ToHandle(&wrapper)) { |
| 3000 return false; | 3002 return false; |
| 3001 } | 3003 } |
| 3002 // Then run the function wrapper. | 3004 // Then run the function wrapper. |
| 3003 return !Execution::Call(isolate, Handle<JSFunction>::cast(wrapper), receiver, | 3005 return !Execution::TryCall(isolate, Handle<JSFunction>::cast(wrapper), |
| 3004 argc, argv).is_null(); | 3006 receiver, argc, argv, |
| 3007 Execution::MessageHandling::kKeepPending, nullptr) |
| 3008 .is_null(); |
| 3005 } | 3009 } |
| 3006 | 3010 |
| 3007 | 3011 |
| 3008 bool Genesis::CallUtilsFunction(Isolate* isolate, const char* name) { | 3012 bool Genesis::CallUtilsFunction(Isolate* isolate, const char* name) { |
| 3009 Handle<JSObject> utils = | 3013 Handle<JSObject> utils = |
| 3010 Handle<JSObject>::cast(isolate->natives_utils_object()); | 3014 Handle<JSObject>::cast(isolate->natives_utils_object()); |
| 3011 Handle<String> name_string = | 3015 Handle<String> name_string = |
| 3012 isolate->factory()->NewStringFromAsciiChecked(name); | 3016 isolate->factory()->NewStringFromAsciiChecked(name); |
| 3013 Handle<Object> fun = JSObject::GetDataProperty(utils, name_string); | 3017 Handle<Object> fun = JSObject::GetDataProperty(utils, name_string); |
| 3014 Handle<Object> receiver = isolate->factory()->undefined_value(); | 3018 Handle<Object> receiver = isolate->factory()->undefined_value(); |
| 3015 Handle<Object> args[] = {utils}; | 3019 Handle<Object> args[] = {utils}; |
| 3016 return !Execution::Call(isolate, fun, receiver, 1, args).is_null(); | 3020 return !Execution::TryCall(isolate, fun, receiver, 1, args, |
| 3021 Execution::MessageHandling::kKeepPending, nullptr) |
| 3022 .is_null(); |
| 3017 } | 3023 } |
| 3018 | 3024 |
| 3019 | 3025 |
| 3020 bool Genesis::CompileExtension(Isolate* isolate, v8::Extension* extension) { | 3026 bool Genesis::CompileExtension(Isolate* isolate, v8::Extension* extension) { |
| 3021 Factory* factory = isolate->factory(); | 3027 Factory* factory = isolate->factory(); |
| 3022 HandleScope scope(isolate); | 3028 HandleScope scope(isolate); |
| 3023 Handle<SharedFunctionInfo> function_info; | 3029 Handle<SharedFunctionInfo> function_info; |
| 3024 | 3030 |
| 3025 Handle<String> source = | 3031 Handle<String> source = |
| 3026 isolate->factory() | 3032 isolate->factory() |
| (...skipping 21 matching lines...) Expand all Loading... |
| 3048 | 3054 |
| 3049 // Set up the function context. Conceptually, we should clone the | 3055 // Set up the function context. Conceptually, we should clone the |
| 3050 // function before overwriting the context but since we're in a | 3056 // function before overwriting the context but since we're in a |
| 3051 // single-threaded environment it is not strictly necessary. | 3057 // single-threaded environment it is not strictly necessary. |
| 3052 Handle<JSFunction> fun = | 3058 Handle<JSFunction> fun = |
| 3053 factory->NewFunctionFromSharedFunctionInfo(function_info, context); | 3059 factory->NewFunctionFromSharedFunctionInfo(function_info, context); |
| 3054 | 3060 |
| 3055 // Call function using either the runtime object or the global | 3061 // Call function using either the runtime object or the global |
| 3056 // object as the receiver. Provide no parameters. | 3062 // object as the receiver. Provide no parameters. |
| 3057 Handle<Object> receiver = isolate->global_object(); | 3063 Handle<Object> receiver = isolate->global_object(); |
| 3058 return !Execution::Call(isolate, fun, receiver, 0, NULL).is_null(); | 3064 return !Execution::TryCall(isolate, fun, receiver, 0, nullptr, |
| 3065 Execution::MessageHandling::kKeepPending, nullptr) |
| 3066 .is_null(); |
| 3059 } | 3067 } |
| 3060 | 3068 |
| 3061 | 3069 |
| 3062 static Handle<JSObject> ResolveBuiltinIdHolder(Handle<Context> native_context, | 3070 static Handle<JSObject> ResolveBuiltinIdHolder(Handle<Context> native_context, |
| 3063 const char* holder_expr) { | 3071 const char* holder_expr) { |
| 3064 Isolate* isolate = native_context->GetIsolate(); | 3072 Isolate* isolate = native_context->GetIsolate(); |
| 3065 Factory* factory = isolate->factory(); | 3073 Factory* factory = isolate->factory(); |
| 3066 Handle<JSGlobalObject> global(native_context->global_object()); | 3074 Handle<JSGlobalObject> global(native_context->global_object()); |
| 3067 const char* period_pos = strchr(holder_expr, '.'); | 3075 const char* period_pos = strchr(holder_expr, '.'); |
| 3068 if (period_pos == NULL) { | 3076 if (period_pos == NULL) { |
| (...skipping 1693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4762 } | 4770 } |
| 4763 | 4771 |
| 4764 | 4772 |
| 4765 // Called when the top-level V8 mutex is destroyed. | 4773 // Called when the top-level V8 mutex is destroyed. |
| 4766 void Bootstrapper::FreeThreadResources() { | 4774 void Bootstrapper::FreeThreadResources() { |
| 4767 DCHECK(!IsActive()); | 4775 DCHECK(!IsActive()); |
| 4768 } | 4776 } |
| 4769 | 4777 |
| 4770 } // namespace internal | 4778 } // namespace internal |
| 4771 } // namespace v8 | 4779 } // namespace v8 |
| OLD | NEW |