Title: [107345] trunk/Source/_javascript_Core
- Revision
- 107345
- Author
- [email protected]
- Date
- 2012-02-09 19:14:34 -0800 (Thu, 09 Feb 2012)
Log Message
Remove BytecodeGenerator::isLocal
https://bugs.webkit.org/show_bug.cgi?id=78241
Minor refactor to BytecodeGenerator.
Patch by Andy Wingo <[email protected]> on 2012-02-09
Reviewed by Gavin Barraclough.
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::isLocal):
(JSC::BytecodeGenerator::isLocalConstant): Remove now-unused
methods.
* bytecompiler/NodesCodegen.cpp:
(JSC::ResolveNode::isPure): Use the ResolveResult mechanism
instead of isLocal. This will recognize more resolve nodes as
being pure.
(JSC::PrefixResolveNode::emitBytecode): Use isReadOnly on the
location instead of isLocalConstant.
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (107344 => 107345)
--- trunk/Source/_javascript_Core/ChangeLog 2012-02-10 02:55:42 UTC (rev 107344)
+++ trunk/Source/_javascript_Core/ChangeLog 2012-02-10 03:14:34 UTC (rev 107345)
@@ -1,3 +1,24 @@
+2012-02-09 Andy Wingo <[email protected]>
+
+ Remove BytecodeGenerator::isLocal
+ https://bugs.webkit.org/show_bug.cgi?id=78241
+
+ Minor refactor to BytecodeGenerator.
+
+ Reviewed by Gavin Barraclough.
+
+ * bytecompiler/BytecodeGenerator.h:
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::isLocal):
+ (JSC::BytecodeGenerator::isLocalConstant): Remove now-unused
+ methods.
+ * bytecompiler/NodesCodegen.cpp:
+ (JSC::ResolveNode::isPure): Use the ResolveResult mechanism
+ instead of isLocal. This will recognize more resolve nodes as
+ being pure.
+ (JSC::PrefixResolveNode::emitBytecode): Use isReadOnly on the
+ location instead of isLocalConstant.
+
2012-02-09 Oliver Hunt <[email protected]>
The JS Parser scope object needs a VectorTrait specialization
Modified: trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp (107344 => 107345)
--- trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp 2012-02-10 02:55:42 UTC (rev 107344)
+++ trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp 2012-02-10 03:14:34 UTC (rev 107345)
@@ -561,19 +561,6 @@
return reg;
}
-bool BytecodeGenerator::isLocal(const Identifier& ident)
-{
- if (ident == propertyNames().thisIdentifier)
- return true;
-
- return shouldOptimizeLocals() && symbolTable().contains(ident.impl());
-}
-
-bool BytecodeGenerator::isLocalConstant(const Identifier& ident)
-{
- return symbolTable().get(ident.impl()).isReadOnly();
-}
-
RegisterID* BytecodeGenerator::newRegister()
{
m_calleeRegisters.append(m_calleeRegisters.size());
Modified: trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.h (107344 => 107345)
--- trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.h 2012-02-10 02:55:42 UTC (rev 107344)
+++ trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.h 2012-02-10 03:14:34 UTC (rev 107345)
@@ -262,9 +262,6 @@
// Returns the register storing "this"
RegisterID* thisRegister() { return &m_thisRegister; }
- bool isLocal(const Identifier&);
- bool isLocalConstant(const Identifier&);
-
// Returns the next available temporary register. Registers returned by
// newTemporary require a modified form of reference counting: any
// register with a refcount of 0 is considered "available", meaning that
Modified: trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp (107344 => 107345)
--- trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp 2012-02-10 02:55:42 UTC (rev 107344)
+++ trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp 2012-02-10 03:14:34 UTC (rev 107345)
@@ -142,7 +142,7 @@
bool ResolveNode::isPure(BytecodeGenerator& generator) const
{
- return generator.isLocal(m_ident);
+ return generator.resolve(m_ident).isStatic();
}
RegisterID* ResolveNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
@@ -792,7 +792,7 @@
{
ResolveResult resolveResult = generator.resolve(m_ident);
if (RegisterID* local = resolveResult.local()) {
- if (generator.isLocalConstant(m_ident)) {
+ if (resolveResult.isReadOnly()) {
if (dst == generator.ignoredResult())
return 0;
RefPtr<RegisterID> r0 = generator.emitLoad(generator.finalDestination(dst), (m_operator == OpPlusPlus) ? 1.0 : -1.0);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes