diff options
Diffstat (limited to 'chromium/v8/src/builtins/base.tq')
-rw-r--r-- | chromium/v8/src/builtins/base.tq | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/chromium/v8/src/builtins/base.tq b/chromium/v8/src/builtins/base.tq index 07af1f441f8..24c355d6b3e 100644 --- a/chromium/v8/src/builtins/base.tq +++ b/chromium/v8/src/builtins/base.tq @@ -336,15 +336,13 @@ macro NewJSObject(implicit context: Context)(): JSObject { }; } -extern macro HasPrototypeSlot(JSFunction): bool; +type JSFunctionWithPrototypeSlot extends JSFunction; macro GetDerivedMap(implicit context: Context)( target: JSFunction, newTarget: JSReceiver): Map { try { - const constructor = Cast<JSFunction>(newTarget) otherwise SlowPath; - if (!HasPrototypeSlot(constructor)) { - goto SlowPath; - } + const constructor = + Cast<JSFunctionWithPrototypeSlot>(newTarget) otherwise SlowPath; assert(IsConstructor(constructor)); const map = Cast<Map>(constructor.prototype_or_initial_map) otherwise SlowPath; @@ -1814,6 +1812,9 @@ extern macro HeapObjectToString(HeapObject): String labels CastError; extern macro HeapObjectToConstructor(HeapObject): Constructor labels CastError; +extern macro HeapObjectToJSFunctionWithPrototypeSlot(HeapObject): + JSFunctionWithPrototypeSlot + labels CastError; extern macro HeapObjectToHeapNumber(HeapObject): HeapNumber labels CastError; extern macro HeapObjectToSloppyArgumentsElements(HeapObject): @@ -1967,6 +1968,11 @@ Cast<Constructor>(o: HeapObject): Constructor return HeapObjectToConstructor(o) otherwise CastError; } +Cast<JSFunctionWithPrototypeSlot>(o: HeapObject): JSFunctionWithPrototypeSlot + labels CastError { + return HeapObjectToJSFunctionWithPrototypeSlot(o) otherwise CastError; +} + Cast<HeapNumber>(o: HeapObject): HeapNumber labels CastError { if (IsHeapNumber(o)) return %RawDownCast<HeapNumber>(o); |