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 "v8.h" | 8 #include "v8.h" |
9 | 9 |
10 #include "accessors.h" | 10 #include "accessors.h" |
(...skipping 14884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14895 HandleScope scope(isolate); | 14895 HandleScope scope(isolate); |
14896 ASSERT(args.length() == 1); | 14896 ASSERT(args.length() == 1); |
14897 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); | 14897 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); |
14898 | 14898 |
14899 Handle<Context> creation_context(object->GetCreationContext(), isolate); | 14899 Handle<Context> creation_context(object->GetCreationContext(), isolate); |
14900 return isolate->heap()->ToBoolean( | 14900 return isolate->heap()->ToBoolean( |
14901 ContextsHaveSameOrigin(creation_context, isolate->native_context())); | 14901 ContextsHaveSameOrigin(creation_context, isolate->native_context())); |
14902 } | 14902 } |
14903 | 14903 |
14904 | 14904 |
14905 RUNTIME_FUNCTION(Runtime_ObjectObserveInObjectContext) { | 14905 RUNTIME_FUNCTION(Runtime_GetObjectContextObjectObserve) { |
14906 HandleScope scope(isolate); | |
14907 ASSERT(args.length() == 3); | |
14908 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); | |
14909 CONVERT_ARG_HANDLE_CHECKED(JSFunction, callback, 1); | |
14910 CONVERT_ARG_HANDLE_CHECKED(Object, accept, 2); | |
14911 | |
14912 Handle<Context> context(object->GetCreationContext(), isolate); | |
14913 Handle<JSFunction> function(context->native_object_observe(), isolate); | |
14914 Handle<Object> call_args[] = { object, callback, accept }; | |
14915 Handle<Object> result; | |
14916 | |
14917 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | |
14918 isolate, result, | |
14919 Execution::Call(isolate, function, | |
14920 handle(context->object_function(), isolate), | |
14921 ARRAY_SIZE(call_args), call_args, true)); | |
14922 return *result; | |
14923 } | |
14924 | |
14925 | |
14926 RUNTIME_FUNCTION(Runtime_ObjectGetNotifierInObjectContext) { | |
14927 HandleScope scope(isolate); | 14906 HandleScope scope(isolate); |
14928 ASSERT(args.length() == 1); | 14907 ASSERT(args.length() == 1); |
14929 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); | 14908 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); |
14930 | 14909 |
14931 Handle<Context> context(object->GetCreationContext(), isolate); | 14910 Handle<Context> context(object->GetCreationContext(), isolate); |
14932 Handle<JSFunction> function(context->native_object_get_notifier(), isolate); | 14911 return context->native_object_observe(); |
14933 Handle<Object> call_args[] = { object }; | |
14934 Handle<Object> result; | |
14935 | |
14936 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | |
14937 isolate, result, | |
14938 Execution::Call(isolate, function, | |
14939 handle(context->object_function(), isolate), | |
14940 ARRAY_SIZE(call_args), call_args, true)); | |
14941 return *result; | |
14942 } | 14912 } |
14943 | 14913 |
14944 | 14914 |
14945 RUNTIME_FUNCTION(Runtime_ObjectNotifierPerformChangeInObjectContext) { | 14915 RUNTIME_FUNCTION(Runtime_GetObjectContextObjectGetNotifier) { |
14946 HandleScope scope(isolate); | 14916 HandleScope scope(isolate); |
14947 ASSERT(args.length() == 3); | 14917 ASSERT(args.length() == 1); |
14948 CONVERT_ARG_HANDLE_CHECKED(JSObject, object_info, 0); | 14918 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); |
14949 CONVERT_ARG_HANDLE_CHECKED(String, change_type, 1); | |
14950 CONVERT_ARG_HANDLE_CHECKED(JSFunction, change_fn, 2); | |
14951 | 14919 |
14952 Handle<Context> context(object_info->GetCreationContext(), isolate); | 14920 Handle<Context> context(object->GetCreationContext(), isolate); |
14953 Handle<JSFunction> function(context->native_object_notifier_perform_change(), | 14921 return context->native_object_get_notifier(); |
14954 isolate); | |
14955 Handle<Object> call_args[] = { object_info, change_type, change_fn }; | |
14956 Handle<Object> result; | |
14957 | |
14958 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( | |
14959 isolate, result, | |
14960 Execution::Call(isolate, function, isolate->factory()->undefined_value(), | |
14961 ARRAY_SIZE(call_args), call_args, true)); | |
14962 return *result; | |
14963 } | 14922 } |
14964 | 14923 |
14965 | 14924 |
| 14925 RUNTIME_FUNCTION(Runtime_GetObjectContextNotifierPerformChange) { |
| 14926 HandleScope scope(isolate); |
| 14927 ASSERT(args.length() == 1); |
| 14928 CONVERT_ARG_HANDLE_CHECKED(JSObject, object_info, 0); |
| 14929 |
| 14930 Handle<Context> context(object_info->GetCreationContext(), isolate); |
| 14931 return context->native_object_notifier_perform_change(); |
| 14932 } |
| 14933 |
| 14934 |
14966 static Object* ArrayConstructorCommon(Isolate* isolate, | 14935 static Object* ArrayConstructorCommon(Isolate* isolate, |
14967 Handle<JSFunction> constructor, | 14936 Handle<JSFunction> constructor, |
14968 Handle<AllocationSite> site, | 14937 Handle<AllocationSite> site, |
14969 Arguments* caller_args) { | 14938 Arguments* caller_args) { |
14970 Factory* factory = isolate->factory(); | 14939 Factory* factory = isolate->factory(); |
14971 | 14940 |
14972 bool holey = false; | 14941 bool holey = false; |
14973 bool can_use_type_feedback = true; | 14942 bool can_use_type_feedback = true; |
14974 if (caller_args->length() == 1) { | 14943 if (caller_args->length() == 1) { |
14975 Handle<Object> argument_one = caller_args->at<Object>(0); | 14944 Handle<Object> argument_one = caller_args->at<Object>(0); |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15171 } | 15140 } |
15172 return NULL; | 15141 return NULL; |
15173 } | 15142 } |
15174 | 15143 |
15175 | 15144 |
15176 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15145 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15177 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15146 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15178 } | 15147 } |
15179 | 15148 |
15180 } } // namespace v8::internal | 15149 } } // namespace v8::internal |
OLD | NEW |