diff --git a/aot/options.cpp b/aot/options.cpp index c5a15797fb19be31747698c3fd296f39657642b6..35361a487248690d5a0c445ced968af20db0285d 100644 --- a/aot/options.cpp +++ b/aot/options.cpp @@ -78,7 +78,7 @@ bool Options::Parse(int argc, const char **argv) panda::PandArg op_ets_module("ets-module", false, "Compile the input as ets-module"); panda::PandArg op_ts_decl_out("gen-ts-decl", "", "For given .ets file, generate .ts interop file"); - auto constexpr DEFAULT_THREAD_COUNT = 2; + auto constexpr DEFAULT_THREAD_COUNT = 0; panda::PandArg op_thread_count("thread", DEFAULT_THREAD_COUNT, "Number of worker threads"); panda::PandArg op_size_stat("dump-size-stat", false, "Dump size statistics"); panda::PandArg output_file("output", "", "Compiler binary output (.abc)"); diff --git a/binder/ETSBinder.h b/binder/ETSBinder.h index 5958839e7d54216599b1ebe54dbb9267f62ed581..481b2347103dc8ef96c0586fe6ed53e9eba99c73 100644 --- a/binder/ETSBinder.h +++ b/binder/ETSBinder.h @@ -22,8 +22,7 @@ namespace panda::es2panda::binder { -using ComputedLambdaObjects = - ArenaUnorderedMap>; +using ComputedLambdaObjects = ArenaMap>; struct DynamicImportData { const ir::ETSImportDeclaration *import; @@ -83,12 +82,12 @@ public: return &global_record_table_; } - ArenaUnorderedMap &GetExternalRecordTable() + ArenaMap &GetExternalRecordTable() { return external_record_table_; } - const ArenaUnorderedMap &GetExternalRecordTable() const + const ArenaMap &GetExternalRecordTable() const { return external_record_table_; } @@ -194,7 +193,7 @@ private: RecordTable global_record_table_; RecordTable *record_table_; - ArenaUnorderedMap external_record_table_; + ArenaMap external_record_table_; ArenaVector default_imports_; ArenaVector dynamic_imports_; ComputedLambdaObjects lambda_objects_; diff --git a/binder/recordTable.h b/binder/recordTable.h index 59cf5ef16d83582497f1be8e4fbf26b29381a8bf..2847f164f952ea8b1ed475013f6df9eb2b778f86 100644 --- a/binder/recordTable.h +++ b/binder/recordTable.h @@ -67,22 +67,22 @@ public: return (flags_ & RecordTableFlags::EXTERNAL) != 0; } - ArenaUnorderedSet &ClassDefinitions() + ArenaSet &ClassDefinitions() { return class_definitions_; } - const ArenaUnorderedSet &ClassDefinitions() const + const ArenaSet &ClassDefinitions() const { return class_definitions_; } - ArenaUnorderedSet &InterfaceDeclarations() + ArenaSet &InterfaceDeclarations() { return interface_declarations_; } - const ArenaUnorderedSet &InterfaceDeclarations() const + const ArenaSet &InterfaceDeclarations() const { return interface_declarations_; } @@ -154,8 +154,8 @@ private: friend class BoundContext; using RecordHolder = std::variant; - ArenaUnorderedSet class_definitions_; - ArenaUnorderedSet interface_declarations_; + ArenaSet class_definitions_; + ArenaSet interface_declarations_; ArenaVector signatures_; RecordHolder record_ {nullptr}; parser::Program *program_ {}; diff --git a/compiler/core/emitter.cpp b/compiler/core/emitter.cpp index 0891cfe7dd533f03811a7b1381f9a448f9b23328..2c5f4f0943acb2f1021bea38404d7de99445d385 100644 --- a/compiler/core/emitter.cpp +++ b/compiler/core/emitter.cpp @@ -384,7 +384,7 @@ static void UpdateLiteralBufferId([[maybe_unused]] panda::pandasm::Ins *ins, [[m void Emitter::AddProgramElement(ProgramElement *program_element) { - prog_->strings.merge(program_element->Strings()); + prog_->strings.insert(program_element->Strings().begin(), program_element->Strings().end()); uint32_t new_literal_buffer_index = literal_buffer_index_; for (const auto &buff : program_element->BuffStorage()) { diff --git a/compiler/core/programElement.cpp b/compiler/core/programElement.cpp index e603e0ac7585176f1a08cc7dce90f991f3ad2da6..bbbdd130eeabb16f52e78539650211ffd7190ec3 100644 --- a/compiler/core/programElement.cpp +++ b/compiler/core/programElement.cpp @@ -18,7 +18,7 @@ #include namespace panda::es2panda::compiler { -std::unordered_set &ProgramElement::Strings() +std::set &ProgramElement::Strings() { return strings_; } diff --git a/compiler/core/programElement.h b/compiler/core/programElement.h index 0fc4d3bb3239436c406d67f6e96505b847b97b3b..db5bd11d145fe9109e8f0d7efb0c3a155988149f 100644 --- a/compiler/core/programElement.h +++ b/compiler/core/programElement.h @@ -32,14 +32,14 @@ public: NO_COPY_SEMANTIC(ProgramElement); NO_MOVE_SEMANTIC(ProgramElement); - std::unordered_set &Strings(); + std::set &Strings(); std::vector &LiteralBufferIns(); std::vector &BuffStorage(); pandasm::Function *Function(); void SetFunction(pandasm::Function *func); private: - std::unordered_set strings_; + std::set strings_; std::vector literal_buffer_ins_; std::vector buff_storage_; pandasm::Function *func_ {};