Branch opcodes have no result and either they have a stack argument

or no arguments at all. To improve the performance, the branch argument
flag is changed into a get argument type which eliminates a flag check
for all executed opcodes. Furthermore branch opcodes skip the put result
phase by changing the "break" to "continue" statements.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2016-06-08 06:29:14 -07:00
parent 2834423fd2
commit d953fbb7be
3 changed files with 115 additions and 116 deletions
+7 -11
View File
@@ -42,11 +42,6 @@
* stack, etc.)
*/
/**
* Opcode has branch argument
*/
#define VM_OC_HAS_BRANCH_ARG 0x8000
/**
* Branch argument is a backward branch
*/
@@ -83,14 +78,15 @@
typedef enum
{
VM_OC_GET_NONE = VM_OC_GET_ARGS_CREATE_INDEX (0), /**< do nothing */
VM_OC_GET_STACK = VM_OC_GET_ARGS_CREATE_INDEX (1), /**< pop one element from the stack */
VM_OC_GET_STACK_STACK = VM_OC_GET_ARGS_CREATE_INDEX (2), /**< pop two elements from the stack */
VM_OC_GET_BRANCH = VM_OC_GET_ARGS_CREATE_INDEX (1), /**< branch argument */
VM_OC_GET_STACK = VM_OC_GET_ARGS_CREATE_INDEX (2), /**< pop one element from the stack */
VM_OC_GET_STACK_STACK = VM_OC_GET_ARGS_CREATE_INDEX (3), /**< pop two elements from the stack */
VM_OC_GET_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (3), /**< resolve literal */
VM_OC_GET_LITERAL_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (4), /**< resolve two literals */
VM_OC_GET_STACK_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (5), /**< pop one element from the stack
VM_OC_GET_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (4), /**< resolve literal */
VM_OC_GET_LITERAL_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (5), /**< resolve two literals */
VM_OC_GET_STACK_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (6), /**< pop one element from the stack
* and resolve a literal */
VM_OC_GET_THIS_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (6), /**< get this and resolve a literal */
VM_OC_GET_THIS_LITERAL = VM_OC_GET_ARGS_CREATE_INDEX (7), /**< get this and resolve a literal */
} vm_oc_get_types;
/**