Title: [258968] trunk/Source/_javascript_Core
- Revision
- 258968
- Author
- [email protected]
- Date
- 2020-03-24 19:07:38 -0700 (Tue, 24 Mar 2020)
Log Message
Introduce @tryGetByIdWithWellKnownSymbol instead of repurposing @tryGetById itself
https://bugs.webkit.org/show_bug.cgi?id=209524
Reviewed by Saam Barati and Yusuke Suzuki.
r258865 allowed @tryGetById to take any ResolveNode, such that a built-in could pass a well-known symbol.
This is much more permissive than necessary, since we shouldn't really need a ResolveNode in the first place;
instead, let's make a new bytecode intrinsic function @tryGetByIdWithWellKnownSymbol for this purpose.
* builtins/RegExpPrototype.js:
(globalPrivate.hasObservableSideEffectsForRegExpSplit):
* bytecode/BytecodeIntrinsicRegistry.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::BytecodeIntrinsicNode::emit_intrinsic_tryGetById): Revert change from r258865.
(JSC::BytecodeIntrinsicNode::emit_intrinsic_tryGetByIdWithWellKnownSymbol): Added.
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (258967 => 258968)
--- trunk/Source/_javascript_Core/ChangeLog 2020-03-25 01:46:09 UTC (rev 258967)
+++ trunk/Source/_javascript_Core/ChangeLog 2020-03-25 02:07:38 UTC (rev 258968)
@@ -1,3 +1,21 @@
+2020-03-24 Ross Kirsling <[email protected]>
+
+ Introduce @tryGetByIdWithWellKnownSymbol instead of repurposing @tryGetById itself
+ https://bugs.webkit.org/show_bug.cgi?id=209524
+
+ Reviewed by Saam Barati and Yusuke Suzuki.
+
+ r258865 allowed @tryGetById to take any ResolveNode, such that a built-in could pass a well-known symbol.
+ This is much more permissive than necessary, since we shouldn't really need a ResolveNode in the first place;
+ instead, let's make a new bytecode intrinsic function @tryGetByIdWithWellKnownSymbol for this purpose.
+
+ * builtins/RegExpPrototype.js:
+ (globalPrivate.hasObservableSideEffectsForRegExpSplit):
+ * bytecode/BytecodeIntrinsicRegistry.h:
+ * bytecompiler/NodesCodegen.cpp:
+ (JSC::BytecodeIntrinsicNode::emit_intrinsic_tryGetById): Revert change from r258865.
+ (JSC::BytecodeIntrinsicNode::emit_intrinsic_tryGetByIdWithWellKnownSymbol): Added.
+
2020-03-24 Tadeu Zagallo <[email protected]>
LLIntGenerator must link switch jumps to otherwise redundant labels
Modified: trunk/Source/_javascript_Core/builtins/RegExpPrototype.js (258967 => 258968)
--- trunk/Source/_javascript_Core/builtins/RegExpPrototype.js 2020-03-25 01:46:09 UTC (rev 258967)
+++ trunk/Source/_javascript_Core/builtins/RegExpPrototype.js 2020-03-25 02:07:38 UTC (rev 258968)
@@ -463,7 +463,7 @@
var regexpSource = @tryGetById(regexp, "source");
if (regexpSource !== @regExpProtoSourceGetter)
return true;
- var regexpSymbolMatch = @tryGetById(regexp, @@match);
+ var regexpSymbolMatch = @tryGetByIdWithWellKnownSymbol(regexp, "match");
if (regexpSymbolMatch !== @regExpPrototypeSymbolMatch)
return true;
Modified: trunk/Source/_javascript_Core/bytecode/BytecodeIntrinsicRegistry.h (258967 => 258968)
--- trunk/Source/_javascript_Core/bytecode/BytecodeIntrinsicRegistry.h 2020-03-25 01:46:09 UTC (rev 258967)
+++ trunk/Source/_javascript_Core/bytecode/BytecodeIntrinsicRegistry.h 2020-03-25 02:07:38 UTC (rev 258968)
@@ -66,6 +66,7 @@
macro(throwRangeError) \
macro(throwOutOfMemoryError) \
macro(tryGetById) \
+ macro(tryGetByIdWithWellKnownSymbol) \
macro(putByIdDirect) \
macro(putByIdDirectPrivate) \
macro(putByValDirect) \
Modified: trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp (258967 => 258968)
--- trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp 2020-03-25 01:46:09 UTC (rev 258967)
+++ trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp 2020-03-25 02:07:38 UTC (rev 258968)
@@ -1422,8 +1422,8 @@
RefPtr<RegisterID> base = generator.emitNode(node);
node = node->m_next;
- ASSERT(node->m_expr->isString() || node->m_expr->isResolveNode());
- const Identifier& ident = node->m_expr->isString() ? static_cast<StringNode*>(node->m_expr)->value() : static_cast<ResolveNode*>(node->m_expr)->identifier();
+ ASSERT(node->m_expr->isString());
+ const Identifier& ident = static_cast<StringNode*>(node->m_expr)->value();
ASSERT(!node->m_next);
RefPtr<RegisterID> finalDest = generator.finalDestination(dst);
@@ -1430,6 +1430,21 @@
return generator.emitTryGetById(finalDest.get(), base.get(), ident);
}
+RegisterID* BytecodeIntrinsicNode::emit_intrinsic_tryGetByIdWithWellKnownSymbol(BytecodeGenerator& generator, RegisterID* dst)
+{
+ ArgumentListNode* node = m_args->m_listNode;
+ RefPtr<RegisterID> base = generator.emitNode(node);
+ node = node->m_next;
+
+ ASSERT(node->m_expr->isString());
+ SymbolImpl* symbol = generator.vm().propertyNames->builtinNames().lookUpWellKnownSymbol(static_cast<StringNode*>(node->m_expr)->value());
+ RELEASE_ASSERT(symbol);
+ ASSERT(!node->m_next);
+
+ RefPtr<RegisterID> finalDest = generator.finalDestination(dst);
+ return generator.emitTryGetById(finalDest.get(), base.get(), generator.parserArena().identifierArena().makeIdentifier(generator.vm(), symbol));
+}
+
RegisterID* BytecodeIntrinsicNode::emit_intrinsic_toNumber(BytecodeGenerator& generator, RegisterID* dst)
{
ArgumentListNode* node = m_args->m_listNode;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes