Title: [128369] trunk/Source/_javascript_Core
- Revision
- 128369
- Author
- commit-qu...@webkit.org
- Date
- 2012-09-12 15:20:34 -0700 (Wed, 12 Sep 2012)
Log Message
Refactor Opcodes to distinguish between core and extension opcodes.
https://bugs.webkit.org/show_bug.cgi?id=96466.
Patch by Mark Lam <mark....@apple.com> on 2012-09-12
Reviewed by Filip Pizlo.
* bytecode/Opcode.h:
(JSC): Added FOR_EACH_CORE_OPCODE_ID() macro.
* llint/LowLevelInterpreter.h:
(JSC): Auto-generate llint opcode aliases using the
FOR_EACH_CORE_OPCODE_ID() macro.
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (128368 => 128369)
--- trunk/Source/_javascript_Core/ChangeLog 2012-09-12 22:19:50 UTC (rev 128368)
+++ trunk/Source/_javascript_Core/ChangeLog 2012-09-12 22:20:34 UTC (rev 128369)
@@ -1,3 +1,16 @@
+2012-09-12 Mark Lam <mark....@apple.com>
+
+ Refactor Opcodes to distinguish between core and extension opcodes.
+ https://bugs.webkit.org/show_bug.cgi?id=96466.
+
+ Reviewed by Filip Pizlo.
+
+ * bytecode/Opcode.h:
+ (JSC): Added FOR_EACH_CORE_OPCODE_ID() macro.
+ * llint/LowLevelInterpreter.h:
+ (JSC): Auto-generate llint opcode aliases using the
+ FOR_EACH_CORE_OPCODE_ID() macro.
+
2012-09-11 Geoffrey Garen <gga...@apple.com>
Second step to fixing the Windows build: Add new symbols.
Modified: trunk/Source/_javascript_Core/bytecode/Opcode.h (128368 => 128369)
--- trunk/Source/_javascript_Core/bytecode/Opcode.h 2012-09-12 22:19:50 UTC (rev 128368)
+++ trunk/Source/_javascript_Core/bytecode/Opcode.h 2012-09-12 22:20:34 UTC (rev 128369)
@@ -39,7 +39,7 @@
namespace JSC {
- #define FOR_EACH_OPCODE_ID(macro) \
+ #define FOR_EACH_CORE_OPCODE_ID_WITH_EXTENSION(macro, extension__) \
macro(op_enter, 1) \
macro(op_create_activation, 2) \
macro(op_init_lazy_reg, 2) \
@@ -200,10 +200,20 @@
macro(op_profile_will_call, 2) \
macro(op_profile_did_call, 2) \
\
- FOR_EACH_LLINT_OPCODE_EXTENSION(macro) \
+ extension__ \
\
macro(op_end, 2) // end must be the last opcode in the list
+ #define FOR_EACH_CORE_OPCODE_ID(macro) \
+ FOR_EACH_CORE_OPCODE_ID_WITH_EXTENSION(macro, /* No extension */ )
+
+ #define FOR_EACH_OPCODE_ID(macro) \
+ FOR_EACH_CORE_OPCODE_ID_WITH_EXTENSION( \
+ macro, \
+ FOR_EACH_LLINT_OPCODE_EXTENSION(macro) \
+ )
+
+
#define OPCODE_ID_ENUM(opcode, length) opcode,
typedef enum { FOR_EACH_OPCODE_ID(OPCODE_ID_ENUM) } OpcodeID;
#undef OPCODE_ID_ENUM
Modified: trunk/Source/_javascript_Core/llint/LowLevelInterpreter.h (128368 => 128369)
--- trunk/Source/_javascript_Core/llint/LowLevelInterpreter.h 2012-09-12 22:19:50 UTC (rev 128368)
+++ trunk/Source/_javascript_Core/llint/LowLevelInterpreter.h 2012-09-12 22:20:34 UTC (rev 128369)
@@ -36,40 +36,17 @@
namespace JSC {
-// The following is a minimal set of alias for the opcode names. This is needed
+// The following is a set of alias for the opcode names. This is needed
// because there is code (e.g. in GetByIdStatus.cpp and PutByIdStatus.cpp)
// which refers to the opcodes expecting them to be prefixed with "llint_".
// In the CLoop implementation, the 2 are equivalent. Hence, we set up this
// alias here.
-//
-// Note: we don't just do this for all opcodes because we only need a few,
-// and currently, FOR_EACH_OPCODE_ID() includes the llint and JIT opcode
-// extensions which we definitely don't want to add an alias for. With some
-// minor refactoring, we can use FOR_EACH_OPCODE_ID() to automatically
-// generate a llint_ alias for all opcodes, but that is not needed at this
-// time.
-const OpcodeID llint_op_call = op_call;
-const OpcodeID llint_op_call_eval = op_call_eval;
-const OpcodeID llint_op_call_varargs = op_call_varargs;
-const OpcodeID llint_op_construct = op_construct;
-const OpcodeID llint_op_catch = op_catch;
-const OpcodeID llint_op_get_by_id = op_get_by_id;
-const OpcodeID llint_op_get_by_id_out_of_line = op_get_by_id_out_of_line;
-const OpcodeID llint_op_put_by_id = op_put_by_id;
-const OpcodeID llint_op_put_by_id_out_of_line = op_put_by_id_out_of_line;
+#define LLINT_OPCODE_ALIAS(opcode, length) \
+ const OpcodeID llint_##opcode = opcode;
+FOR_EACH_CORE_OPCODE_ID(LLINT_OPCODE_ALIAS)
+#undef LLINT_OPCODE_ALIAS
-const OpcodeID llint_op_put_by_id_transition_direct =
- op_put_by_id_transition_direct;
-const OpcodeID llint_op_put_by_id_transition_direct_out_of_line =
- op_put_by_id_transition_direct_out_of_line;
-const OpcodeID llint_op_put_by_id_transition_normal =
- op_put_by_id_transition_normal;
-const OpcodeID llint_op_put_by_id_transition_normal_out_of_line =
- op_put_by_id_transition_normal_out_of_line;
-
-const OpcodeID llint_op_method_check = op_method_check;
-
} // namespace JSC
#else // !ENABLE(LLINT_C_LOOP)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes