Index: src/runtime/runtime-proxy.cc |
diff --git a/src/runtime/runtime-proxy.cc b/src/runtime/runtime-proxy.cc |
index 4699647b8013a7d30c633b3192089d4ecc7a027a..b1ed2d1c7d4ee5aa6999f24274e5b6f8bccf1d03 100644 |
--- a/src/runtime/runtime-proxy.cc |
+++ b/src/runtime/runtime-proxy.cc |
@@ -13,11 +13,17 @@ namespace internal { |
RUNTIME_FUNCTION(Runtime_CreateJSProxy) { |
HandleScope scope(isolate); |
- DCHECK(args.length() == 2); |
- CONVERT_ARG_HANDLE_CHECKED(JSReceiver, handler, 0); |
- CONVERT_ARG_HANDLE_CHECKED(Object, prototype, 1); |
- if (!prototype->IsJSReceiver()) prototype = isolate->factory()->null_value(); |
- return *isolate->factory()->NewJSProxy(handler, prototype); |
+ DCHECK(args.length() == 3); |
+ CONVERT_ARG_HANDLE_CHECKED(JSProxy, instance, 0); |
+ CONVERT_ARG_HANDLE_CHECKED(JSReceiver, target, 1); |
+ CONVERT_ARG_HANDLE_CHECKED(Object, handler, 2); |
+ // TODO(cbruni): Remove once we don't support JSProxy.fix |
+ instance->InitializeBody(instance->map()->instance_size(), Smi::FromInt(0)); |
+ if (!handler->IsJSReceiver()) handler = isolate->factory()->null_value(); |
+ instance->set_target(*target); |
+ instance->set_handler(*handler); |
+ instance->set_hash(isolate->heap()->undefined_value(), SKIP_WRITE_BARRIER); |
+ return *instance; |
} |