X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/ba379fdc102753d6be2c4d937058fe40257329fe..1df5f87f1309a8daa30dabdee855f48ae40d14ab:/bytecode/Opcode.h diff --git a/bytecode/Opcode.h b/bytecode/Opcode.h index ec39f11..18902eb 100644 --- a/bytecode/Opcode.h +++ b/bytecode/Opcode.h @@ -39,13 +39,17 @@ namespace JSC { #define FOR_EACH_OPCODE_ID(macro) \ macro(op_enter, 1) \ - macro(op_enter_with_activation, 2) \ - macro(op_init_arguments, 1) \ - macro(op_create_arguments, 1) \ + macro(op_create_activation, 2) \ + macro(op_init_lazy_reg, 2) \ + macro(op_create_arguments, 2) \ + macro(op_create_this, 3) \ + macro(op_get_callee, 2) \ macro(op_convert_this, 2) \ + macro(op_convert_this_strict, 2) \ \ macro(op_new_object, 2) \ macro(op_new_array, 4) \ + macro(op_new_array_buffer, 4) \ macro(op_new_regexp, 3) \ macro(op_mov, 3) \ \ @@ -79,6 +83,7 @@ namespace JSC { macro(op_bitor, 5) \ macro(op_bitnot, 3) \ \ + macro(op_check_has_instance, 2) \ macro(op_instanceof, 5) \ macro(op_typeof, 3) \ macro(op_is_undefined, 3) \ @@ -91,12 +96,14 @@ namespace JSC { \ macro(op_resolve, 3) \ macro(op_resolve_skip, 4) \ - macro(op_resolve_global, 6) \ + macro(op_resolve_global, 5) \ + macro(op_resolve_global_dynamic, 6) \ macro(op_get_scoped_var, 4) \ macro(op_put_scoped_var, 4) \ - macro(op_get_global_var, 4) \ - macro(op_put_global_var, 4) \ - macro(op_resolve_base, 3) \ + macro(op_get_global_var, 3) \ + macro(op_put_global_var, 3) \ + macro(op_resolve_base, 4) \ + macro(op_ensure_property_exists, 3) \ macro(op_resolve_with_base, 4) \ macro(op_get_by_id, 8) \ macro(op_get_by_id_self, 8) \ @@ -104,15 +111,28 @@ namespace JSC { 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) \ macro(op_get_string_length, 8) \ - macro(op_put_by_id, 8) \ - macro(op_put_by_id_transition, 8) \ - macro(op_put_by_id_replace, 8) \ - macro(op_put_by_id_generic, 8) \ + macro(op_get_arguments_length, 4) \ + macro(op_put_by_id, 9) \ + macro(op_put_by_id_transition, 9) \ + macro(op_put_by_id_replace, 9) \ + macro(op_put_by_id_generic, 9) \ macro(op_del_by_id, 4) \ macro(op_get_by_val, 4) \ + macro(op_get_argument_by_val, 4) \ + macro(op_get_by_pname, 7) \ macro(op_put_by_val, 4) \ macro(op_del_by_val, 4) \ macro(op_put_by_index, 4) \ @@ -127,33 +147,37 @@ namespace JSC { macro(op_jneq_ptr, 4) \ macro(op_jnless, 4) \ macro(op_jnlesseq, 4) \ + macro(op_jless, 4) \ + macro(op_jlesseq, 4) \ macro(op_jmp_scopes, 3) \ macro(op_loop, 2) \ macro(op_loop_if_true, 3) \ + macro(op_loop_if_false, 3) \ macro(op_loop_if_less, 4) \ macro(op_loop_if_lesseq, 4) \ macro(op_switch_imm, 4) \ macro(op_switch_char, 4) \ macro(op_switch_string, 4) \ \ - macro(op_new_func, 3) \ + macro(op_new_func, 4) \ macro(op_new_func_exp, 3) \ - macro(op_call, 5) \ - macro(op_call_eval, 5) \ - macro(op_call_varargs, 5) \ - macro(op_load_varargs, 3) \ - macro(op_tear_off_activation, 2) \ - macro(op_tear_off_arguments, 1) \ + macro(op_call, 4) \ + macro(op_call_eval, 4) \ + macro(op_call_varargs, 4) \ + macro(op_load_varargs, 4) \ + macro(op_tear_off_activation, 3) \ + macro(op_tear_off_arguments, 2) \ macro(op_ret, 2) \ + macro(op_call_put_result, 2) \ + macro(op_ret_object_or_this, 3) \ macro(op_method_check, 1) \ \ - macro(op_construct, 7) \ - macro(op_construct_verify, 3) \ + macro(op_construct, 4) \ macro(op_strcat, 4) \ macro(op_to_primitive, 3) \ \ - macro(op_get_pnames, 3) \ - macro(op_next_pname, 4) \ + macro(op_get_pnames, 6) \ + macro(op_next_pname, 7) \ \ macro(op_push_scope, 2) \ macro(op_pop_scope, 1) \ @@ -161,7 +185,7 @@ namespace JSC { \ macro(op_catch, 2) \ macro(op_throw, 2) \ - macro(op_new_error, 4) \ + macro(op_throw_reference_error, 2) \ \ macro(op_jsr, 3) \ macro(op_sret, 2) \ @@ -192,8 +216,12 @@ namespace JSC { FOR_EACH_OPCODE_ID(VERIFY_OPCODE_ID); #undef VERIFY_OPCODE_ID -#if HAVE(COMPUTED_GOTO) +#if ENABLE(COMPUTED_GOTO_INTERPRETER) +#if COMPILER(RVCT) || COMPILER(INTEL) + typedef void* Opcode; +#else typedef const void* Opcode; +#endif #else typedef OpcodeID Opcode; #endif @@ -232,6 +260,17 @@ namespace JSC { #endif + inline size_t opcodeLength(OpcodeID opcode) + { + switch (opcode) { +#define OPCODE_ID_LENGTHS(id, length) case id: return OPCODE_LENGTH(id); + FOR_EACH_OPCODE_ID(OPCODE_ID_LENGTHS) +#undef OPCODE_ID_LENGTHS + } + ASSERT_NOT_REACHED(); + return 0; + } + } // namespace JSC #endif // Opcode_h