[Webkit-unassigned] [Bug 169040] Class Proxy can't be extended

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 17 14:50:10 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=169040

--- Comment #8 from Saam Barati <sbarati at apple.com> ---
This function:

```
function foo(proto) {
    class A extends proto { };
    print(A.__proto__ === proto);
    return A.__proto__;
}
```

Produces this byte code:
```
foo#A3U9wp:[0x107d742d0->0x107d97d40, NoneFunctionCall, 186]: 186 m_instructions; 1488 bytes; 3 parameter(s); 16 callee register(s); 6 variable(s); scope at loc3
[   0] enter             
[   1] get_scope         loc3
[   3] mov               loc4, loc3
[   6] mov               loc6, <JSValue()>(const0)
[   9] mov               loc7, <JSValue()>(const0)
[  12] mov               loc8, arg1
[  15] eq_null           loc9, loc8
[  18] jtrue             loc9, 12(->30)
[  21] new_func_exp      loc6, loc3, f0
[  25] mov               loc9, True(const1)
[  28] jmp               9(->37)
[  30] new_func_exp      loc6, loc3, f1
[  34] mov               loc9, False(const2)
[  37] put_by_id         loc6, PrivateSymbol.isDerivedConstructor(@id0), loc9, IsDirect|Bottom
[  46] new_object        loc9, 1
[  50] mov               loc10, Null(const3)
[  53] is_undefined      loc11, loc8
[  56] jtrue             loc11, 15(->71)
[  59] eq_null           loc11, loc8
[  62] jtrue             loc11, 45(->107)
[  65] is_object         loc11, loc8
[  68] jtrue             loc11, 6(->74)
[  71] throw_static_error String (atomic) (identifier): The superclass is not an object., ID: 4(const4), TypeError
[  74] get_by_id         loc10, loc8, prototype(@id1)    predicting None
[  83] is_object_or_null loc11, loc10
[  86] jtrue             loc11, 12(->98)
[  89] is_function       loc11, loc10
[  92] jtrue             loc11, 6(->98)
[  95] throw_static_error String (atomic) (identifier): The value of the superclass's prototype property is not an object., ID: 4(const5), TypeError
[  98] put_by_id         loc6, __proto__(@id2), loc8, Bottom
[ 107] put_by_id         loc9, __proto__(@id2), loc10, Bottom
[ 116] put_by_id         loc6, PrivateSymbol.homeObject(@id3), loc9, Bottom
[ 125] define_data_property loc9, String (atomic) (identifier): constructor, ID: 4(const6), loc6, Int32: 89(const7)
[ 130] define_data_property loc6, String (atomic) (identifier): prototype, ID: 4(const8), loc9, Int32: 74(const9)
[ 135] mov               loc7, loc6
[ 138] resolve_scope     loc10, loc3, print(@id4), <GlobalProperty>, 1, 0x107dd80a0
[ 145] get_from_scope    loc7, loc10, print(@id4), 2048<ThrowIfNotFound|GlobalProperty|NotInitialization>, 123    predicting None
[ 153] get_by_id         loc11, loc6, __proto__(@id2)    predicting None
[ 162] stricteq          loc9, loc11, arg1
[ 166] call              loc7, loc7, 2, 16 (this at loc10) status(Could Take Slow Path)    Original; predicting None
[ 175] get_by_id         loc7, loc6, __proto__(@id2)    predicting None
[ 184] ret               loc7
```

which looks OK to me.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170417/cacf3c9c/attachment-0001.html>


More information about the webkit-unassigned mailing list