Revise ES2015 feature guards (#3240)

All the basic language element guards are merged into JERRY_ES2015 macro guard.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2019-10-24 14:44:51 +02:00
committed by Dániel Bátyai
parent 59e0d6e262
commit 3b73562fa5
77 changed files with 725 additions and 911 deletions
+28 -28
View File
@@ -122,9 +122,7 @@ typedef enum
VM_OC_PUSH_OBJECT, /**< push object */
VM_OC_PUSH_NAMED_FUNC_EXPR, /**< push named function expression */
VM_OC_SET_PROPERTY, /**< set property */
#if ENABLED (JERRY_ES2015_OBJECT_INITIALIZER)
VM_OC_SET_COMPUTED_PROPERTY, /**< set computed property */
#endif /* ENABLED (JERRY_ES2015_OBJECT_INITIALIZER) */
VM_OC_SET_GETTER, /**< set getter */
VM_OC_SET_SETTER, /**< set setter */
VM_OC_PUSH_UNDEFINED_BASE, /**< push undefined base */
@@ -208,17 +206,28 @@ typedef enum
VM_OC_FOR_IN_CREATE_CONTEXT, /**< for in create context */
VM_OC_FOR_IN_GET_NEXT, /**< get next */
VM_OC_FOR_IN_HAS_NEXT, /**< has next */
#if ENABLED (JERRY_ES2015_FOR_OF)
VM_OC_FOR_OF_CREATE_CONTEXT, /**< for of create context */
VM_OC_FOR_OF_GET_NEXT, /**< get next */
VM_OC_FOR_OF_HAS_NEXT, /**< has next */
#endif /* ENABLED (JERRY_ES2015_FOR_OF) */
VM_OC_TRY, /**< try */
VM_OC_CATCH, /**< catch */
VM_OC_FINALLY, /**< finally */
VM_OC_CONTEXT_END, /**< context end */
VM_OC_JUMP_AND_EXIT_CONTEXT, /**< jump and exit context */
#if ENABLED (JERRY_ES2015_CLASS)
#if ENABLED (JERRY_DEBUGGER)
VM_OC_BREAKPOINT_ENABLED, /**< enabled breakpoint for debugger */
VM_OC_BREAKPOINT_DISABLED, /**< disabled breakpoint for debugger */
#endif /* ENABLED (JERRY_DEBUGGER) */
#if ENABLED (JERRY_LINE_INFO)
VM_OC_RESOURCE_NAME, /**< resource name of the current function */
VM_OC_LINE, /**< line number of the next statement */
#endif /* ENABLED (JERRY_LINE_INFO) */
#if ENABLED (JERRY_ES2015)
VM_OC_SET_COMPUTED_PROPERTY, /**< set computed property */
VM_OC_FOR_OF_CREATE_CONTEXT, /**< for of create context */
VM_OC_FOR_OF_GET_NEXT, /**< get next */
VM_OC_FOR_OF_HAS_NEXT, /**< has next */
VM_OC_CLASS_HERITAGE, /**< create a super class context */
VM_OC_CLASS_INHERITANCE, /**< inherit properties from the 'super' class */
VM_OC_PUSH_CLASS_CONSTRUCTOR_AND_PROTOTYPE, /**< push class constructor */
@@ -232,15 +241,7 @@ typedef enum
VM_OC_PUSH_CONSTRUCTOR_SUPER, /**< push 'super' inside a class constructor */
VM_OC_PUSH_CONSTRUCTOR_THIS, /**< push 'this' inside a class constructor */
VM_OC_CONSTRUCTOR_RET, /**< explicit return from a class constructor */
#endif /* ENABLED (JERRY_ES2015_CLASS) */
#if ENABLED (JERRY_DEBUGGER)
VM_OC_BREAKPOINT_ENABLED, /**< enabled breakpoint for debugger */
VM_OC_BREAKPOINT_DISABLED, /**< disabled breakpoint for debugger */
#endif /* ENABLED (JERRY_DEBUGGER) */
#if ENABLED (JERRY_LINE_INFO)
VM_OC_RESOURCE_NAME, /**< resource name of the current function */
VM_OC_LINE, /**< line number of the next statement */
#endif /* ENABLED (JERRY_LINE_INFO) */
#endif /* ENABLED (JERRY_ES2015) */
VM_OC_NONE, /**< a special opcode for unsupported byte codes */
} vm_oc_types;
@@ -249,9 +250,6 @@ typedef enum
*/
typedef enum
{
#if !ENABLED (JERRY_ES2015_OBJECT_INITIALIZER)
VM_OC_SET_COMPUTED_PROPERTY = VM_OC_NONE, /**< set computed property is unused */
#endif /* !ENABLED (JERRY_ES2015_OBJECT_INITIALIZER) */
#if !ENABLED (JERRY_DEBUGGER)
VM_OC_BREAKPOINT_ENABLED = VM_OC_NONE, /**< enabled breakpoint for debugger is unused */
VM_OC_BREAKPOINT_DISABLED = VM_OC_NONE, /**< disabled breakpoint for debugger is unused */
@@ -260,7 +258,13 @@ typedef enum
VM_OC_RESOURCE_NAME = VM_OC_NONE, /**< resource name of the current function is unused */
VM_OC_LINE = VM_OC_NONE, /**< line number of the next statement is unused */
#endif /* !ENABLED (JERRY_LINE_INFO) */
#if !ENABLED (JERRY_ES2015_CLASS)
#if !ENABLED (JERRY_ES2015)
VM_OC_SET_COMPUTED_PROPERTY = VM_OC_NONE, /**< set computed property is unused */
VM_OC_FOR_OF_CREATE_CONTEXT = VM_OC_NONE, /**< for of create context */
VM_OC_FOR_OF_GET_NEXT = VM_OC_NONE, /**< get next */
VM_OC_FOR_OF_HAS_NEXT = VM_OC_NONE, /**< has next */
VM_OC_CLASS_HERITAGE = VM_OC_NONE, /**< create a super class context */
VM_OC_CLASS_INHERITANCE = VM_OC_NONE, /**< inherit properties from the 'super' class */
VM_OC_PUSH_CLASS_CONSTRUCTOR_AND_PROTOTYPE = VM_OC_NONE, /**< push class constructor */
@@ -274,12 +278,8 @@ typedef enum
VM_OC_PUSH_CONSTRUCTOR_SUPER = VM_OC_NONE, /**< push 'super' inside a class constructor */
VM_OC_PUSH_CONSTRUCTOR_THIS = VM_OC_NONE, /**< push 'this' inside a class constructor */
VM_OC_CONSTRUCTOR_RET = VM_OC_NONE, /**< explicit return from a class constructor */
#endif /* !ENABLED (JERRY_ES2015_CLASS) */
#if !ENABLED (JERRY_ES2015_FOR_OF)
VM_OC_FOR_OF_CREATE_CONTEXT = VM_OC_NONE, /**< for of create context */
VM_OC_FOR_OF_GET_NEXT = VM_OC_NONE, /**< get next */
VM_OC_FOR_OF_HAS_NEXT = VM_OC_NONE, /**< has next */
#endif /* !ENABLED (JERRY_ES2015_FOR_OF) */
#endif /* !ENABLED (JERRY_ES2015S) */
VM_OC_UNUSED = VM_OC_NONE /**< placeholder if the list is empty */
} vm_oc_unused_types;