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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/runtime/runtime-utils.h" | 8 #include "src/runtime/runtime-utils.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 16 matching lines...) Expand all Loading... |
27 CONVERT_ARG_HANDLE_CHECKED(Object, call_trap, 1); | 27 CONVERT_ARG_HANDLE_CHECKED(Object, call_trap, 1); |
28 RUNTIME_ASSERT(call_trap->IsJSFunction() || call_trap->IsJSFunctionProxy()); | 28 RUNTIME_ASSERT(call_trap->IsJSFunction() || call_trap->IsJSFunctionProxy()); |
29 CONVERT_ARG_HANDLE_CHECKED(JSFunction, construct_trap, 2); | 29 CONVERT_ARG_HANDLE_CHECKED(JSFunction, construct_trap, 2); |
30 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 3); | 30 CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 3); |
31 if (!prototype->IsJSReceiver()) prototype = isolate->factory()->null_value(); | 31 if (!prototype->IsJSReceiver()) prototype = isolate->factory()->null_value(); |
32 return *isolate->factory()->NewJSFunctionProxy(handler, call_trap, | 32 return *isolate->factory()->NewJSFunctionProxy(handler, call_trap, |
33 construct_trap, prototype); | 33 construct_trap, prototype); |
34 } | 34 } |
35 | 35 |
36 | 36 |
37 RUNTIME_FUNCTION(RuntimeReference_IsJSProxy) { | 37 RUNTIME_FUNCTION(Runtime_IsJSProxy) { |
38 SealHandleScope shs(isolate); | 38 SealHandleScope shs(isolate); |
39 DCHECK(args.length() == 1); | 39 DCHECK(args.length() == 1); |
40 CONVERT_ARG_CHECKED(Object, obj, 0); | 40 CONVERT_ARG_CHECKED(Object, obj, 0); |
41 return isolate->heap()->ToBoolean(obj->IsJSProxy()); | 41 return isolate->heap()->ToBoolean(obj->IsJSProxy()); |
42 } | 42 } |
43 | 43 |
44 | 44 |
45 RUNTIME_FUNCTION(Runtime_IsJSFunctionProxy) { | 45 RUNTIME_FUNCTION(Runtime_IsJSFunctionProxy) { |
46 SealHandleScope shs(isolate); | 46 SealHandleScope shs(isolate); |
47 DCHECK(args.length() == 1); | 47 DCHECK(args.length() == 1); |
(...skipping 28 matching lines...) Expand all Loading... |
76 | 76 |
77 RUNTIME_FUNCTION(Runtime_Fix) { | 77 RUNTIME_FUNCTION(Runtime_Fix) { |
78 HandleScope scope(isolate); | 78 HandleScope scope(isolate); |
79 DCHECK(args.length() == 1); | 79 DCHECK(args.length() == 1); |
80 CONVERT_ARG_HANDLE_CHECKED(JSProxy, proxy, 0); | 80 CONVERT_ARG_HANDLE_CHECKED(JSProxy, proxy, 0); |
81 JSProxy::Fix(proxy); | 81 JSProxy::Fix(proxy); |
82 return isolate->heap()->undefined_value(); | 82 return isolate->heap()->undefined_value(); |
83 } | 83 } |
84 } | 84 } |
85 } // namespace v8::internal | 85 } // namespace v8::internal |
OLD | NEW |