--- parser3/src/main/compile_tools.h 2023/09/26 20:49:09 1.117 +++ parser3/src/main/compile_tools.h 2026/04/23 18:50:11 1.122 @@ -1,14 +1,14 @@ /** @file Parser: compiler support helper functions decls. - Copyright (c) 2001-2023 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef COMPILE_TOOLS #define COMPILE_TOOLS -#define IDENT_COMPILE_TOOLS_H "$Id: compile_tools.h,v 1.117 2023/09/26 20:49:09 moko Exp $" +#define IDENT_COMPILE_TOOLS_H "$Id: compile_tools.h,v 1.122 2026/04/23 18:50:11 moko Exp $" #include "pa_opcode.h" #include "pa_types.h" @@ -84,6 +84,7 @@ public: bool in_call_value; bool explicit_result; bool append; + bool array; //@} /// output: filled input 'methods' and 'error' if any @@ -115,12 +116,13 @@ public: in_call_value(false), explicit_result(false), append(false), + array(false), error("") { *cclasses+=aclass; } - /// true if exception should be rised + /// false if exception should be rised bool class_add(){ if(cclass_new){ cclass=cclass_new; @@ -128,11 +130,9 @@ public: cclass_new=0; append=false; // append to request's classes - if(!request.allow_class_replace) - return request.classes().put_dont_replace(cclass->type(), cclass) != 0; - request.classes().put(cclass->type(), cclass); + return request.add_class(cclass->type(), cclass); } - return false; + return true; } VStateless_class* get_existed_class(VStateless_class* aclass){ @@ -326,9 +326,9 @@ inline bool maybe_make_get_object_var_el bool maybe_make_self(ArrayOperation& opcodes, ArrayOperation& diving_code, size_t diving_count); -#ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL bool maybe_append_simple_diving_code(ArrayOperation& code, ArrayOperation& diving_code); +#ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL bool is_special_element(ArrayOperation& opcodes); #endif