Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (91951 => 91952)
--- trunk/Source/_javascript_Core/ChangeLog 2011-07-28 22:00:51 UTC (rev 91951)
+++ trunk/Source/_javascript_Core/ChangeLog 2011-07-28 23:20:25 UTC (rev 91952)
@@ -1,3 +1,25 @@
+2011-07-28 Oliver Hunt <oli...@apple.com>
+
+ *_list instructions are only used in one place, where the code is wrong.
+ https://bugs.webkit.org/show_bug.cgi?id=65348
+
+ Reviewed by Darin Adler.
+
+ Simply remove the instructions and all users. Speeds up the interpreter
+ slightly due to code motion, but otherwise has no effect (because none
+ of the _list instructions are ever used).
+
+ * bytecode/CodeBlock.cpp:
+ (JSC::isPropertyAccess):
+ (JSC::CodeBlock::dump):
+ (JSC::CodeBlock::visitStructures):
+ * bytecode/Instruction.h:
+ * bytecode/Opcode.h:
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+ * jit/JIT.cpp:
+ (JSC::JIT::privateCompileMainPass):
+
2011-07-28 Gavin Barraclough <barraclo...@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=65325
Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp (91951 => 91952)
--- trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp 2011-07-28 22:00:51 UTC (rev 91951)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp 2011-07-28 23:20:25 UTC (rev 91952)
@@ -200,8 +200,6 @@
case op_get_by_id_self:
case op_get_by_id_proto:
case op_get_by_id_chain:
- case op_get_by_id_self_list:
- case op_get_by_id_proto_list:
case op_put_by_id_transition:
case op_put_by_id_replace:
case op_get_by_id:
@@ -813,18 +811,10 @@
printGetByIdOp(exec, location, it, "get_by_id_self");
break;
}
- case op_get_by_id_self_list: {
- printGetByIdOp(exec, location, it, "get_by_id_self_list");
- break;
- }
case op_get_by_id_proto: {
printGetByIdOp(exec, location, it, "get_by_id_proto");
break;
}
- case op_get_by_id_proto_list: {
- printGetByIdOp(exec, location, it, "op_get_by_id_proto_list");
- break;
- }
case op_get_by_id_chain: {
printGetByIdOp(exec, location, it, "get_by_id_chain");
break;
@@ -833,18 +823,10 @@
printGetByIdOp(exec, location, it, "get_by_id_getter_self");
break;
}
- case op_get_by_id_getter_self_list: {
- printGetByIdOp(exec, location, it, "get_by_id_getter_self_list");
- break;
- }
case op_get_by_id_getter_proto: {
printGetByIdOp(exec, location, it, "get_by_id_getter_proto");
break;
}
- case op_get_by_id_getter_proto_list: {
- printGetByIdOp(exec, location, it, "get_by_id_getter_proto_list");
- break;
- }
case op_get_by_id_getter_chain: {
printGetByIdOp(exec, location, it, "get_by_id_getter_chain");
break;
@@ -853,18 +835,10 @@
printGetByIdOp(exec, location, it, "get_by_id_custom_self");
break;
}
- case op_get_by_id_custom_self_list: {
- printGetByIdOp(exec, location, it, "get_by_id_custom_self_list");
- break;
- }
case op_get_by_id_custom_proto: {
printGetByIdOp(exec, location, it, "get_by_id_custom_proto");
break;
}
- case op_get_by_id_custom_proto_list: {
- printGetByIdOp(exec, location, it, "get_by_id_custom_proto_list");
- break;
- }
case op_get_by_id_custom_chain: {
printGetByIdOp(exec, location, it, "get_by_id_custom_chain");
break;
@@ -1506,17 +1480,6 @@
visitor.append(&vPC[3].u.structure);
return;
}
- if ((vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_proto_list))
- || (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self_list))
- || (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_proto_list))
- || (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_self_list))
- || (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_proto_list))
- || (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_self_list))) {
- PolymorphicAccessStructureList* polymorphicStructures = vPC[4].u.polymorphicStructures;
- polymorphicStructures->visitAggregate(visitor, vPC[5].u.operand);
- delete polymorphicStructures;
- return;
- }
// These instructions don't ref their Structures.
ASSERT(vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_get_array_length) || vPC[0].u.opcode == interpreter->getOpcode(op_get_string_length));
Modified: trunk/Source/_javascript_Core/bytecode/Instruction.h (91951 => 91952)
--- trunk/Source/_javascript_Core/bytecode/Instruction.h 2011-07-28 22:00:51 UTC (rev 91951)
+++ trunk/Source/_javascript_Core/bytecode/Instruction.h 2011-07-28 23:20:25 UTC (rev 91952)
@@ -44,16 +44,14 @@
// If the JIT is not in use we don't actually need the variable (that said, if the JIT is not in use we don't
// curently actually use PolymorphicAccessStructureLists, which we should). Anyway, this seems like the best
// solution for now - will need to something smarter if/when we actually want mixed-mode operation.
-#if ENABLE(JIT)
- typedef CodeLocationLabel PolymorphicAccessStructureListStubRoutineType;
-#else
- typedef void* PolymorphicAccessStructureListStubRoutineType;
-#endif
class JSCell;
class Structure;
class StructureChain;
+#if ENABLE(JIT)
+ typedef CodeLocationLabel PolymorphicAccessStructureListStubRoutineType;
+
// Structure used by op_get_by_id_self_list and op_get_by_id_proto_list instruction to hold data off the main opcode stream.
struct PolymorphicAccessStructureList {
WTF_MAKE_FAST_ALLOCATED;
@@ -131,6 +129,8 @@
}
};
+#endif
+
struct Instruction {
Instruction(Opcode opcode)
{
@@ -165,7 +165,7 @@
u.jsCell.clear();
u.jsCell.set(globalData, owner, jsCell);
}
- Instruction(PolymorphicAccessStructureList* polymorphicStructures) { u.polymorphicStructures = polymorphicStructures; }
+
Instruction(PropertySlot::GetValueFunc getterFunc) { u.getterFunc = getterFunc; }
union {
@@ -174,7 +174,6 @@
WriteBarrierBase<Structure> structure;
WriteBarrierBase<StructureChain> structureChain;
WriteBarrierBase<JSCell> jsCell;
- PolymorphicAccessStructureList* polymorphicStructures;
PropertySlot::GetValueFunc getterFunc;
} u;
Modified: trunk/Source/_javascript_Core/bytecode/Opcode.h (91951 => 91952)
--- trunk/Source/_javascript_Core/bytecode/Opcode.h 2011-07-28 22:00:51 UTC (rev 91951)
+++ trunk/Source/_javascript_Core/bytecode/Opcode.h 2011-07-28 23:20:25 UTC (rev 91952)
@@ -109,19 +109,13 @@
macro(op_resolve_with_this, 4) \
macro(op_get_by_id, 8) \
macro(op_get_by_id_self, 8) \
- macro(op_get_by_id_self_list, 8) \
macro(op_get_by_id_proto, 8) \
- macro(op_get_by_id_proto_list, 8) \
macro(op_get_by_id_chain, 8) \
macro(op_get_by_id_getter_self, 8) \
- macro(op_get_by_id_getter_self_list, 8) \
macro(op_get_by_id_getter_proto, 8) \
- macro(op_get_by_id_getter_proto_list, 8) \
macro(op_get_by_id_getter_chain, 8) \
macro(op_get_by_id_custom_self, 8) \
- macro(op_get_by_id_custom_self_list, 8) \
macro(op_get_by_id_custom_proto, 8) \
- macro(op_get_by_id_custom_proto_list, 8) \
macro(op_get_by_id_custom_chain, 8) \
macro(op_get_by_id_generic, 8) \
macro(op_get_array_length, 8) \
Modified: trunk/Source/_javascript_Core/interpreter/Interpreter.cpp (91951 => 91952)
--- trunk/Source/_javascript_Core/interpreter/Interpreter.cpp 2011-07-28 22:00:51 UTC (rev 91951)
+++ trunk/Source/_javascript_Core/interpreter/Interpreter.cpp 2011-07-28 23:20:25 UTC (rev 91952)
@@ -2861,48 +2861,6 @@
#if USE(GCC_COMPUTED_GOTO_WORKAROUND)
skip_id_custom_proto:
#endif
- DEFINE_OPCODE(op_get_by_id_self_list) {
- // Polymorphic self access caching currently only supported when JITting.
- ASSERT_NOT_REACHED();
- // This case of the switch must not be empty, else (op_get_by_id_self_list == op_get_by_id_chain)!
- vPC += OPCODE_LENGTH(op_get_by_id_self_list);
- NEXT_INSTRUCTION();
- }
- DEFINE_OPCODE(op_get_by_id_proto_list) {
- // Polymorphic prototype access caching currently only supported when JITting.
- ASSERT_NOT_REACHED();
- // This case of the switch must not be empty, else (op_get_by_id_proto_list == op_get_by_id_chain)!
- vPC += OPCODE_LENGTH(op_get_by_id_proto_list);
- NEXT_INSTRUCTION();
- }
- DEFINE_OPCODE(op_get_by_id_getter_self_list) {
- // Polymorphic self access caching currently only supported when JITting.
- ASSERT_NOT_REACHED();
- // This case of the switch must not be empty, else (op_get_by_id_self_list == op_get_by_id_chain)!
- vPC += OPCODE_LENGTH(op_get_by_id_self_list);
- NEXT_INSTRUCTION();
- }
- DEFINE_OPCODE(op_get_by_id_getter_proto_list) {
- // Polymorphic prototype access caching currently only supported when JITting.
- ASSERT_NOT_REACHED();
- // This case of the switch must not be empty, else (op_get_by_id_proto_list == op_get_by_id_chain)!
- vPC += OPCODE_LENGTH(op_get_by_id_proto_list);
- NEXT_INSTRUCTION();
- }
- DEFINE_OPCODE(op_get_by_id_custom_self_list) {
- // Polymorphic self access caching currently only supported when JITting.
- ASSERT_NOT_REACHED();
- // This case of the switch must not be empty, else (op_get_by_id_self_list == op_get_by_id_chain)!
- vPC += OPCODE_LENGTH(op_get_by_id_custom_self_list);
- NEXT_INSTRUCTION();
- }
- DEFINE_OPCODE(op_get_by_id_custom_proto_list) {
- // Polymorphic prototype access caching currently only supported when JITting.
- ASSERT_NOT_REACHED();
- // This case of the switch must not be empty, else (op_get_by_id_proto_list == op_get_by_id_chain)!
- vPC += OPCODE_LENGTH(op_get_by_id_proto_list);
- NEXT_INSTRUCTION();
- }
#if USE(GCC_COMPUTED_GOTO_WORKAROUND)
goto *(&&skip_get_by_id_chain);
#endif
Modified: trunk/Source/_javascript_Core/jit/JIT.cpp (91951 => 91952)
--- trunk/Source/_javascript_Core/jit/JIT.cpp 2011-07-28 22:00:51 UTC (rev 91951)
+++ trunk/Source/_javascript_Core/jit/JIT.cpp 2011-07-28 23:20:25 UTC (rev 91952)
@@ -333,19 +333,13 @@
case op_get_by_id_chain:
case op_get_by_id_generic:
case op_get_by_id_proto:
- case op_get_by_id_proto_list:
case op_get_by_id_self:
- case op_get_by_id_self_list:
case op_get_by_id_getter_chain:
case op_get_by_id_getter_proto:
- case op_get_by_id_getter_proto_list:
case op_get_by_id_getter_self:
- case op_get_by_id_getter_self_list:
case op_get_by_id_custom_chain:
case op_get_by_id_custom_proto:
- case op_get_by_id_custom_proto_list:
case op_get_by_id_custom_self:
- case op_get_by_id_custom_self_list:
case op_get_string_length:
case op_put_by_id_generic:
case op_put_by_id_replace: