| Index: src/objects.cc
|
| diff --git a/src/objects.cc b/src/objects.cc
|
| index bc43b28fbf4998c305766f408ae3a0fa47a6cd54..3a01f281dc564a2b41396cfb8848d020214b9cd8 100644
|
| --- a/src/objects.cc
|
| +++ b/src/objects.cc
|
| @@ -2697,6 +2697,10 @@ void JSObject::JSObjectShortPrint(StringStream* accumulator) {
|
| accumulator->Add("<JSWeakSet>");
|
| break;
|
| }
|
| + case JS_WEAK_REF_TYPE: {
|
| + accumulator->Add("<JSWeakRef>");
|
| + break;
|
| + }
|
| case JS_REGEXP_TYPE: {
|
| accumulator->Add("<JSRegExp");
|
| JSRegExp* regexp = JSRegExp::cast(this);
|
| @@ -12789,6 +12793,7 @@ bool CanSubclassHaveInobjectProperties(InstanceType instance_type) {
|
| case JS_VALUE_TYPE:
|
| case JS_WEAK_MAP_TYPE:
|
| case JS_WEAK_SET_TYPE:
|
| + case JS_WEAK_REF_TYPE:
|
| return true;
|
|
|
| case BYTECODE_ARRAY_TYPE:
|
| @@ -19200,6 +19205,31 @@ Handle<JSArray> JSWeakCollection::GetEntries(Handle<JSWeakCollection> holder,
|
| return isolate->factory()->NewJSArrayWithElements(entries);
|
| }
|
|
|
| +void JSWeakRef::Initialize(Handle<JSWeakRef> weak_ref,
|
| + Isolate* isolate,
|
| + Handle<JSObject> target,
|
| + Handle<JSFunction> executor,
|
| + Handle<Object> holdings) {
|
| + isolate->factory()->InitJSWeakRef(weak_ref, target, executor, holdings);
|
| +}
|
| +
|
| +Handle<HeapObject> JSWeakRef::Value(Handle<JSWeakRef> weak_ref,
|
| + Isolate* isolate) {
|
| + if (weak_ref->target() == nullptr || weak_ref->target()->cleared()) {
|
| + return isolate->factory()->null_value();
|
| + }
|
| + weak_ref->set_held(true);
|
| + return Handle<HeapObject>(
|
| + reinterpret_cast<HeapObject*>(weak_ref->target()->value()));
|
| +}
|
| +
|
| +void JSWeakRef::Clear(Handle<JSWeakRef> weak_ref,
|
| + Isolate* isolate) {
|
| + weak_ref->set_executor(nullptr);
|
| + weak_ref->set_holdings(nullptr);
|
| + weak_ref->set_target(nullptr);
|
| +}
|
| +
|
| // Check if there is a break point at this source position.
|
| bool DebugInfo::HasBreakPoint(int source_position) {
|
| // Get the break point info object for this code offset.
|
|
|