Refactor Opcodes to distinguish between core and extension opcodes.

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

Patch by Mark Lam <mark.lam@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.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128369 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent db2346c0
2012-09-12 Mark Lam <mark.lam@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 <ggaren@apple.com>
Second step to fixing the Windows build: Add new symbols.
......
......@@ -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 @@ namespace JSC {
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
......
......@@ -36,39 +36,16 @@
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;
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;
#define LLINT_OPCODE_ALIAS(opcode, length) \
const OpcodeID llint_##opcode = opcode;
FOR_EACH_CORE_OPCODE_ID(LLINT_OPCODE_ALIAS)
#undef LLINT_OPCODE_ALIAS
} // namespace JSC
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment