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