From fef62f03a272f403b0ddf2e30eb4d4ac9a92c531 Mon Sep 17 00:00:00 2001 From: Paul Tarjan Date: Wed, 15 May 2013 12:32:58 -0700 Subject: [PATCH] kill VM namespace Now that HHVM is the default runtime, this namespace doesn't mean anything. --- hphp/compiler/analysis/emitter.cpp | 2 +- hphp/compiler/analysis/emitter.h | 7 -- hphp/compiler/analysis/peephole.cpp | 2 - hphp/compiler/analysis/peephole.h | 6 +- hphp/compiler/compiler.cpp | 2 +- hphp/hhvm/global_variables.cpp | 2 +- hphp/hhvm/process_init.cpp | 4 +- hphp/hhvm/process_init.h | 10 +- hphp/runtime/base/array/array_data.cpp | 2 +- hphp/runtime/base/array/array_iterator.cpp | 6 +- hphp/runtime/base/array/array_iterator.h | 2 +- hphp/runtime/base/array/hphp_array.cpp | 3 - hphp/runtime/base/array/hphp_array.h | 2 - hphp/runtime/base/array/hphp_array_sort.cpp | 2 +- hphp/runtime/base/builtin_functions.cpp | 48 ++++---- hphp/runtime/base/builtin_functions.h | 4 +- hphp/runtime/base/class_info.cpp | 4 +- hphp/runtime/base/execution_context.cpp | 4 +- hphp/runtime/base/execution_context.h | 114 +++++++++--------- hphp/runtime/base/externals.h | 4 +- hphp/runtime/base/file/user_file.cpp | 16 +-- hphp/runtime/base/file/user_file.h | 30 ++--- .../runtime/base/file/user_stream_wrapper.cpp | 2 +- hphp/runtime/base/file/user_stream_wrapper.h | 2 +- hphp/runtime/base/hphp_value.h | 4 +- hphp/runtime/base/intercept.cpp | 4 +- hphp/runtime/base/macros.h | 8 +- hphp/runtime/base/memory/smart_allocator.h | 6 +- hphp/runtime/base/object_data.cpp | 46 +++---- hphp/runtime/base/object_data.h | 18 ++- hphp/runtime/base/program_functions.cpp | 14 +-- hphp/runtime/base/resource_data.cpp | 2 +- hphp/runtime/base/resource_data.h | 2 +- .../base/server/admin_request_handler.cpp | 14 +-- hphp/runtime/base/stat_cache.cpp | 4 +- hphp/runtime/base/stats.cpp | 2 +- hphp/runtime/base/stats.h | 20 +-- hphp/runtime/base/string_data.cpp | 6 +- hphp/runtime/base/thread_info.cpp | 12 +- hphp/runtime/base/type_object.h | 2 +- hphp/runtime/base/type_variant.cpp | 8 +- hphp/runtime/base/type_variant.h | 2 +- hphp/runtime/base/types.h | 6 +- hphp/runtime/eval/debugger/break_point.cpp | 10 +- hphp/runtime/eval/debugger/break_point.h | 12 +- hphp/runtime/eval/debugger/cmd/cmd_eval.cpp | 4 +- .../eval/debugger/cmd/cmd_flow_control.cpp | 2 +- .../eval/debugger/cmd/cmd_flow_control.h | 2 +- .../eval/debugger/cmd/cmd_instrument.cpp | 36 +++--- hphp/runtime/eval/debugger/cmd/cmd_print.cpp | 4 +- hphp/runtime/eval/debugger/debugger.cpp | 4 +- hphp/runtime/eval/debugger/debugger_proxy.cpp | 2 +- hphp/runtime/eval/debugger/debugger_proxy.h | 6 +- hphp/runtime/eval/debugger/inst_point.cpp | 2 +- hphp/runtime/eval/runtime/file_repository.cpp | 16 +-- hphp/runtime/eval/runtime/file_repository.h | 10 +- .../ext/asio/blockable_wait_handle.cpp | 2 +- .../ext/asio/continuation_wait_handle.cpp | 2 +- .../external_thread_event_wait_handle.cpp | 2 +- .../ext/asio/gen_array_wait_handle.cpp | 2 +- .../ext/asio/reschedule_wait_handle.cpp | 2 +- .../asio/set_result_to_ref_wait_handle.cpp | 2 +- .../ext/asio/static_exception_wait_handle.cpp | 2 +- .../ext/asio/static_result_wait_handle.cpp | 2 +- hphp/runtime/ext/asio/static_wait_handle.cpp | 2 +- hphp/runtime/ext/asio/wait_handle.cpp | 2 +- .../runtime/ext/asio/waitable_wait_handle.cpp | 2 +- hphp/runtime/ext/ext_array.cpp | 2 +- hphp/runtime/ext/ext_asio.h | 22 ++-- hphp/runtime/ext/ext_class.cpp | 56 ++++----- hphp/runtime/ext/ext_closure.cpp | 8 +- hphp/runtime/ext/ext_closure.h | 8 +- hphp/runtime/ext/ext_collections.cpp | 24 ++-- hphp/runtime/ext/ext_collections.h | 20 +-- hphp/runtime/ext/ext_continuation.cpp | 10 +- hphp/runtime/ext/ext_continuation.h | 12 +- hphp/runtime/ext/ext_datetime.cpp | 6 +- hphp/runtime/ext/ext_datetime.h | 6 +- hphp/runtime/ext/ext_debugger.cpp | 8 +- hphp/runtime/ext/ext_debugger.h | 6 +- hphp/runtime/ext/ext_domdocument.cpp | 38 +++--- hphp/runtime/ext/ext_domdocument.h | 38 +++--- hphp/runtime/ext/ext_fb.cpp | 4 +- hphp/runtime/ext/ext_function.cpp | 8 +- hphp/runtime/ext/ext_hotprofiler.cpp | 6 +- hphp/runtime/ext/ext_icu_ucnv.cpp | 2 +- hphp/runtime/ext/ext_icu_ucnv.h | 2 +- hphp/runtime/ext/ext_icu_ucsdet.cpp | 4 +- hphp/runtime/ext/ext_icu_ucsdet.h | 4 +- hphp/runtime/ext/ext_icu_uspoof.cpp | 2 +- hphp/runtime/ext/ext_icu_uspoof.h | 2 +- hphp/runtime/ext/ext_imagesprite.cpp | 2 +- hphp/runtime/ext/ext_imagesprite.h | 2 +- hphp/runtime/ext/ext_intl.cpp | 6 +- hphp/runtime/ext/ext_intl.h | 6 +- hphp/runtime/ext/ext_memcache.cpp | 2 +- hphp/runtime/ext/ext_memcache.h | 2 +- hphp/runtime/ext/ext_memcached.cpp | 2 +- hphp/runtime/ext/ext_memcached.h | 2 +- hphp/runtime/ext/ext_misc.cpp | 22 ++-- hphp/runtime/ext/ext_pdo.cpp | 20 +-- hphp/runtime/ext/ext_pdo.h | 4 +- hphp/runtime/ext/ext_process.cpp | 6 +- hphp/runtime/ext/ext_reflection.cpp | 74 ++++++------ hphp/runtime/ext/ext_simplexml.cpp | 10 +- hphp/runtime/ext/ext_simplexml.h | 6 +- hphp/runtime/ext/ext_soap.cpp | 14 +-- hphp/runtime/ext/ext_soap.h | 10 +- hphp/runtime/ext/ext_spl.cpp | 12 +- hphp/runtime/ext/ext_sqlite3.cpp | 6 +- hphp/runtime/ext/ext_sqlite3.h | 6 +- hphp/runtime/ext/ext_xmlreader.cpp | 2 +- hphp/runtime/ext/ext_xmlreader.h | 2 +- hphp/runtime/ext/ext_xmlwriter.cpp | 2 +- hphp/runtime/ext/ext_xmlwriter.h | 2 +- hphp/runtime/ext_hhvm/ext_hhvm.h | 7 +- hphp/runtime/vm/as.cpp | 4 +- hphp/runtime/vm/as.h | 4 +- hphp/runtime/vm/backup_gc.cpp | 6 +- hphp/runtime/vm/backup_gc.h | 4 +- hphp/runtime/vm/blob_helper.h | 4 +- hphp/runtime/vm/bytecode.cpp | 26 ++-- hphp/runtime/vm/bytecode.h | 38 +++--- hphp/runtime/vm/class.cpp | 3 +- hphp/runtime/vm/class.h | 3 +- hphp/runtime/vm/debug/debug.cpp | 4 +- hphp/runtime/vm/debug/debug.h | 4 +- hphp/runtime/vm/debug/dwarf.cpp | 4 +- hphp/runtime/vm/debug/dwarf.h | 4 +- hphp/runtime/vm/debug/elfwriter.cpp | 4 +- hphp/runtime/vm/debug/elfwriter.h | 4 +- hphp/runtime/vm/debug/gdb-jit.h | 2 +- hphp/runtime/vm/debugger_hook.cpp | 3 +- hphp/runtime/vm/debugger_hook.h | 3 +- hphp/runtime/vm/event_hook.cpp | 2 - hphp/runtime/vm/event_hook.h | 2 - hphp/runtime/vm/fixed_string_map.cpp | 3 +- hphp/runtime/vm/fixed_string_map.h | 3 +- hphp/runtime/vm/func.cpp | 7 +- hphp/runtime/vm/func.h | 3 +- hphp/runtime/vm/func_inline.h | 3 +- hphp/runtime/vm/funcdict.cpp | 5 +- hphp/runtime/vm/funcdict.h | 2 - hphp/runtime/vm/hhbc.cpp | 2 - hphp/runtime/vm/hhbc.h | 3 +- hphp/runtime/vm/indexed_string_map.h | 4 +- hphp/runtime/vm/instance.cpp | 7 +- hphp/runtime/vm/instance.h | 11 +- hphp/runtime/vm/instrumentation.cpp | 11 +- hphp/runtime/vm/instrumentation.h | 3 +- hphp/runtime/vm/instrumentation_hook.h | 3 +- hphp/runtime/vm/member_operations.cpp | 2 - hphp/runtime/vm/member_operations.h | 2 - hphp/runtime/vm/name_value_table.h | 4 +- hphp/runtime/vm/name_value_table_wrapper.cpp | 4 +- hphp/runtime/vm/name_value_table_wrapper.h | 4 +- hphp/runtime/vm/named_entity.h | 4 +- hphp/runtime/vm/object_allocator_sizes.cpp | 3 +- hphp/runtime/vm/object_allocator_sizes.h | 3 +- hphp/runtime/vm/pendq.cpp | 3 +- hphp/runtime/vm/pendq.h | 3 +- hphp/runtime/vm/repo.cpp | 3 +- hphp/runtime/vm/repo.h | 3 +- hphp/runtime/vm/repo_helpers.cpp | 3 +- hphp/runtime/vm/repo_helpers.h | 3 +- hphp/runtime/vm/runtime.cpp | 6 +- hphp/runtime/vm/runtime.h | 24 ++-- hphp/runtime/vm/translator/abi-x64.h | 4 +- hphp/runtime/vm/translator/annotation.cpp | 3 +- hphp/runtime/vm/translator/annotation.h | 3 +- hphp/runtime/vm/translator/asm-x64-test.cpp | 4 +- hphp/runtime/vm/translator/collector.cpp | 3 +- hphp/runtime/vm/translator/fixup.h | 4 +- hphp/runtime/vm/translator/hooks.h | 3 +- hphp/runtime/vm/translator/hopt/check.cpp | 4 +- hphp/runtime/vm/translator/hopt/check.h | 3 +- hphp/runtime/vm/translator/hopt/codegen.cpp | 17 ++- hphp/runtime/vm/translator/hopt/codegen.h | 3 +- hphp/runtime/vm/translator/hopt/cse.h | 3 +- hphp/runtime/vm/translator/hopt/dce.cpp | 3 +- .../vm/translator/hopt/hhbctranslator.cpp | 11 +- .../vm/translator/hopt/hhbctranslator.h | 11 +- hphp/runtime/vm/translator/hopt/ir.cpp | 6 +- hphp/runtime/vm/translator/hopt/ir.h | 25 ++-- hphp/runtime/vm/translator/hopt/irfactory.cpp | 4 +- hphp/runtime/vm/translator/hopt/irfactory.h | 4 +- .../vm/translator/hopt/irtranslator.cpp | 7 +- hphp/runtime/vm/translator/hopt/jumpsopts.cpp | 4 +- .../runtime/vm/translator/hopt/linearscan.cpp | 3 +- hphp/runtime/vm/translator/hopt/linearscan.h | 4 +- hphp/runtime/vm/translator/hopt/memelim.cpp | 3 +- .../vm/translator/hopt/nativecalls.cpp | 8 +- hphp/runtime/vm/translator/hopt/nativecalls.h | 4 +- hphp/runtime/vm/translator/hopt/opt.cpp | 3 +- hphp/runtime/vm/translator/hopt/opt.h | 4 +- hphp/runtime/vm/translator/hopt/print.cpp | 4 +- hphp/runtime/vm/translator/hopt/print.h | 3 +- .../runtime/vm/translator/hopt/simplifier.cpp | 3 +- hphp/runtime/vm/translator/hopt/simplifier.h | 4 +- .../runtime/vm/translator/hopt/state_vector.h | 4 +- hphp/runtime/vm/translator/hopt/test/type.cpp | 8 +- .../vm/translator/hopt/test/vector.cpp | 4 +- .../vm/translator/hopt/tracebuilder.cpp | 3 +- .../runtime/vm/translator/hopt/tracebuilder.h | 4 +- hphp/runtime/vm/translator/hopt/type.cpp | 6 +- .../hopt/vectortranslator-internal.h | 4 +- .../vm/translator/hopt/vectortranslator.cpp | 36 +++--- hphp/runtime/vm/translator/immstack.cpp | 2 - hphp/runtime/vm/translator/immstack.h | 2 - hphp/runtime/vm/translator/physreg.cpp | 4 +- hphp/runtime/vm/translator/physreg.h | 4 +- hphp/runtime/vm/translator/regalloc.cpp | 4 +- hphp/runtime/vm/translator/regalloc.h | 4 +- hphp/runtime/vm/translator/runtime-type.cpp | 3 +- hphp/runtime/vm/translator/runtime-type.h | 3 +- hphp/runtime/vm/translator/srcdb.cpp | 3 +- hphp/runtime/vm/translator/srcdb.h | 3 +- hphp/runtime/vm/translator/targetcache.cpp | 3 +- hphp/runtime/vm/translator/targetcache.h | 3 +- hphp/runtime/vm/translator/test/fixup_map.cpp | 4 +- .../vm/translator/test/tread_hash_map.cpp | 4 +- hphp/runtime/vm/translator/trans-data.h | 3 +- .../runtime/vm/translator/translator-deps.cpp | 3 +- hphp/runtime/vm/translator/translator-deps.h | 3 +- .../runtime/vm/translator/translator-inline.h | 11 +- .../vm/translator/translator-runtime.cpp | 4 +- .../vm/translator/translator-runtime.h | 4 +- .../vm/translator/translator-x64-helpers.cpp | 3 +- .../vm/translator/translator-x64-internal.h | 7 +- .../vm/translator/translator-x64-vector.cpp | 3 +- hphp/runtime/vm/translator/translator-x64.cpp | 13 +- hphp/runtime/vm/translator/translator-x64.h | 12 +- hphp/runtime/vm/translator/translator.cpp | 5 +- hphp/runtime/vm/translator/translator.h | 3 +- hphp/runtime/vm/translator/types.h | 3 +- hphp/runtime/vm/translator/unwind-x64.cpp | 4 +- hphp/runtime/vm/translator/unwind-x64.h | 4 +- hphp/runtime/vm/translator/writelease.cpp | 4 +- hphp/runtime/vm/translator/writelease.h | 4 +- hphp/runtime/vm/translator/x64-util.h | 3 +- hphp/runtime/vm/tread_hash_map.h | 4 +- hphp/runtime/vm/treadmill.cpp | 4 +- hphp/runtime/vm/treadmill.h | 3 +- hphp/runtime/vm/type_constraint.cpp | 2 - hphp/runtime/vm/type_constraint.h | 2 - hphp/runtime/vm/type_profile.cpp | 2 - hphp/runtime/vm/type_profile.h | 3 +- hphp/runtime/vm/unit.cpp | 2 - hphp/runtime/vm/unit.h | 5 +- hphp/runtime/vm/verifier/cfg.cpp | 3 +- hphp/runtime/vm/verifier/cfg.h | 3 +- hphp/runtime/vm/verifier/check.h | 3 +- hphp/runtime/vm/verifier/check_func.cpp | 3 +- hphp/runtime/vm/verifier/check_unit.cpp | 3 +- hphp/runtime/vm/verifier/pretty.cpp | 3 +- hphp/runtime/vm/verifier/pretty.h | 3 +- hphp/runtime/vm/verifier/util.cpp | 4 +- hphp/runtime/vm/verifier/util.h | 3 +- hphp/system/lib/systemlib.cpp | 22 ++-- hphp/system/lib/systemlib.h | 12 +- hphp/tools/gen-ext-hhvm/gen-ext-hhvm.cpp | 6 +- hphp/tools/gen-ext-hhvm/gen-infotabs.cpp | 8 +- hphp/util/asm-x64.cpp | 4 +- hphp/util/asm-x64.h | 4 +- hphp/util/test/asm.cpp | 4 +- hphp/util/util.cpp | 2 +- 266 files changed, 868 insertions(+), 1023 deletions(-) diff --git a/hphp/compiler/analysis/emitter.cpp b/hphp/compiler/analysis/emitter.cpp index 014f296de..5e8e7a087 100644 --- a/hphp/compiler/analysis/emitter.cpp +++ b/hphp/compiler/analysis/emitter.cpp @@ -7504,7 +7504,7 @@ Unit* hphp_compiler_parse(const char* code, int codeLen, const MD5& md5, if (const char* dot = strrchr(filename, '.')) { const char hhbc_ext[] = "hhas"; if (!strcmp(dot + 1, hhbc_ext)) { - return VM::assemble_file(filename, md5); + return assemble_file(filename, md5); } } } diff --git a/hphp/compiler/analysis/emitter.h b/hphp/compiler/analysis/emitter.h index 8af293f4d..4ab6f42a8 100644 --- a/hphp/compiler/analysis/emitter.h +++ b/hphp/compiler/analysis/emitter.h @@ -47,13 +47,6 @@ class HhbcExtClassInfo; namespace Compiler { /////////////////////////////////////////////////////////////////////////////// -using VM::Func; -using VM::Class; -using VM::Unit; -using VM::InvalidAbsoluteOffset; - -using namespace VM; - // Forward declarations. class Label; class EmitterVisitor; diff --git a/hphp/compiler/analysis/peephole.cpp b/hphp/compiler/analysis/peephole.cpp index d1bf255b2..c8218c76d 100644 --- a/hphp/compiler/analysis/peephole.cpp +++ b/hphp/compiler/analysis/peephole.cpp @@ -19,8 +19,6 @@ namespace HPHP { namespace Compiler { -using VM::FuncEmitter; -using VM::UnitEmitter; static void collapseJmp(Offset* offsetPtr, Opcode* instr, Opcode* start) { if (offsetPtr) { diff --git a/hphp/compiler/analysis/peephole.h b/hphp/compiler/analysis/peephole.h index d121d74a3..398950360 100644 --- a/hphp/compiler/analysis/peephole.h +++ b/hphp/compiler/analysis/peephole.h @@ -43,13 +43,13 @@ class MetaInfoBuilder; class Peephole { public: - Peephole(VM::UnitEmitter& ue, MetaInfoBuilder& metaInfo); + Peephole(UnitEmitter& ue, MetaInfoBuilder& metaInfo); private: - void buildFuncTargets(VM::FuncEmitter* fe); + void buildFuncTargets(FuncEmitter* fe); void buildJumpTargets(); - VM::UnitEmitter& m_ue; + UnitEmitter& m_ue; hphp_hash_set m_jumpTargets; }; diff --git a/hphp/compiler/compiler.cpp b/hphp/compiler/compiler.cpp index 9cd75d0bf..a12e4e070 100644 --- a/hphp/compiler/compiler.cpp +++ b/hphp/compiler/compiler.cpp @@ -157,7 +157,7 @@ int compiler_main(int argc, char **argv) { try { Hdf empty; RuntimeOption::Load(empty); - VM::initialize_repo(); + initialize_repo(); CompilerOptions po; #ifdef FACEBOOK diff --git a/hphp/hhvm/global_variables.cpp b/hphp/hhvm/global_variables.cpp index cc232af02..ef7a2b4bf 100644 --- a/hphp/hhvm/global_variables.cpp +++ b/hphp/hhvm/global_variables.cpp @@ -41,7 +41,7 @@ void free_global_variables_after_sweep() { SystemGlobals* get_system_globals() { return get_global_variables(); } -VM::GlobalNameValueTableWrapper::GlobalNameValueTableWrapper( +GlobalNameValueTableWrapper::GlobalNameValueTableWrapper( NameValueTable* tab) : NameValueTableWrapper(tab) { VarNR arr(HphpArray::GetStaticEmptyArray()); diff --git a/hphp/hhvm/process_init.cpp b/hphp/hhvm/process_init.cpp index c23f0763a..63f5422d2 100644 --- a/hphp/hhvm/process_init.cpp +++ b/hphp/hhvm/process_init.cpp @@ -35,7 +35,6 @@ #include namespace HPHP { -namespace VM { /////////////////////////////////////////////////////////////////////////////// @@ -98,7 +97,7 @@ void ProcessInit() { ClassInfo::SetHook(&vm_class_info_hook); // ensure that nextTx64 and tx64 are set - (void)VM::Transl::Translator::Get(); + (void)Transl::Translator::Get(); // Save the current options, and set things up so that // systemlib.php can be read from and stored in the @@ -194,4 +193,3 @@ void ProcessInit() { /////////////////////////////////////////////////////////////////////////////// } -} diff --git a/hphp/hhvm/process_init.h b/hphp/hhvm/process_init.h index 661d9cd35..fca57179b 100644 --- a/hphp/hhvm/process_init.h +++ b/hphp/hhvm/process_init.h @@ -26,16 +26,14 @@ namespace HPHP { extern void (*g_vmProcessInit)(); void hphp_process_init(); -namespace VM { - void ProcessInit(); - void initialize_repo(); -} +void ProcessInit(); +void initialize_repo(); /* * This must be called before execute_program_impl in an hhvm build. */ inline void register_process_init() { - g_vmProcessInit = &VM::ProcessInit; + g_vmProcessInit = &ProcessInit; g_hphp_compiler_parse = &HPHP::Compiler::hphp_compiler_parse; g_hphp_build_native_func_unit = &HPHP::Compiler:: hphp_build_native_func_unit; @@ -50,7 +48,7 @@ inline void register_process_init() { */ inline void init_for_unit_test() { register_process_init(); - VM::initialize_repo(); + initialize_repo(); init_thread_locals(); Hdf config; RuntimeOption::Load(config); diff --git a/hphp/runtime/base/array/array_data.cpp b/hphp/runtime/base/array/array_data.cpp index c4f2086ec..616dd015b 100644 --- a/hphp/runtime/base/array/array_data.cpp +++ b/hphp/runtime/base/array/array_data.cpp @@ -129,7 +129,7 @@ void ArrayData::release() { // reads Object ArrayData::toObject() const { - return VM::Instance::FromArray(const_cast(this)); + return Instance::FromArray(const_cast(this)); } bool ArrayData::isVectorData() const { diff --git a/hphp/runtime/base/array/array_iterator.cpp b/hphp/runtime/base/array/array_iterator.cpp index a1a6f18fc..861768b74 100644 --- a/hphp/runtime/base/array/array_iterator.cpp +++ b/hphp/runtime/base/array/array_iterator.cpp @@ -587,7 +587,7 @@ bool Iter::init(TypedValue* c1) { if (isIterator) { (void) new (&arr()) ArrayIter(obj, ArrayIter::transferOwner); } else { - VM::Class* ctx = arGetContextClass(g_vmContext->getFP()); + Class* ctx = arGetContextClass(g_vmContext->getFP()); CStrRef ctxStr = ctx ? ctx->nameRef() : null_string; Array iterArray(obj->o_toIterArray(ctxStr)); ArrayData* ad = iterArray.getArrayData(); @@ -637,7 +637,7 @@ bool Iter::minit(TypedValue* v1) { if (isIterator) { raise_error("An iterator cannot be used with foreach by reference"); } - VM::Class* ctx = arGetContextClass(g_vmContext->getFP()); + Class* ctx = arGetContextClass(g_vmContext->getFP()); CStrRef ctxStr = ctx ? ctx->nameRef() : null_string; Array iterArray = obj->o_toIterArray(ctxStr, true); if (iterArray->empty()) { @@ -881,7 +881,7 @@ class FreeObj { * If exceptions are thrown, new_iter_object takes care of decRefing the object. */ HOT_FUNC -int64_t new_iter_object(Iter* dest, ObjectData* obj, VM::Class* ctx, +int64_t new_iter_object(Iter* dest, ObjectData* obj, Class* ctx, TypedValue* valOut, TypedValue* keyOut) { valOut = tvToCell(valOut); if (keyOut) { diff --git a/hphp/runtime/base/array/array_iterator.h b/hphp/runtime/base/array/array_iterator.h index 0b560b35e..2e064fe10 100644 --- a/hphp/runtime/base/array/array_iterator.h +++ b/hphp/runtime/base/array/array_iterator.h @@ -471,7 +471,7 @@ bool interp_iter_next_m(Iter* it); int64_t new_iter_array(Iter* dest, ArrayData* arr, TypedValue* val); int64_t new_iter_array_key(Iter* dest, ArrayData* arr, TypedValue* val, TypedValue* key); -int64_t new_iter_object(Iter* dest, ObjectData* obj, VM::Class* ctx, +int64_t new_iter_object(Iter* dest, ObjectData* obj, Class* ctx, TypedValue* val, TypedValue* key); int64_t iter_next(Iter* dest, TypedValue* val); int64_t iter_next_key(Iter* dest, TypedValue* val, TypedValue* key); diff --git a/hphp/runtime/base/array/hphp_array.cpp b/hphp/runtime/base/array/hphp_array.cpp index b33217fc7..7d4f54f30 100644 --- a/hphp/runtime/base/array/hphp_array.cpp +++ b/hphp/runtime/base/array/hphp_array.cpp @@ -1679,7 +1679,6 @@ CVarRef HphpArray::endRef() { //============================================================================= // VM runtime support functions. -namespace VM { // Helpers for array_setm. ArrayData* nvCheckedSet(ArrayData* a, StringData* key, TypedValue* value, @@ -1893,8 +1892,6 @@ ArrayData* array_add(ArrayData* a1, ArrayData* a2) { return a1; } -} - //============================================================================= /////////////////////////////////////////////////////////////////////////////// diff --git a/hphp/runtime/base/array/hphp_array.h b/hphp/runtime/base/array/hphp_array.h index 665c05854..9b2b5eff8 100644 --- a/hphp/runtime/base/array/hphp_array.h +++ b/hphp/runtime/base/array/hphp_array.h @@ -505,7 +505,6 @@ public: //============================================================================= // VM runtime support functions. -namespace VM { enum ArrayGetFlags { DecRefKey = 1, @@ -545,7 +544,6 @@ uint64_t array_issetm_i(const void* hphpArray, int64_t key) FLATTEN; ArrayData* array_add(ArrayData* a1, ArrayData* a2); -} //============================================================================= /////////////////////////////////////////////////////////////////////////////// diff --git a/hphp/runtime/base/array/hphp_array_sort.cpp b/hphp/runtime/base/array/hphp_array_sort.cpp index 253b25aee..77b27b72c 100644 --- a/hphp/runtime/base/array/hphp_array_sort.cpp +++ b/hphp/runtime/base/array/hphp_array_sort.cpp @@ -220,7 +220,7 @@ void HphpArray::asort(int sort_flags, bool ascending) { m_pos = ssize_t(0); \ try { \ ElmUCompare comp; \ - VM::Transl::CallerFrame cf; \ + Transl::CallerFrame cf; \ CallCtx ctx; \ vm_decode_function(cmp_function, cf(), false, ctx); \ comp.ctx = &ctx; \ diff --git a/hphp/runtime/base/builtin_functions.cpp b/hphp/runtime/base/builtin_functions.cpp index 699093265..7f86b1362 100644 --- a/hphp/runtime/base/builtin_functions.cpp +++ b/hphp/runtime/base/builtin_functions.cpp @@ -81,17 +81,17 @@ bool array_is_valid_callback(CArrRef arr) { return true; } -const HPHP::VM::Func* +const HPHP::Func* vm_decode_function(CVarRef function, ActRec* ar, bool forwarding, ObjectData*& this_, - HPHP::VM::Class*& cls, + HPHP::Class*& cls, StringData*& invName, bool warn /* = true */) { invName = nullptr; if (function.isString() || function.isArray()) { - HPHP::VM::Class* ctx = nullptr; + HPHP::Class* ctx = nullptr; if (ar) ctx = arGetContextClass(ar); // Decode the 'function' parameter into this_, cls, name, pos, and // nameContainsClass. @@ -160,7 +160,7 @@ vm_decode_function(CVarRef function, "is undefined", sclass->data(), name->data()); } } - cls = VM::Unit::loadClass(sclass.get()); + cls = Unit::loadClass(sclass.get()); } if (!cls) { if (warn) { @@ -175,7 +175,7 @@ vm_decode_function(CVarRef function, } } - HPHP::VM::Class* cc = cls; + HPHP::Class* cc = cls; if (nameContainsClass) { String c = name.substr(0, pos); name = name.substr(pos + 2); @@ -206,7 +206,7 @@ vm_decode_function(CVarRef function, } } } else { - cc = VM::Unit::loadClass(c.get()); + cc = Unit::loadClass(c.get()); } if (!cc) { if (warn) { @@ -231,7 +231,7 @@ vm_decode_function(CVarRef function, } } if (!cls) { - HPHP::VM::Func* f = HPHP::VM::Unit::loadFunc(name.get()); + HPHP::Func* f = HPHP::Unit::loadFunc(name.get()); if (!f) { if (warn) { throw_invalid_argument("function: method '%s' not found", @@ -244,7 +244,7 @@ vm_decode_function(CVarRef function, } assert(cls); CallType lookupType = this_ ? ObjMethod : ClsMethod; - const HPHP::VM::Func* f = + const HPHP::Func* f = g_vmContext->lookupMethodCtx(cc, name.get(), ctx, lookupType); if (f && (f->attrs() & AttrStatic)) { // If we found a method and its static, null out this_ @@ -293,7 +293,7 @@ vm_decode_function(CVarRef function, // If we are doing a forwarding call and this_ is null, set cls // appropriately to propagate the current late bound class. if (!this_ && forwarding && ar) { - HPHP::VM::Class* fwdCls = nullptr; + HPHP::Class* fwdCls = nullptr; ObjectData* obj = ar->hasThis() ? ar->getThis() : nullptr; if (obj) { fwdCls = obj->getVMClass(); @@ -312,7 +312,7 @@ vm_decode_function(CVarRef function, static StringData* invokeStr = StringData::GetStaticString("__invoke"); this_ = function.asCObjRef().get(); cls = nullptr; - const HPHP::VM::Func *f = this_->getVMClass()->lookupMethod(invokeStr); + const HPHP::Func *f = this_->getVMClass()->lookupMethod(invokeStr); if (f != nullptr && ((f->attrs() & AttrStatic) && !f->isClosureBody())) { // If __invoke is static, invoke it as such @@ -330,10 +330,10 @@ vm_decode_function(CVarRef function, Variant vm_call_user_func(CVarRef function, CArrRef params, bool forwarding /* = false */) { ObjectData* obj = nullptr; - HPHP::VM::Class* cls = nullptr; - HPHP::VM::Transl::CallerFrame cf; + HPHP::Class* cls = nullptr; + HPHP::Transl::CallerFrame cf; StringData* invName = nullptr; - const HPHP::VM::Func* f = vm_decode_function(function, cf(), forwarding, + const HPHP::Func* f = vm_decode_function(function, cf(), forwarding, obj, cls, invName); if (f == nullptr) { return uninit_null(); @@ -346,7 +346,7 @@ Variant vm_call_user_func(CVarRef function, CArrRef params, Variant invoke(CStrRef function, CArrRef params, strhash_t hash /* = -1 */, bool tryInterp /* = true */, bool fatal /* = true */) { - VM::Func* func = VM::Unit::loadFunc(function.get()); + Func* func = Unit::loadFunc(function.get()); if (func) { Variant ret; g_vmContext->invokeFunc(ret.asTypedValue(), func, params); @@ -363,12 +363,12 @@ Variant invoke(const char *function, CArrRef params, strhash_t hash /* = -1*/, Variant invoke_static_method(CStrRef s, CStrRef method, CArrRef params, bool fatal /* = true */) { - HPHP::VM::Class* class_ = VM::Unit::lookupClass(s.get()); + HPHP::Class* class_ = Unit::lookupClass(s.get()); if (class_ == nullptr) { o_invoke_failed(s.data(), method.data(), fatal); return uninit_null(); } - const HPHP::VM::Func* f = class_->lookupMethod(method.get()); + const HPHP::Func* f = class_->lookupMethod(method.get()); if (f == nullptr || !(f->attrs() & AttrStatic)) { o_invoke_failed(s.data(), method.data(), fatal); return uninit_null(); @@ -1046,7 +1046,7 @@ bool invoke_file_impl(Variant &res, CStrRef path, bool once, bool initial; HPHP::Eval::PhpFile* efile = g_vmContext->lookupPhpFile(path.get(), currentDir, &initial); - HPHP::VM::Unit* u = nullptr; + HPHP::Unit* u = nullptr; if (efile) u = efile->unit(); if (u == nullptr) { return false; @@ -1225,14 +1225,14 @@ class ClassExistsChecker { public: ClassExistsChecker() {} bool operator()(CStrRef name) const { - return VM::Unit::lookupClass(name.get()) != nullptr; + return Unit::lookupClass(name.get()) != nullptr; } }; class ConstantExistsChecker { public: bool operator()(CStrRef name) const { - return VM::Unit::lookupCns(name.get()) != nullptr; + return Unit::lookupCns(name.get()) != nullptr; } }; @@ -1257,10 +1257,10 @@ AutoloadHandler::Result AutoloadHandler::loadFromMap(CStrRef name, } } try { - VM::Transl::VMRegAnchor _; + Transl::VMRegAnchor _; bool initial; VMExecutionContext* ec = g_vmContext; - VM::Unit* u = ec->evalInclude(fName.get(), nullptr, &initial); + Unit* u = ec->evalInclude(fName.get(), nullptr, &initial); if (u) { if (initial) { TypedValue retval; @@ -1306,7 +1306,7 @@ bool AutoloadHandler::autoloadType(CStrRef name) { return !m_map.isNull() && loadFromMap(name, s_type, true, [] (CStrRef name) { - return !!VM::Unit::GetNamedEntity(name.get())->getCachedNameDef(); + return !!Unit::GetNamedEntity(name.get())->getCachedNameDef(); } ) != Failure; } @@ -1362,7 +1362,7 @@ bool AutoloadHandler::invokeHandler(CStrRef className, autoloadException = ex; } } - if (VM::Unit::lookupClass(className.get()) != nullptr) { + if (Unit::lookupClass(className.get()) != nullptr) { break; } } @@ -1429,7 +1429,7 @@ String AutoloadHandler::getSignature(CVarRef handler) { } bool function_exists(CStrRef function_name) { - return HPHP::VM::Unit::lookupFunc(function_name.get()) != nullptr; + return HPHP::Unit::lookupFunc(function_name.get()) != nullptr; } /////////////////////////////////////////////////////////////////////////////// diff --git a/hphp/runtime/base/builtin_functions.h b/hphp/runtime/base/builtin_functions.h index 27502c139..85794d0d0 100644 --- a/hphp/runtime/base/builtin_functions.h +++ b/hphp/runtime/base/builtin_functions.h @@ -353,12 +353,12 @@ bool array_is_valid_callback(CArrRef arr); Variant f_call_user_func_array(CVarRef function, CArrRef params, bool bound = false); -const HPHP::VM::Func* +const HPHP::Func* vm_decode_function(CVarRef function, ActRec* ar, bool forwarding, ObjectData*& this_, - HPHP::VM::Class*& cls, + HPHP::Class*& cls, StringData*& invName, bool warn = true); diff --git a/hphp/runtime/base/class_info.cpp b/hphp/runtime/base/class_info.cpp index 6f99d94a1..bd962f3eb 100644 --- a/hphp/runtime/base/class_info.cpp +++ b/hphp/runtime/base/class_info.cpp @@ -242,10 +242,10 @@ void ClassInfo::InitializeSystemConstants() { for (ConstantMap::const_iterator it = scm.begin(); it != scm.end(); ++it) { ConstantInfo* ci = it->second; if (ci->isDynamic()) { - VM::Unit::defDynamicSystemConstant(ci->name.get(), ci); + Unit::defDynamicSystemConstant(ci->name.get(), ci); } else { Variant v = ci->getValue(); - bool DEBUG_ONLY res = VM::Unit::defCns(ci->name.get(), + bool DEBUG_ONLY res = Unit::defCns(ci->name.get(), v.asTypedValue(), true); assert(res); } diff --git a/hphp/runtime/base/execution_context.cpp b/hphp/runtime/base/execution_context.cpp index 2dea3e17c..0e230cbdb 100644 --- a/hphp/runtime/base/execution_context.cpp +++ b/hphp/runtime/base/execution_context.cpp @@ -139,8 +139,8 @@ VMExecutionContext::~VMExecutionContext() { delete m_lastLocFilter; if (UNLIKELY(!m_preConsts.empty())) { - VM::Transl::unmergePreConsts(m_preConsts, this); - for (VM::PreConstVec::iterator i = m_preConsts.begin(); + Transl::unmergePreConsts(m_preConsts, this); + for (PreConstVec::iterator i = m_preConsts.begin(); i != m_preConsts.end(); ++i) { decRefStr(const_cast(i->name)); } diff --git a/hphp/runtime/base/execution_context.h b/hphp/runtime/base/execution_context.h index 460bcbfa6..4f78113d8 100644 --- a/hphp/runtime/base/execution_context.h +++ b/hphp/runtime/base/execution_context.h @@ -44,13 +44,11 @@ namespace Eval { class PhpFile; } -namespace VM { class EventHook; namespace Transl { class Translator; } class PCFilter; -} /////////////////////////////////////////////////////////////////////////////// @@ -130,7 +128,7 @@ class ClassInfoVM : public ClassInfo, UserAttributeVec m_userAttrVec; public: - friend class HPHP::VM::Class; + friend class HPHP::Class; }; namespace MethodLookup { @@ -432,21 +430,21 @@ public: static void getElem(TypedValue* base, TypedValue* key, TypedValue* dest); template static c_Continuation* createContinuationHelper( - const VM::Func* origFunc, - const VM::Func* genFunc, + const Func* origFunc, + const Func* genFunc, ObjectData* thisPtr, ArrayData* args, - VM::Class* frameStaticCls); + Class* frameStaticCls); template static c_Continuation* createContinuation(ActRec* fp, bool getArgs, - const VM::Func* origFunc, - const VM::Func* genFunc); + const Func* origFunc, + const Func* genFunc); static c_Continuation* fillContinuationVars( - ActRec* fp, const VM::Func* origFunc, const VM::Func* genFunc, + ActRec* fp, const Func* origFunc, const Func* genFunc, c_Continuation* cont); static void unpackContVarEnvLinkage(ActRec* fp); static void packContVarEnvLinkage(ActRec* fp); - void pushLocalsAndIterators(const HPHP::VM::Func* f, int nparams = 0); + void pushLocalsAndIterators(const HPHP::Func* f, int nparams = 0); private: enum VectorLeaveCode { @@ -459,13 +457,13 @@ private: TypedValue& tvScratch, TypedValue& tvLiteral, TypedValue& tvRef, TypedValue& tvRef2, - VM::MemberCode& mcode, TypedValue*& curMember); + MemberCode& mcode, TypedValue*& curMember); template void getHelperPre(PC& pc, unsigned& ndiscard, TypedValue*& base, TypedValue& tvScratch, TypedValue& tvLiteral, TypedValue& tvRef, TypedValue& tvRef2, - VM::MemberCode& mcode, TypedValue*& curMember); + MemberCode& mcode, TypedValue*& curMember); template void getHelperPost(unsigned ndiscard, TypedValue*& tvRet, TypedValue& tvScratch, TypedValue& tvRef, @@ -474,7 +472,7 @@ private: TypedValue*& base, TypedValue& tvScratch, TypedValue& tvLiteral, TypedValue& tvRef, TypedValue& tvRef2, - VM::MemberCode& mcode, TypedValue*& curMember); + MemberCode& mcode, TypedValue*& curMember); template @@ -482,11 +480,11 @@ private: TypedValue& tvScratch, TypedValue& tvLiteral, TypedValue& tvRef, TypedValue& tvRef2, - VM::MemberCode& mcode, TypedValue*& curMember); + MemberCode& mcode, TypedValue*& curMember); template void setHelperPost(unsigned ndiscard, TypedValue& tvRef, TypedValue& tvRef2); - bool cellInstanceOf(TypedValue* c, const HPHP::VM::NamedEntity* s); + bool cellInstanceOf(TypedValue* c, const HPHP::NamedEntity* s); bool initIterator(PC& pc, PC& origPc, Iter* it, Offset offset, Cell* c1); bool initIteratorM(PC& pc, PC& origPc, Iter* it, @@ -500,49 +498,49 @@ OPCODES void contSendImpl(); void classExistsImpl(PC& pc, Attr typeAttr); void fPushObjMethodImpl( - VM::Class* cls, StringData* name, ObjectData* obj, int numArgs); - ActRec* fPushFuncImpl(const VM::Func* func, int numArgs); + Class* cls, StringData* name, ObjectData* obj, int numArgs); + ActRec* fPushFuncImpl(const Func* func, int numArgs); public: typedef hphp_hash_map ConstInfoMap; ConstInfoMap m_constInfo; - typedef hphp_hash_map > ClsCnsDataMap; + typedef hphp_hash_map > ClsCnsDataMap; ClsCnsDataMap m_clsCnsData; - typedef hphp_hash_map > PropDataMap; + typedef hphp_hash_map > PropDataMap; PropDataMap m_propData; - typedef hphp_hash_map > SPropDataMap; + typedef hphp_hash_map > SPropDataMap; SPropDataMap m_sPropData; - typedef hphp_hash_map > FuncStaticCtxMap; + typedef hphp_hash_map > FuncStaticCtxMap; FuncStaticCtxMap m_funcStaticCtx; - const HPHP::VM::Func* lookupMethodCtx(const HPHP::VM::Class* cls, + const HPHP::Func* lookupMethodCtx(const HPHP::Class* cls, const StringData* methodName, - HPHP::VM::Class* pctx, + HPHP::Class* pctx, MethodLookup::CallType lookupType, bool raise = false); - MethodLookup::LookupResult lookupObjMethod(const HPHP::VM::Func*& f, - const HPHP::VM::Class* cls, + MethodLookup::LookupResult lookupObjMethod(const HPHP::Func*& f, + const HPHP::Class* cls, const StringData* methodName, bool raise = false); - MethodLookup::LookupResult lookupClsMethod(const HPHP::VM::Func*& f, - const HPHP::VM::Class* cls, + MethodLookup::LookupResult lookupClsMethod(const HPHP::Func*& f, + const HPHP::Class* cls, const StringData* methodName, ObjectData* this_, bool raise = false); - MethodLookup::LookupResult lookupCtorMethod(const HPHP::VM::Func*& f, - const HPHP::VM::Class* cls, + MethodLookup::LookupResult lookupCtorMethod(const HPHP::Func*& f, + const HPHP::Class* cls, bool raise = false); HPHP::ObjectData* createObject(StringData* clsName, CArrRef params, bool init = true); HPHP::ObjectData* createObjectOnly(StringData* clsName); - HphpArray* getFuncStaticCtx(const HPHP::VM::Func* f) { + HphpArray* getFuncStaticCtx(const HPHP::Func* f) { FuncStaticCtxMap::iterator it = m_funcStaticCtx.find(f); if (it != m_funcStaticCtx.end()) { return it->second; @@ -553,19 +551,19 @@ public: return m_funcStaticCtx[f] = array; } - HphpArray* getClsCnsData(const HPHP::VM::Class* class_) const { + HphpArray* getClsCnsData(const HPHP::Class* class_) const { ClsCnsDataMap::const_iterator it = m_clsCnsData.find(class_); if (it == m_clsCnsData.end()) { return nullptr; } return it->second; } - void setClsCnsData(const HPHP::VM::Class* class_, HphpArray* clsCnsData) { + void setClsCnsData(const HPHP::Class* class_, HphpArray* clsCnsData) { assert(getClsCnsData(class_) == nullptr); m_clsCnsData[class_] = clsCnsData; } - TypedValue* lookupClsCns(const HPHP::VM::NamedEntity* ne, + TypedValue* lookupClsCns(const HPHP::NamedEntity* ne, const StringData* cls, const StringData* cns); @@ -583,9 +581,9 @@ public: VarEnv* m_globalVarEnv; VarEnv* m_topVarEnv; - HPHP::VM::RenamedFuncDict m_renamedFuncs; + HPHP::RenamedFuncDict m_renamedFuncs; EvaledFilesMap m_evaledFiles; - typedef std::vector EvaledUnitsVec; + typedef std::vector EvaledUnitsVec; EvaledUnitsVec m_createdFuncs; /* @@ -609,8 +607,8 @@ public: ActRec* getStackFrame(); ObjectData* getThis(); - VM::Class* getContextClass(); - VM::Class* getParentContextClass(); + Class* getContextClass(); + Class* getParentContextClass(); CStrRef getContainingFileName(); int getLine(); Array getCallerInfo(); @@ -619,17 +617,17 @@ public: void addRenameableFunctions(ArrayData* arr); HPHP::Eval::PhpFile* lookupPhpFile( StringData* path, const char* currentDir, bool* initial = nullptr); - HPHP::VM::Unit* evalInclude(StringData* path, + HPHP::Unit* evalInclude(StringData* path, const StringData* curUnitFilePath, bool* initial); - HPHP::VM::Unit* evalIncludeRoot(StringData* path, + HPHP::Unit* evalIncludeRoot(StringData* path, InclOpFlags flags, bool* initial); HPHP::Eval::PhpFile* lookupIncludeRoot(StringData* path, InclOpFlags flags, bool* initial, - HPHP::VM::Unit* unit = 0); - bool evalUnit(HPHP::VM::Unit* unit, bool local, + HPHP::Unit* unit = 0); + bool evalUnit(HPHP::Unit* unit, bool local, PC& pc, int funcType); - void invokeUnit(TypedValue* retval, HPHP::VM::Unit* unit); - HPHP::VM::Unit* compileEvalString(StringData* code); + void invokeUnit(TypedValue* retval, HPHP::Unit* unit); + HPHP::Unit* compileEvalString(StringData* code); CStrRef createFunction(CStrRef args, CStrRef code); void evalPHPDebugger(TypedValue* retval, StringData *code, int frame); void enterDebuggerDummyEnv(); @@ -664,9 +662,9 @@ public: VarEnv* getVarEnv(); void setVar(StringData* name, TypedValue* v, bool ref); Array getLocalDefinedVariables(int frame); - HPHP::VM::InjectionTables* m_injTables; - HPHP::VM::PCFilter* m_breakPointFilter; - HPHP::VM::PCFilter* m_lastLocFilter; + HPHP::InjectionTables* m_injTables; + HPHP::PCFilter* m_breakPointFilter; + HPHP::PCFilter* m_lastLocFilter; bool m_interpreting; bool m_dbgNoBreak; int switchMode(bool unwindBuiltin); @@ -681,14 +679,14 @@ private: void doFPushCuf(PC& pc, bool forward, bool safe); void unwindBuiltinFrame(); template - void pushClsMethodImpl(VM::Class* cls, StringData* name, + void pushClsMethodImpl(Class* cls, StringData* name, ObjectData* obj, int numArgs); bool prepareFuncEntry(ActRec* ar, PC& pc); bool prepareArrayArgs(ActRec* ar, ArrayData* args); void recordCodeCoverage(PC pc); bool isReturnHelper(uintptr_t address); int m_coverPrevLine; - HPHP::VM::Unit* m_coverPrevUnit; + HPHP::Unit* m_coverPrevUnit; Array m_evaledArgs; public: void resetCoverageCounters(); @@ -700,10 +698,10 @@ public: InvokePseudoMain = 2 }; void invokeFunc(TypedValue* retval, - const HPHP::VM::Func* f, + const HPHP::Func* f, CArrRef params, ObjectData* this_ = nullptr, - HPHP::VM::Class* class_ = nullptr, + HPHP::Class* class_ = nullptr, VarEnv* varEnv = nullptr, StringData* invName = nullptr, InvokeFlags flags = InvokeNormal); @@ -715,12 +713,12 @@ public: ctx.invName, InvokeIgnoreByRefErrors); } void invokeFuncFew(TypedValue* retval, - const HPHP::VM::Func* f, + const HPHP::Func* f, void* thisOrCls, StringData* invName, int argc, TypedValue* argv); void invokeFuncFew(TypedValue* retval, - const HPHP::VM::Func* f, + const HPHP::Func* f, void* thisOrCls, StringData* invName = nullptr) { invokeFuncFew(retval, f, thisOrCls, invName, 0, nullptr); @@ -733,7 +731,7 @@ public: ctx.cls ? (char*)ctx.cls + 1 : nullptr, ctx.invName, argc, argv); } - void invokeContFunc(const HPHP::VM::Func* f, + void invokeContFunc(const HPHP::Func* f, ObjectData* this_, TypedValue* param = nullptr); // VM ClassInfo support @@ -773,7 +771,7 @@ OPCODES void dispatchBB(); private: - VM::PreConstVec m_preConsts; + PreConstVec m_preConsts; static Mutex s_threadIdxLock; static hphp_hash_map s_threadIdxMap; diff --git a/hphp/runtime/base/externals.h b/hphp/runtime/base/externals.h index 8781d0ec1..ad9cc240d 100644 --- a/hphp/runtime/base/externals.h +++ b/hphp/runtime/base/externals.h @@ -56,7 +56,7 @@ extern const char *g_class_map[]; /** * Returns a thread local global variable class pointer. */ -typedef VM::GlobalNameValueTableWrapper GlobalVariables; +typedef GlobalNameValueTableWrapper GlobalVariables; extern GlobalVariables *get_global_variables(); extern void init_global_variables(); extern void free_global_variables(); @@ -65,7 +65,7 @@ extern Array get_global_state(); /** * Returns a thread local global variable table pointer. */ -typedef VM::GlobalNameValueTableWrapper SystemGlobals; +typedef GlobalNameValueTableWrapper SystemGlobals; extern SystemGlobals *get_system_globals(); /** diff --git a/hphp/runtime/base/file/user_file.cpp b/hphp/runtime/base/file/user_file.cpp index 2888bdf42..48e3b547d 100644 --- a/hphp/runtime/base/file/user_file.cpp +++ b/hphp/runtime/base/file/user_file.cpp @@ -38,18 +38,18 @@ StaticString s_call("__call"); /////////////////////////////////////////////////////////////////////////////// -UserFile::UserFile(VM::Class *cls, int options /*= 0 */, +UserFile::UserFile(Class *cls, int options /*= 0 */, CVarRef context /*= null */) : m_cls(cls), m_options(options) { - VM::Transl::VMRegAnchor _; - const VM::Func *ctor; + Transl::VMRegAnchor _; + const Func *ctor; if (MethodLookup::MethodFoundWithThis != g_vmContext->lookupCtorMethod(ctor, cls)) { throw InvalidArgumentException(0, "Unable to call %s's constructor", cls->name()->data()); } - m_obj = VM::Instance::newInstance(cls); + m_obj = Instance::newInstance(cls); m_obj.o_set("context", context); Variant ret; g_vmContext->invokeFuncFew(ret.asTypedValue(), ctor, m_obj.get()); @@ -70,8 +70,8 @@ UserFile::UserFile(VM::Class *cls, int options /*= 0 */, UserFile::~UserFile() { } -const VM::Func* UserFile::lookupMethod(const StringData* name) { - const VM::Func *f = m_cls->lookupMethod(name); +const Func* UserFile::lookupMethod(const StringData* name) { + const Func *f = m_cls->lookupMethod(name); if (!f) return nullptr; if (f->attrs() & AttrStatic) { @@ -83,9 +83,9 @@ const VM::Func* UserFile::lookupMethod(const StringData* name) { /////////////////////////////////////////////////////////////////////////////// -Variant UserFile::invoke(const VM::Func *func, CStrRef name, +Variant UserFile::invoke(const Func *func, CStrRef name, CArrRef args, bool &success) { - VM::Transl::VMRegAnchor _; + Transl::VMRegAnchor _; // Assume failure success = false; diff --git a/hphp/runtime/base/file/user_file.h b/hphp/runtime/base/file/user_file.h index 120dda150..27d6a91f9 100644 --- a/hphp/runtime/base/file/user_file.h +++ b/hphp/runtime/base/file/user_file.h @@ -26,7 +26,7 @@ class UserFile : public File { public: DECLARE_OBJECT_ALLOCATION(UserFile); - UserFile(VM::Class *cls, int options = 0, CVarRef context = uninit_null()); + UserFile(Class *cls, int options = 0, CVarRef context = uninit_null()); virtual ~UserFile(); static StaticString s_class_name; @@ -57,29 +57,29 @@ public: virtual bool lock(int operation, bool &wouldBlock); protected: - VM::Class *m_cls; + Class *m_cls; int m_options; Object m_obj; - Variant invoke(const VM::Func *func, CStrRef name, CArrRef args, bool &success); - Variant invoke(const VM::Func *func, CStrRef name, CArrRef args) { + Variant invoke(const Func *func, CStrRef name, CArrRef args, bool &success); + Variant invoke(const Func *func, CStrRef name, CArrRef args) { bool success; return invoke(func, name, args, success); } - const VM::Func* lookupMethod(const StringData* name); + const Func* lookupMethod(const StringData* name); - const VM::Func* m_StreamOpen; - const VM::Func* m_StreamClose; - const VM::Func* m_StreamRead; - const VM::Func* m_StreamWrite; - const VM::Func* m_StreamSeek; - const VM::Func* m_StreamTell; - const VM::Func* m_StreamEof; - const VM::Func* m_StreamFlush; - const VM::Func* m_StreamLock; + const Func* m_StreamOpen; + const Func* m_StreamClose; + const Func* m_StreamRead; + const Func* m_StreamWrite; + const Func* m_StreamSeek; + const Func* m_StreamTell; + const Func* m_StreamEof; + const Func* m_StreamFlush; + const Func* m_StreamLock; - const VM::Func* m_Call; + const Func* m_Call; }; /////////////////////////////////////////////////////////////////////////////// diff --git a/hphp/runtime/base/file/user_stream_wrapper.cpp b/hphp/runtime/base/file/user_stream_wrapper.cpp index 31c5d4754..762d3f6c9 100644 --- a/hphp/runtime/base/file/user_stream_wrapper.cpp +++ b/hphp/runtime/base/file/user_stream_wrapper.cpp @@ -22,7 +22,7 @@ namespace HPHP { UserStreamWrapper::UserStreamWrapper(CStrRef name, CStrRef clsname) : m_name(name) { - m_cls = VM::Unit::loadClass(clsname.get()); + m_cls = Unit::loadClass(clsname.get()); if (!m_cls) { throw InvalidArgumentException(0, "Undefined class '%s'", clsname.data()); } diff --git a/hphp/runtime/base/file/user_stream_wrapper.h b/hphp/runtime/base/file/user_stream_wrapper.h index 2eabbbc55..a82d22ee6 100644 --- a/hphp/runtime/base/file/user_stream_wrapper.h +++ b/hphp/runtime/base/file/user_stream_wrapper.h @@ -30,7 +30,7 @@ class UserStreamWrapper : public Stream::Wrapper { int options, CVarRef context); private: String m_name; - VM::Class *m_cls; + Class *m_cls; }; /////////////////////////////////////////////////////////////////////////////// diff --git a/hphp/runtime/base/hphp_value.h b/hphp/runtime/base/hphp_value.h index 348657fa6..d3e9dc930 100644 --- a/hphp/runtime/base/hphp_value.h +++ b/hphp/runtime/base/hphp_value.h @@ -27,9 +27,7 @@ namespace HPHP { /////////////////////////////////////////////////////////////////////////////// -namespace VM { class Class; -} struct TypedValue; @@ -44,7 +42,7 @@ union Value { StringData *pstr; // KindOfString, KindOfStaticString ArrayData *parr; // KindOfArray ObjectData *pobj; // KindOfObject - VM::Class *pcls; // only in vm stack, no type tag. + Class *pcls; // only in vm stack, no type tag. RefData *pref; // KindOfRef TypedValue *pind; // only for KindOfIndirect }; diff --git a/hphp/runtime/base/intercept.cpp b/hphp/runtime/base/intercept.cpp index 8ba5e3f8b..455ff9018 100644 --- a/hphp/runtime/base/intercept.cpp +++ b/hphp/runtime/base/intercept.cpp @@ -97,7 +97,7 @@ bool register_intercept(CStrRef name, CVarRef callback, CVarRef data) { return true; } - VM::EventHook::EnableIntercept(); + EventHook::EnableIntercept(); Array handler = CREATE_VECTOR2(callback, data); @@ -195,7 +195,7 @@ void rename_function(CStrRef old_name, CStrRef new_name) { } String get_renamed_function(CStrRef name) { - HPHP::VM::Func* f = HPHP::VM::Unit::lookupFunc(name.get()); + HPHP::Func* f = HPHP::Unit::lookupFunc(name.get()); if (f) { return f->nameRef(); } diff --git a/hphp/runtime/base/macros.h b/hphp/runtime/base/macros.h index cd6655439..536eff1b8 100644 --- a/hphp/runtime/base/macros.h +++ b/hphp/runtime/base/macros.h @@ -85,21 +85,21 @@ namespace HPHP { public: \ static const char *GetClassName() { return #originalName; } \ static StaticString s_class_name; \ - static HPHP::VM::Class* s_cls; \ + static HPHP::Class* s_cls; \ #define DECLARE_CLASS_COMMON_NO_ALLOCATION(cls, originalName) \ public: \ static void *ObjAllocatorInitSetup; \ static const char *GetClassName() { return #originalName; } \ static StaticString s_class_name; \ - static HPHP::VM::Class* s_cls; \ + static HPHP::Class* s_cls; \ #define DECLARE_CLASS_COMMON(cls, originalName) \ DECLARE_OBJECT_ALLOCATION(c_##cls) \ public: \ static const char *GetClassName() { return #originalName; } \ static StaticString s_class_name; \ - static HPHP::VM::Class* s_cls; \ + static HPHP::Class* s_cls; \ #define DECLARE_CLASS_NO_SWEEP(cls, originalName, parent) \ DECLARE_CLASS_COMMON_NO_SWEEP(cls, originalName) \ @@ -119,7 +119,7 @@ namespace HPHP { #define IMPLEMENT_CLASS_COMMON(cls) \ StaticString c_##cls::s_class_name(c_##cls::GetClassName()); \ - HPHP::VM::Class* c_##cls::s_cls = nullptr; \ + HPHP::Class* c_##cls::s_cls = nullptr; \ #define IMPLEMENT_CLASS(cls) \ IMPLEMENT_CLASS_COMMON(cls) \ diff --git a/hphp/runtime/base/memory/smart_allocator.h b/hphp/runtime/base/memory/smart_allocator.h index c27500770..6596329ae 100644 --- a/hphp/runtime/base/memory/smart_allocator.h +++ b/hphp/runtime/base/memory/smart_allocator.h @@ -257,8 +257,8 @@ void *SmartAllocatorInitSetup() { RELEASEOBJ(NS, T, p); \ return; \ } \ - HPHP::VM::Instance* this_ = (HPHP::VM::Instance*)p; \ - HPHP::VM::Class* cls = this_->getVMClass(); \ + HPHP::Instance* this_ = (HPHP::Instance*)p; \ + HPHP::Class* cls = this_->getVMClass(); \ size_t nProps = cls->numDeclProperties(); \ size_t builtinPropSize = cls->builtinPropSize(); \ TypedValue* propVec = \ @@ -268,7 +268,7 @@ void *SmartAllocatorInitSetup() { TypedValue* prop = &propVec[i]; \ tvRefcountedDecRef(prop); \ } \ - DELETEOBJSZ(HPHP::VM::Instance::sizeForNProps(nProps) + \ + DELETEOBJSZ(HPHP::Instance::sizeForNProps(nProps) + \ builtinPropSize)(this_); \ } diff --git a/hphp/runtime/base/object_data.cpp b/hphp/runtime/base/object_data.cpp index 16422dc34..47897831a 100644 --- a/hphp/runtime/base/object_data.cpp +++ b/hphp/runtime/base/object_data.cpp @@ -54,12 +54,12 @@ ObjectData::~ObjectData() { } } -HPHP::VM::Class* -ObjectData::instanceof(const HPHP::VM::PreClass* pc) const { +HPHP::Class* +ObjectData::instanceof(const HPHP::PreClass* pc) const { return m_cls->classof(pc); } -bool ObjectData::instanceof(const HPHP::VM::Class* c) const { +bool ObjectData::instanceof(const HPHP::Class* c) const { return m_cls->classof(c); } @@ -117,7 +117,7 @@ CStrRef ObjectData::o_getClassNameHook() const { HOT_FUNC bool ObjectData::o_instanceof(CStrRef s) const { - HPHP::VM::Class* cls = VM::Unit::lookupClass(s.get()); + HPHP::Class* cls = Unit::lookupClass(s.get()); if (!cls) return false; return m_cls->classof(cls); } @@ -185,7 +185,7 @@ MutableArrayIter ObjectData::begin(Variant *key, Variant &val, } void ObjectData::initProperties(int nProp) { - if (!o_properties.get()) ((HPHP::VM::Instance*)this)->initDynProps(nProp); + if (!o_properties.get()) ((HPHP::Instance*)this)->initDynProps(nProp); } Variant* ObjectData::o_realProp(CStrRef propName, int flags, @@ -196,12 +196,12 @@ Variant* ObjectData::o_realProp(CStrRef propName, int flags, * behavior in cases where the named property is nonexistent or * inaccessible. */ - HPHP::VM::Class* ctx = nullptr; + HPHP::Class* ctx = nullptr; if (!context.empty()) { - ctx = VM::Unit::lookupClass(context.get()); + ctx = Unit::lookupClass(context.get()); } - HPHP::VM::Instance* thiz = (HPHP::VM::Instance*)(this); // sigh + HPHP::Instance* thiz = (HPHP::Instance*)(this); // sigh bool visible, accessible, unset; TypedValue* ret = (flags & RealPropNoDynamic) ? thiz->getDeclProp(ctx, propName.get(), visible, @@ -316,10 +316,10 @@ Variant ObjectData::o_setRef(CStrRef propName, CVarRef v, CStrRef context) { HOT_FUNC void ObjectData::o_setArray(CArrRef properties) { - auto thiz = static_cast(this); + auto thiz = static_cast(this); for (ArrayIter iter(properties); iter; ++iter) { String k = iter.first().toString(); - VM::Class* ctx = nullptr; + Class* ctx = nullptr; // If the key begins with a NUL, it's a private or protected property. Read // the class name from between the two NUL bytes. if (!k.empty() && k.charAt(0) == '\0') { @@ -330,7 +330,7 @@ void ObjectData::o_setArray(CArrRef properties) { ctx = m_cls; } else { // Private. - ctx = VM::Unit::lookupClass(cls.get()); + ctx = Unit::lookupClass(cls.get()); if (!ctx) continue; } k = k.substr(subLen); @@ -354,13 +354,13 @@ void ObjectData::o_getArray(Array &props, bool pubOnly /* = false */) const { std::vector inserted(m_cls->numDeclProperties(), false); // Iterate over declared properties and insert {mangled name --> prop} pairs. - const VM::Class* cls = m_cls; - auto thiz = static_cast(this); + const Class* cls = m_cls; + auto thiz = static_cast(this); do { thiz->getProps(cls, pubOnly, cls->m_preClass.get(), props, inserted); - const std::vector &usedTraits = cls->m_usedTraits; + const std::vector &usedTraits = cls->m_usedTraits; for (unsigned t = 0; t < usedTraits.size(); t++) { - const VM::ClassPtr& trait = usedTraits[t]; + const ClassPtr& trait = usedTraits[t]; thiz->getProps(cls, pubOnly, trait->m_preClass.get(), props, inserted); } cls = cls->m_parent.get(); @@ -395,22 +395,22 @@ Array ObjectData::o_toIterArray(CStrRef context, size_t size = m_cls->m_declPropNumAccessible + (o_properties.get() ? o_properties.get()->size() : 0); HphpArray* retval = NEW(HphpArray)(size); - VM::Class* ctx = nullptr; + Class* ctx = nullptr; if (!context.empty()) { - ctx = VM::Unit::lookupClass(context.get()); + ctx = Unit::lookupClass(context.get()); } // Get all declared properties first, bottom-to-top in the inheritance // hierarchy, in declaration order. - const VM::Class* klass = m_cls; + const Class* klass = m_cls; while (klass) { - const VM::PreClass::Prop* props = klass->m_preClass->properties(); + const PreClass::Prop* props = klass->m_preClass->properties(); const size_t numProps = klass->m_preClass->numProperties(); for (size_t i = 0; i < numProps; ++i) { auto key = const_cast(props[i].name()); bool visible, accessible, unset; - TypedValue* val = ((VM::Instance*)this)->getProp( + TypedValue* val = ((Instance*)this)->getProp( ctx, key, visible, accessible, unset); if (accessible && val->m_type != KindOfUninit && !unset) { if (getRef) { @@ -616,7 +616,7 @@ void ObjectData::serializeImpl(VariableSerializer *serializer) const { if (UNLIKELY(handleSleep)) { assert(!isCollection()); if (ret.isArray()) { - auto thiz = (VM::Instance*)(this); + auto thiz = (Instance*)(this); Array wanted = Array::Create(); Array props = ret.toArray(); for (ArrayIter iter(props); iter; ++iter) { @@ -692,7 +692,7 @@ void ObjectData::dump() const { } ObjectData *ObjectData::clone() { - HPHP::VM::Instance* instance = static_cast(this); + HPHP::Instance* instance = static_cast(this); return instance->cloneImpl(); } @@ -722,7 +722,7 @@ Variant ObjectData::t___get(Variant v_name) { Variant ObjectData::offsetGet(Variant key) { assert(instanceof(SystemLib::s_ArrayAccessClass)); - const VM::Func* method = m_cls->lookupMethod(s_offsetGet.get()); + const Func* method = m_cls->lookupMethod(s_offsetGet.get()); assert(method); if (!method) { return uninit_null(); diff --git a/hphp/runtime/base/object_data.h b/hphp/runtime/base/object_data.h index fc48a779a..ac7a70f50 100644 --- a/hphp/runtime/base/object_data.h +++ b/hphp/runtime/base/object_data.h @@ -35,10 +35,8 @@ class MutableArrayIter; class HphpArray; class TypedValue; -namespace VM { - class PreClass; - class Class; -} +class PreClass; +class Class; extern StaticString ssIterator; @@ -79,7 +77,7 @@ class ObjectData : public CountableNF { RealPropExist = 16, // For property_exists }; - ObjectData(bool noId, VM::Class* type) + ObjectData(bool noId, Class* type) : o_attribute(0), m_cls(type) { assert(uintptr_t(this) % sizeof(TypedValue) == 0); if (!noId) { @@ -91,7 +89,7 @@ class ObjectData : public CountableNF { virtual ~ObjectData(); // all PHP classes need virtual tables - VM::Class* getVMClass() const { + Class* getVMClass() const { return m_cls; } static size_t getVMClassOffset() { @@ -99,8 +97,8 @@ class ObjectData : public CountableNF { return offsetof(ObjectData, m_cls); } static size_t attributeOff() { return offsetof(ObjectData, o_attribute); } - VM::Class* instanceof(const VM::PreClass* pc) const; - bool instanceof(const VM::Class* c) const; + Class* instanceof(const PreClass* pc) const; + bool instanceof(const Class* c) const; bool isCollection() const { return getCollectionType() != Collection::InvalidType; @@ -234,7 +232,7 @@ class ObjectData : public CountableNF { } o_subclassData; protected: - VM::Class* m_cls; + Class* m_cls; protected: ArrNR o_properties; // dynamic properties (VM and hphpc) @@ -260,7 +258,7 @@ class ObjectData : public CountableNF { template<> inline SmartPtr::~SmartPtr() {} -typedef VM::GlobalNameValueTableWrapper GlobalVariables; +typedef GlobalNameValueTableWrapper GlobalVariables; /////////////////////////////////////////////////////////////////////////////// // Calculate item sizes for object allocators diff --git a/hphp/runtime/base/program_functions.cpp b/hphp/runtime/base/program_functions.cpp index d755fac2d..6c7f08c68 100644 --- a/hphp/runtime/base/program_functions.cpp +++ b/hphp/runtime/base/program_functions.cpp @@ -77,7 +77,7 @@ namespace HPHP { extern InitFiniNode *extra_process_init, *extra_process_exit; -namespace VM { void initialize_repo(); } + void initialize_repo(); /* * XXX: VM process initialization is handled through a function @@ -495,7 +495,7 @@ void execute_command_line_end(int xhprof, bool coverage, const char *program) { ThreadInfo *ti = ThreadInfo::s_threadInfo.getNoCheck(); if (RuntimeOption::EvalJit && RuntimeOption::EvalDumpTC) { - HPHP::VM::Transl::tc_dump(); + HPHP::Transl::tc_dump(); } if (xhprof) { @@ -670,7 +670,7 @@ static int execute_program_impl(int argc, char **argv); int execute_program(int argc, char **argv) { int ret_code = -1; try { - VM::initialize_repo(); + initialize_repo(); init_thread_locals(); ret_code = execute_program_impl(argc, argv); } catch (const Exception &e) { @@ -963,7 +963,7 @@ static int execute_program_impl(int argc, char **argv) { if (phpFile == nullptr) { throw FileOpenException(po.lint.c_str()); } - VM::Unit* unit = phpFile->unit(); + Unit* unit = phpFile->unit(); const StringData* msg; int line; if (unit->compileTimeFatal(msg, line)) { @@ -1004,9 +1004,9 @@ static int execute_program_impl(int argc, char **argv) { prepare_args(new_argc, new_argv, po.args, po.file.c_str()); if (!po.file.empty()) { - VM::Repo::setCliFile(po.file); + Repo::setCliFile(po.file); } else if (new_argc >= 2) { - VM::Repo::setCliFile(new_argv[1]); + Repo::setCliFile(new_argv[1]); } int ret = 0; @@ -1177,7 +1177,7 @@ void hphp_process_init() { apc_load(RuntimeOption::ApcLoadThread); RuntimeOption::SerializationSizeLimit = save; - VM::Transl::TargetCache::requestExit(); + Transl::TargetCache::requestExit(); // Reset the preloaded g_context ExecutionContext *context = g_context.getNoCheck(); context->~ExecutionContext(); diff --git a/hphp/runtime/base/resource_data.cpp b/hphp/runtime/base/resource_data.cpp index d51bf7dea..eb1d2f653 100644 --- a/hphp/runtime/base/resource_data.cpp +++ b/hphp/runtime/base/resource_data.cpp @@ -31,7 +31,7 @@ int ResourceData::GetMaxResourceId() { } ResourceData::ResourceData() - : VM::Instance(SystemLib::s_resourceClass, true) { + : Instance(SystemLib::s_resourceClass, true) { assert(!m_cls->callsCustomInstanceInit()); int &pmax = *os_max_resource_id; if (pmax < 3) pmax = 3; // reserving 1, 2, 3 for STDIN, STDOUT, STDERR diff --git a/hphp/runtime/base/resource_data.h b/hphp/runtime/base/resource_data.h index e95b0bff0..681b05d45 100644 --- a/hphp/runtime/base/resource_data.h +++ b/hphp/runtime/base/resource_data.h @@ -28,7 +28,7 @@ namespace HPHP { * Base class of all resources used by extensions for opaquely passing object * pointers. */ -class ResourceData : public VM::Instance { +class ResourceData : public Instance { public: ResourceData(); virtual ~ResourceData(); diff --git a/hphp/runtime/base/server/admin_request_handler.cpp b/hphp/runtime/base/server/admin_request_handler.cpp index 4bc83b4e0..fd85ec097 100644 --- a/hphp/runtime/base/server/admin_request_handler.cpp +++ b/hphp/runtime/base/server/admin_request_handler.cpp @@ -555,9 +555,7 @@ static bool send_status(Transport *transport, ServerStats::Format format, return true; } -namespace VM { extern size_t hhbc_arena_capacity(); -} bool AdminRequestHandler::handleCheckRequest(const std::string &cmd, Transport *transport) { @@ -588,8 +586,8 @@ bool AdminRequestHandler::handleCheckRequest(const std::string &cmd, ServerPtr server = HttpServer::Server->getPageServer(); appendStat("load", server->getActiveWorker()); appendStat("queued", server->getQueuedJobs()); - VM::Transl::Translator* tx = VM::Transl::Translator::Get(); - appendStat("hhbc-roarena-capac", VM::hhbc_arena_capacity()); + Transl::Translator* tx = Transl::Translator::Get(); + appendStat("hhbc-roarena-capac", hhbc_arena_capacity()); appendStat("tc-size", tx->getCodeSize()); appendStat("tc-stubsize", tx->getStubSize()); appendStat("targetcache", tx->getTargetCacheSize()); @@ -961,12 +959,12 @@ typedef std::map InfoMap; bool AdminRequestHandler::handleVMRequest(const std::string &cmd, Transport *transport) { if (cmd == "vm-tcspace") { - transport->sendString(VM::Transl::Translator::Get()->getUsage()); + transport->sendString(Transl::Translator::Get()->getUsage()); return true; } if (cmd == "vm-preconsts") { InfoMap counts; - using namespace HPHP::VM::Transl; + using namespace HPHP::Transl; for (PreConstDepMap::iterator i = gPreConsts.begin(); i != gPreConsts.end(); ++i) { PreConstDep& dep = i->second; @@ -993,7 +991,7 @@ bool AdminRequestHandler::handleVMRequest(const std::string &cmd, return true; } if (cmd == "vm-dump-tc") { - if (HPHP::VM::Transl::tc_dump()) { + if (HPHP::Transl::tc_dump()) { transport->sendString("Done"); } else { transport->sendString("Error dumping the translation cache"); @@ -1002,7 +1000,7 @@ bool AdminRequestHandler::handleVMRequest(const std::string &cmd, } if (cmd == "vm-tcreset") { int64_t start = Timer::GetCurrentTimeMicros(); - if (HPHP::VM::Transl::tx64->replace()) { + if (HPHP::Transl::tx64->replace()) { string msg; Util::string_printf(msg, "Done %ld ms", (Timer::GetCurrentTimeMicros() - start) / 1000); diff --git a/hphp/runtime/base/stat_cache.cpp b/hphp/runtime/base/stat_cache.cpp index abd95e167..46b5b9eb7 100644 --- a/hphp/runtime/base/stat_cache.cpp +++ b/hphp/runtime/base/stat_cache.cpp @@ -184,7 +184,7 @@ void StatCache::Node::touchLocked(bool invalidate /* = true */) { ++it) { if (invalidate && m_valid) { TRACE(1, "StatCache: invalidate path '%s'\n", it->first.c_str()); - HPHP::VM::invalidatePath(it->first); + HPHP::invalidatePath(it->first); } if (removePaths) { m_statCache.removePath(it->first, this); @@ -197,7 +197,7 @@ void StatCache::Node::touchLocked(bool invalidate /* = true */) { NameMap::const_iterator it2 = m_paths.find(it->first); if (it2 == m_paths.end()) { TRACE(1, "StatCache: invalidate link path '%s'\n", it->first.c_str()); - HPHP::VM::invalidatePath(it->first); + HPHP::invalidatePath(it->first); } } if (removePaths) { diff --git a/hphp/runtime/base/stats.cpp b/hphp/runtime/base/stats.cpp index 8e55d1634..2666de4b8 100644 --- a/hphp/runtime/base/stats.cpp +++ b/hphp/runtime/base/stats.cpp @@ -21,7 +21,7 @@ namespace HPHP { namespace Stats { -using namespace HPHP::VM::Transl; +using namespace HPHP::Transl; TRACE_SET_MOD(stats); diff --git a/hphp/runtime/base/stats.h b/hphp/runtime/base/stats.h index 464363b92..331e1f90f 100644 --- a/hphp/runtime/base/stats.h +++ b/hphp/runtime/base/stats.h @@ -22,7 +22,7 @@ namespace HPHP { -namespace VM { namespace Transl { class X64Assembler; } } + namespace Transl { class X64Assembler; } namespace Stats { #include "runtime/vm/stats-opcodeDef.h" @@ -214,7 +214,7 @@ static inline void inc(StatCounter stat, int n = 1) { } static inline StatCounter opcodeToStatCounter(Opcode opc) { - assert(VM::OpLowInvalid == 0); + assert(OpLowInvalid == 0); return StatCounter(Instr_InterpBBLowInvalid + STATS_PER_OPCODE * opc); } @@ -223,34 +223,34 @@ static inline void incOp(Opcode opc) { } static inline StatCounter opcodeToTranslStatCounter(Opcode opc) { - assert(VM::OpLowInvalid == 0); + assert(OpLowInvalid == 0); return StatCounter(Instr_TranslLowInvalid + STATS_PER_OPCODE * opc); } static inline StatCounter opcodeToIRPreStatCounter(Opcode opc) { - assert(VM::OpLowInvalid == 0); + assert(OpLowInvalid == 0); return StatCounter(Instr_TranslIRPreLowInvalid + STATS_PER_OPCODE * opc); } static inline StatCounter opcodeToIRPostStatCounter(Opcode opc) { - assert(VM::OpLowInvalid == 0); + assert(OpLowInvalid == 0); return StatCounter(Instr_TranslIRPostLowInvalid + STATS_PER_OPCODE * opc); } // Both emitIncs use r10. -extern void emitInc(VM::Transl::X64Assembler& a, +extern void emitInc(Transl::X64Assembler& a, uint64_t* tl_table, uint index, int n = 1, - VM::Transl::ConditionCode cc = VM::Transl::CC_None, + Transl::ConditionCode cc = Transl::CC_None, bool force = false); -inline void emitInc(VM::Transl::X64Assembler& a, StatCounter stat, int n = 1, - VM::Transl::ConditionCode cc = VM::Transl::CC_None, +inline void emitInc(Transl::X64Assembler& a, StatCounter stat, int n = 1, + Transl::ConditionCode cc = Transl::CC_None, bool force = false) { emitInc(a, &tl_counters[0], stat, n, cc, force); } -extern void emitIncTranslOp(VM::Transl::X64Assembler& a, Opcode opc, +extern void emitIncTranslOp(Transl::X64Assembler& a, Opcode opc, bool force = false); extern void init(); extern void dump(); diff --git a/hphp/runtime/base/string_data.cpp b/hphp/runtime/base/string_data.cpp index c48f94e46..3413bd3ea 100644 --- a/hphp/runtime/base/string_data.cpp +++ b/hphp/runtime/base/string_data.cpp @@ -136,7 +136,7 @@ uint32_t StringData::DefCnsHandle(const StringData* cnsName, bool persistent) { StringDataMap::iterator it = s_stringDataMap->find(cnsName); assert(it != s_stringDataMap->end()); if (!it->second) { - VM::Transl::TargetCache::allocConstant(&it->second, persistent); + Transl::TargetCache::allocConstant(&it->second, persistent); } return it->second; } @@ -144,13 +144,13 @@ uint32_t StringData::DefCnsHandle(const StringData* cnsName, bool persistent) { Array StringData::GetConstants() { // Return an array of all defined constants. assert(s_stringDataMap); - Array a(VM::Transl::TargetCache::s_constants); + Array a(Transl::TargetCache::s_constants); for (StringDataMap::const_iterator it = s_stringDataMap->begin(); it != s_stringDataMap->end(); ++it) { if (it->second) { TypedValue& tv = - VM::Transl::TargetCache::handleToRef(it->second); + Transl::TargetCache::handleToRef(it->second); if (tv.m_type != KindOfUninit) { StrNR key(const_cast(it->first)); a.set(key, tvAsVariant(&tv), true); diff --git a/hphp/runtime/base/thread_info.cpp b/hphp/runtime/base/thread_info.cpp index 8291ca135..2b0ac6aaa 100644 --- a/hphp/runtime/base/thread_info.cpp +++ b/hphp/runtime/base/thread_info.cpp @@ -53,7 +53,7 @@ ThreadInfo::ThreadInfo() m_pendingException = nullptr; m_coverage = new CodeCoverage(); - VM::Transl::TargetCache::threadInit(); + Transl::TargetCache::threadInit(); onSessionInit(); Lock lock(s_thread_info_mutex); @@ -66,7 +66,7 @@ ThreadInfo::~ThreadInfo() { Lock lock(s_thread_info_mutex); s_thread_infos.erase(this); delete m_coverage; - VM::Transl::TargetCache::threadExit(); + Transl::TargetCache::threadExit(); } bool ThreadInfo::valid(ThreadInfo* info) { @@ -116,12 +116,12 @@ void ThreadInfo::setPendingException(Exception* e) { void ThreadInfo::onSessionExit() { m_reqInjectionData.reset(); - VM::Transl::TargetCache::requestExit(); + Transl::TargetCache::requestExit(); } void RequestInjectionData::onSessionInit() { - VM::Transl::TargetCache::requestInit(); - cflagsPtr = VM::Transl::TargetCache::conditionFlagsPtr(); + Transl::TargetCache::requestInit(); + cflagsPtr = Transl::TargetCache::conditionFlagsPtr(); reset(); started = time(0); } @@ -140,7 +140,7 @@ void RequestInjectionData::updateJit() { !(RuntimeOption::EvalJitDisabledByHphpd && m_debugger) && !m_debuggerIntr && !m_coverage && - !VM::shouldProfile(); + !shouldProfile(); } void RequestInjectionData::setMemExceededFlag() { diff --git a/hphp/runtime/base/type_object.h b/hphp/runtime/base/type_object.h index c9c4df70a..640a8ccbe 100644 --- a/hphp/runtime/base/type_object.h +++ b/hphp/runtime/base/type_object.h @@ -91,7 +91,7 @@ public: bool instanceof(CStrRef s) const { return m_px && m_px->o_instanceof(s); } - bool instanceof(const VM::Class* cls) const { + bool instanceof(const Class* cls) const { return m_px && m_px->instanceof(cls); } diff --git a/hphp/runtime/base/type_variant.cpp b/hphp/runtime/base/type_variant.cpp index bebb5e11d..086506614 100644 --- a/hphp/runtime/base/type_variant.cpp +++ b/hphp/runtime/base/type_variant.cpp @@ -446,7 +446,7 @@ bool Variant::instanceof(CStrRef s) const { } HOT_FUNC -bool Variant::instanceof(VM::Class* cls) const { +bool Variant::instanceof(Class* cls) const { if (m_type == KindOfObject) { assert(m_data.pobj); return m_data.pobj->instanceof(cls); @@ -3035,7 +3035,7 @@ void Variant::unserialize(VariableUnserializer *uns, throw Exception("Expected '{' but got '%c'", sep); } - VM::Class* cls = VM::Unit::loadClass(clsName.get()); + Class* cls = Unit::loadClass(clsName.get()); Object obj; if (RuntimeOption::UnserializationWhitelistCheck && !uns->isWhitelistedClass(clsName)) { @@ -3050,12 +3050,12 @@ void Variant::unserialize(VariableUnserializer *uns, } } if (cls) { - obj = VM::Instance::newInstance(cls); + obj = Instance::newInstance(cls); if (UNLIKELY(cls == c_Pair::s_cls && size != 2)) { throw Exception("Pair objects must have exactly 2 elements"); } } else { - obj = VM::Instance::newInstance( + obj = Instance::newInstance( SystemLib::s___PHP_Incomplete_ClassClass); obj->o_set(s_PHP_Incomplete_Class_Name, clsName); } diff --git a/hphp/runtime/base/type_variant.h b/hphp/runtime/base/type_variant.h index 451135bd4..ea1d97d7f 100644 --- a/hphp/runtime/base/type_variant.h +++ b/hphp/runtime/base/type_variant.h @@ -487,7 +487,7 @@ class Variant : private TypedValue { } bool isResource() const; bool instanceof(CStrRef s) const; - bool instanceof(VM::Class* cls) const; + bool instanceof(Class* cls) const; /** * Whether or not there are at least two variables that are strongly bound. diff --git a/hphp/runtime/base/types.h b/hphp/runtime/base/types.h index 9d44a6262..d20926f2a 100644 --- a/hphp/runtime/base/types.h +++ b/hphp/runtime/base/types.h @@ -375,9 +375,7 @@ inline RefResult ref(Variant& v) { return *(RefResultValue*)&v; } -namespace VM { class Class; -} /////////////////////////////////////////////////////////////////////////////// // code injection classes @@ -460,13 +458,11 @@ public: void onSessionInit(); }; -namespace VM { class GlobalNameValueTableWrapper; -} class ObjectAllocatorBase; class Profiler; class CodeCoverage; -typedef VM::GlobalNameValueTableWrapper GlobalVariables; +typedef GlobalNameValueTableWrapper GlobalVariables; int object_alloc_size_to_index(size_t); size_t object_alloc_index_to_size(int); diff --git a/hphp/runtime/eval/debugger/break_point.cpp b/hphp/runtime/eval/debugger/break_point.cpp index a168fc0b2..5a113208d 100644 --- a/hphp/runtime/eval/debugger/break_point.cpp +++ b/hphp/runtime/eval/debugger/break_point.cpp @@ -80,7 +80,7 @@ InterruptSite::InterruptSite(bool hardBreakPoint, CVarRef e) m_line0(0), m_char0(0), m_line1(0), m_char1(0), m_unit(nullptr), m_valid(false), m_funcEntry(false) { TRACE(2, "InterruptSite::InterruptSite\n"); - VM::Transl::VMRegAnchor _; + Transl::VMRegAnchor _; #define bail_on(c) if (c) { return; } VMExecutionContext* context = g_vmContext; ActRec *fp = context->getFP(); @@ -113,7 +113,7 @@ InterruptSite::InterruptSite(bool hardBreakPoint, CVarRef e) if (g_context->getDebuggerSmallStep()) { // get offset range for the pc only - VM::OffsetRange range; + OffsetRange range; if (m_unit->getOffsetRange(offset, range)) { m_offsetRangeVec.push_back(range); } @@ -835,13 +835,13 @@ bool BreakPointInfo::MatchClass(const char *fcls, const std::string &bcls, } StackStringData sdBClsName(bcls.c_str()); - VM::Class* clsB = VM::Unit::lookupClass(&sdBClsName); + Class* clsB = Unit::lookupClass(&sdBClsName); StackStringData sdFClsName(fcls); - VM::Class* clsF = VM::Unit::lookupClass(&sdFClsName); + Class* clsF = Unit::lookupClass(&sdFClsName); if (!clsB) return false; if (clsB == clsF) return true; StackStringData sdFuncName(func); - VM::Func* f = clsB->lookupMethod(&sdFuncName); + Func* f = clsB->lookupMethod(&sdFuncName); if (!f) return false; return (f->baseCls() == clsF); } diff --git a/hphp/runtime/eval/debugger/break_point.h b/hphp/runtime/eval/debugger/break_point.h index 87442fc76..f4944d9de 100644 --- a/hphp/runtime/eval/debugger/break_point.h +++ b/hphp/runtime/eval/debugger/break_point.h @@ -56,11 +56,11 @@ public: std::string &url() const { return m_url; } std::string desc() const; - const VM::SourceLoc *getSourceLoc() const { return &m_sourceLoc; } - const VM::OffsetRangeVec& getCurOffsetRange() const { + const SourceLoc *getSourceLoc() const { return &m_sourceLoc; } + const OffsetRangeVec& getCurOffsetRange() const { return m_offsetRangeVec; } - const VM::Unit* getUnit() const { return m_unit; } + const Unit* getUnit() const { return m_unit; } bool valid() const { return m_valid; } bool funcEntry() const { return m_funcEntry; } @@ -79,9 +79,9 @@ private: int32_t m_line1; int32_t m_char1; - VM::SourceLoc m_sourceLoc; - VM::OffsetRangeVec m_offsetRangeVec; - VM::Unit* m_unit; + SourceLoc m_sourceLoc; + OffsetRangeVec m_offsetRangeVec; + Unit* m_unit; bool m_valid; bool m_funcEntry; }; diff --git a/hphp/runtime/eval/debugger/cmd/cmd_eval.cpp b/hphp/runtime/eval/debugger/cmd/cmd_eval.cpp index 163046f0d..bac5e4622 100644 --- a/hphp/runtime/eval/debugger/cmd/cmd_eval.cpp +++ b/hphp/runtime/eval/debugger/cmd/cmd_eval.cpp @@ -68,8 +68,8 @@ void CmdEval::setClientOutput(DebuggerClient *client) { } bool CmdEval::onServer(DebuggerProxy *proxy) { - VM::PCFilter* locSave = g_vmContext->m_lastLocFilter; - g_vmContext->m_lastLocFilter = new VM::PCFilter(); + PCFilter* locSave = g_vmContext->m_lastLocFilter; + g_vmContext->m_lastLocFilter = new PCFilter(); g_vmContext->setDebuggerBypassCheck(m_bypassAccessCheck); DebuggerProxy::ExecutePHP(m_body, m_output, !proxy->isLocal(), m_frame); g_vmContext->setDebuggerBypassCheck(false); diff --git a/hphp/runtime/eval/debugger/cmd/cmd_flow_control.cpp b/hphp/runtime/eval/debugger/cmd/cmd_flow_control.cpp index dff62dec9..a2476dbbe 100644 --- a/hphp/runtime/eval/debugger/cmd/cmd_flow_control.cpp +++ b/hphp/runtime/eval/debugger/cmd/cmd_flow_control.cpp @@ -85,7 +85,7 @@ void CmdFlowControl::installLocationFilterForLine(InterruptSite *site) { if (g_vmContext->m_lastLocFilter) { g_vmContext->m_lastLocFilter->clear(); } else { - g_vmContext->m_lastLocFilter = new VM::PCFilter(); + g_vmContext->m_lastLocFilter = new PCFilter(); } auto offsets = site->getCurOffsetRange(); if (Trace::moduleEnabled(Trace::debugger, 5)) { diff --git a/hphp/runtime/eval/debugger/cmd/cmd_flow_control.h b/hphp/runtime/eval/debugger/cmd/cmd_flow_control.h index 7bcd3ba01..0c4458e15 100644 --- a/hphp/runtime/eval/debugger/cmd/cmd_flow_control.h +++ b/hphp/runtime/eval/debugger/cmd/cmd_flow_control.h @@ -82,7 +82,7 @@ protected: int m_vmDepth; std::string m_loc; // last break's source location Offset m_stepOutOffset; - HPHP::VM::Unit *m_stepOutUnit; + HPHP::Unit *m_stepOutUnit; private: int16_t m_count; diff --git a/hphp/runtime/eval/debugger/cmd/cmd_instrument.cpp b/hphp/runtime/eval/debugger/cmd/cmd_instrument.cpp index 1d07ce492..3e1ad80e7 100644 --- a/hphp/runtime/eval/debugger/cmd/cmd_instrument.cpp +++ b/hphp/runtime/eval/debugger/cmd/cmd_instrument.cpp @@ -161,12 +161,12 @@ void CmdInstrument::readFromTable(DebuggerProxy *proxy) { return; } // Bytecode address - VM::InjectionTableInt64* tablePC = - proxy->getInjTables()->getInt64Table(VM::InstHookTypeBCPC); + InjectionTableInt64* tablePC = + proxy->getInjTables()->getInt64Table(InstHookTypeBCPC); if (tablePC) { - for (VM::InjectionTableInt64::const_iterator it = tablePC->begin(); + for (InjectionTableInt64::const_iterator it = tablePC->begin(); it != tablePC->end(); ++it) { - const VM::Injection* inj = it->second; + const Injection* inj = it->second; InstPointInfoPtr ipi(new InstPointInfo()); ipi->m_valid = true; if (inj->m_desc) { @@ -178,12 +178,12 @@ void CmdInstrument::readFromTable(DebuggerProxy *proxy) { m_ips.push_back(ipi); } } - VM::InjectionTableSD* tableFEntry = - proxy->getInjTables()->getSDTable(VM::InstHookTypeFuncEntry); + InjectionTableSD* tableFEntry = + proxy->getInjTables()->getSDTable(InstHookTypeFuncEntry); if (tableFEntry) { - for (VM::InjectionTableSD::const_iterator it = tableFEntry->begin(); + for (InjectionTableSD::const_iterator it = tableFEntry->begin(); it != tableFEntry->end(); ++it) { - const VM::Injection* inj = it->second; + const Injection* inj = it->second; InstPointInfoPtr ipi(new InstPointInfo()); ipi->m_valid = true; if (inj->m_desc) { @@ -198,15 +198,15 @@ void CmdInstrument::readFromTable(DebuggerProxy *proxy) { void CmdInstrument::validateAndWriteToTable(DebuggerProxy *proxy) { if (!proxy->getInjTables()) { - proxy->setInjTables(new VM::InjectionTables()); + proxy->setInjTables(new InjectionTables()); } - VM::InjectionTableInt64* tablePC = nullptr; - VM::InjectionTableSD* tableFEntry = nullptr; + InjectionTableInt64* tablePC = nullptr; + InjectionTableSD* tableFEntry = nullptr; for (int i = 0; i < (int)m_ips.size(); i++) { InstPointInfoPtr ipi = m_ips[i]; - const VM::Injection* inj = - VM::InjectionCache::GetInjection(ipi->m_code, ipi->m_desc); + const Injection* inj = + InjectionCache::GetInjection(ipi->m_code, ipi->m_desc); if (!inj) { // error in the code continue; } @@ -218,24 +218,24 @@ void CmdInstrument::validateAndWriteToTable(DebuggerProxy *proxy) { continue; } if (tablePC == nullptr) { - tablePC = new VM::InjectionTableInt64(); + tablePC = new InjectionTableInt64(); } ipi->m_valid = true; (*tablePC)[(int64_t)pc] = inj; } if (ipi->m_locType == InstPointInfo::LocFuncEntry) { StackStringData sd(ipi->m_func.c_str(), ipi->m_func.size(), AttachLiteral); - const StringData* sdCache = VM::InjectionCache::GetStringData(&sd); + const StringData* sdCache = InjectionCache::GetStringData(&sd); if (tableFEntry == nullptr) { - tableFEntry = new VM::InjectionTableSD(); + tableFEntry = new InjectionTableSD(); } ipi->m_valid = true; (*tableFEntry)[sdCache] = inj; } } - proxy->getInjTables()->setInt64Table(VM::InstHookTypeBCPC, tablePC); - proxy->getInjTables()->setSDTable(VM::InstHookTypeFuncEntry, tableFEntry); + proxy->getInjTables()->setInt64Table(InstHookTypeBCPC, tablePC); + proxy->getInjTables()->setSDTable(InstHookTypeFuncEntry, tableFEntry); proxy->writeInjTablesToThread(); } diff --git a/hphp/runtime/eval/debugger/cmd/cmd_print.cpp b/hphp/runtime/eval/debugger/cmd/cmd_print.cpp index 1298126c5..cfef995d6 100644 --- a/hphp/runtime/eval/debugger/cmd/cmd_print.cpp +++ b/hphp/runtime/eval/debugger/cmd/cmd_print.cpp @@ -374,8 +374,8 @@ void CmdPrint::setClientOutput(DebuggerClient *client) { } bool CmdPrint::onServer(DebuggerProxy *proxy) { - VM::PCFilter* locSave = g_vmContext->m_lastLocFilter; - g_vmContext->m_lastLocFilter = new VM::PCFilter(); + PCFilter* locSave = g_vmContext->m_lastLocFilter; + g_vmContext->m_lastLocFilter = new PCFilter(); g_vmContext->setDebuggerBypassCheck(m_bypassAccessCheck); { EvalBreakControl eval(m_noBreak); diff --git a/hphp/runtime/eval/debugger/debugger.cpp b/hphp/runtime/eval/debugger/debugger.cpp index ea2873cb6..837ad6a5e 100644 --- a/hphp/runtime/eval/debugger/debugger.cpp +++ b/hphp/runtime/eval/debugger/debugger.cpp @@ -218,7 +218,7 @@ bool Debugger::InterruptException(CVarRef e) { if (RuntimeOption::EnableDebugger) { ThreadInfo *ti = ThreadInfo::s_threadInfo.getNoCheck(); if (ti->m_reqInjectionData.getDebugger()) { - HPHP::VM::Transl::VMRegAnchor _; + HPHP::Transl::VMRegAnchor _; InterruptVMHook(ExceptionThrown, e); } } @@ -490,7 +490,7 @@ void Debugger::removeProxy(DebuggerProxyPtr proxy) { m_proxyMap.erase(dummySid); // Clear the debugger blacklist PC upon last detach if JIT is used if (RuntimeOption::EvalJit && countConnectedProxy() == 0) { - VM::Transl::Translator::Get()->clearDbgBL(); + Transl::Translator::Get()->clearDbgBL(); } } diff --git a/hphp/runtime/eval/debugger/debugger_proxy.cpp b/hphp/runtime/eval/debugger/debugger_proxy.cpp index ff7c8ded2..b354d780b 100644 --- a/hphp/runtime/eval/debugger/debugger_proxy.cpp +++ b/hphp/runtime/eval/debugger/debugger_proxy.cpp @@ -180,7 +180,7 @@ void DebuggerProxy::setBreakPoints(BreakPointInfoPtrVec &breakpoints) { } } } - VM::phpSetBreakPointsInAllFiles(this); // Apply breakpoints to the code. + phpSetBreakPointsInAllFiles(this); // Apply breakpoints to the code. } void DebuggerProxy::getBreakPoints(BreakPointInfoPtrVec &breakpoints) { diff --git a/hphp/runtime/eval/debugger/debugger_proxy.h b/hphp/runtime/eval/debugger/debugger_proxy.h index 16efe3dc0..08c6491c0 100644 --- a/hphp/runtime/eval/debugger/debugger_proxy.h +++ b/hphp/runtime/eval/debugger/debugger_proxy.h @@ -106,8 +106,8 @@ public: void forceQuit(); // For instrumentation - HPHP::VM::InjectionTables* getInjTables() const { return m_injTables; } - void setInjTables(HPHP::VM::InjectionTables* tables) { m_injTables = tables;} + HPHP::InjectionTables* getInjTables() const { return m_injTables; } + void setInjTables(HPHP::InjectionTables* tables) { m_injTables = tables;} void readInjTablesFromThread(); void writeInjTablesToThread(); @@ -153,7 +153,7 @@ private: int m_signum; // For instrumentation - HPHP::VM::InjectionTables* m_injTables; + HPHP::InjectionTables* m_injTables; }; /////////////////////////////////////////////////////////////////////////////// diff --git a/hphp/runtime/eval/debugger/inst_point.cpp b/hphp/runtime/eval/debugger/inst_point.cpp index 0c6ba73cf..b2b77c605 100644 --- a/hphp/runtime/eval/debugger/inst_point.cpp +++ b/hphp/runtime/eval/debugger/inst_point.cpp @@ -33,7 +33,7 @@ const uchar* InstPointInfo::lookupPC() { return nullptr; } PC pc = context->getPC(); - HPHP::VM::Unit *unit = fp->m_func->unit(); + HPHP::Unit *unit = fp->m_func->unit(); if (!unit) { return nullptr; } diff --git a/hphp/runtime/eval/runtime/file_repository.cpp b/hphp/runtime/eval/runtime/file_repository.cpp index a6de80b2d..671b0fcdc 100644 --- a/hphp/runtime/eval/runtime/file_repository.cpp +++ b/hphp/runtime/eval/runtime/file_repository.cpp @@ -43,7 +43,7 @@ std::set FileRepository::s_names; PhpFile::PhpFile(const string &fileName, const string &srcRoot, const string &relPath, const string &md5, - HPHP::VM::Unit* unit) + HPHP::Unit* unit) : m_refCount(0), m_id(0), m_profName(string("run_init::") + string(fileName)), m_fileName(fileName), m_srcRoot(srcRoot), m_relPath(relPath), m_md5(md5), @@ -55,7 +55,7 @@ PhpFile::~PhpFile() { if (m_unit != nullptr) { // Deleting a Unit can grab a low-ranked lock and we're probably // at a high rank right now - VM::PendQ::defer(new VM::DeferredDeleter(m_unit)); + PendQ::defer(new DeferredDeleter(m_unit)); m_unit = nullptr; } } @@ -126,7 +126,7 @@ void FileRepository::onDelete(PhpFile *f) { delete f; } -void FileRepository::forEachUnit(VM::UnitVisitor& uit) { +void FileRepository::forEachUnit(UnitVisitor& uit) { ReadLock lock(s_md5Lock); for (Md5FileMap::const_iterator it = s_md5Files.begin(); it != s_md5Files.end(); ++it) { @@ -213,7 +213,7 @@ PhpFile *FileRepository::checkoutFile(StringData *rname, if (isNew) { acc->second = new PhpFileWrapper(s, ret); ret->incRef(); - ret->setId(VM::Transl::TargetCache::allocBit()); + ret->setId(Transl::TargetCache::allocBit()); } else { PhpFile *f = acc->second->getPhpFile(); if (f != ret) { @@ -246,7 +246,7 @@ bool FileRepository::findFile(const StringData *path, struct stat *s) { const StringData* spath = StringData::GetStaticString(path); UnitMd5Map::accessor acc; if (s_unitMd5Map.insert(acc, spath)) { - bool present = VM::Repo::get().findFile( + bool present = Repo::get().findFile( path->data(), SourceRootInfo::GetCurrentSourceRoot(), md5); acc->second.m_present = present; acc->second.m_unitMd5 = md5; @@ -373,7 +373,7 @@ bool FileRepository::readRepoMd5(const StringData *path, UnitMd5Map::accessor acc; path = StringData::GetStaticString(path); if (s_unitMd5Map.insert(acc, path)) { - if (!VM::Repo::get().findFile(path->data(), + if (!Repo::get().findFile(path->data(), SourceRootInfo::GetCurrentSourceRoot(), md5)) { acc->second.m_present = false; @@ -407,7 +407,7 @@ bool FileRepository::readFile(const StringData *name, PhpFile *FileRepository::readHhbc(const std::string &name, const FileInfo &fileInfo) { MD5 md5 = MD5(fileInfo.m_unitMd5.c_str()); - VM::Unit* u = VM::Repo::get().loadUnit(name, md5); + Unit* u = Repo::get().loadUnit(name, md5); if (u != nullptr) { PhpFile *p = new PhpFile(name, fileInfo.m_srcRoot, fileInfo.m_relPath, fileInfo.m_md5, u); @@ -420,7 +420,7 @@ PhpFile *FileRepository::readHhbc(const std::string &name, PhpFile *FileRepository::parseFile(const std::string &name, const FileInfo &fileInfo) { MD5 md5 = MD5(fileInfo.m_unitMd5.c_str()); - VM::Unit* unit = compile_file(fileInfo.m_inputString->data(), + Unit* unit = compile_file(fileInfo.m_inputString->data(), fileInfo.m_inputString->size(), md5, name.c_str()); PhpFile *p = new PhpFile(name, fileInfo.m_srcRoot, fileInfo.m_relPath, diff --git a/hphp/runtime/eval/runtime/file_repository.h b/hphp/runtime/eval/runtime/file_repository.h index fcc3efe77..595b3ea27 100644 --- a/hphp/runtime/eval/runtime/file_repository.h +++ b/hphp/runtime/eval/runtime/file_repository.h @@ -27,7 +27,6 @@ #include namespace HPHP { -namespace VM { class Unit; /* UnitVisitor: abstract interface for running code on each Unit. */ @@ -37,7 +36,6 @@ public: virtual void operator()(Unit *u) = 0; }; } -} namespace HPHP { namespace Eval { @@ -55,7 +53,7 @@ class PhpFile { public: PhpFile(const std::string &fileName, const std::string &srcRoot, const std::string &relPath, const std::string &md5, - HPHP::VM::Unit* unit); + HPHP::Unit* unit); ~PhpFile(); void incRef(); int decRef(int num = 1); @@ -66,7 +64,7 @@ public: const std::string &getSrcRoot() const { return m_srcRoot; } const std::string &getRelPath() const { return m_relPath; } const std::string &getMd5() const { return m_md5; } - HPHP::VM::Unit* unit() const { return m_unit; } + HPHP::Unit* unit() const { return m_unit; } int getId() const { return m_id; } void setId(int id); @@ -78,7 +76,7 @@ private: std::string m_srcRoot; std::string m_relPath; std::string m_md5; - HPHP::VM::Unit* m_unit; + HPHP::Unit* m_unit; }; class PhpFileWrapper { @@ -157,7 +155,7 @@ public: static PhpFile *parseFile(const std::string &name, const FileInfo &fileInfo); static String translateFileName(StringData *file); static void onDelete(PhpFile *f); - static void forEachUnit(VM::UnitVisitor& uit); + static void forEachUnit(UnitVisitor& uit); static size_t getLoadedFiles(); private: static ParsedFilesMap s_files; diff --git a/hphp/runtime/ext/asio/blockable_wait_handle.cpp b/hphp/runtime/ext/asio/blockable_wait_handle.cpp index 0f69b4476..e4535bc4e 100644 --- a/hphp/runtime/ext/asio/blockable_wait_handle.cpp +++ b/hphp/runtime/ext/asio/blockable_wait_handle.cpp @@ -22,7 +22,7 @@ namespace HPHP { /////////////////////////////////////////////////////////////////////////////// -c_BlockableWaitHandle::c_BlockableWaitHandle(VM::Class* cb) +c_BlockableWaitHandle::c_BlockableWaitHandle(Class* cb) : c_WaitableWaitHandle(cb), m_nextParent(nullptr) { } diff --git a/hphp/runtime/ext/asio/continuation_wait_handle.cpp b/hphp/runtime/ext/asio/continuation_wait_handle.cpp index b426894c1..ba4e691ef 100644 --- a/hphp/runtime/ext/asio/continuation_wait_handle.cpp +++ b/hphp/runtime/ext/asio/continuation_wait_handle.cpp @@ -34,7 +34,7 @@ namespace { StaticString s_continuation("Continuation"); } -c_ContinuationWaitHandle::c_ContinuationWaitHandle(VM::Class* cb) +c_ContinuationWaitHandle::c_ContinuationWaitHandle(Class* cb) : c_BlockableWaitHandle(cb), m_continuation(), m_child(), m_privData(), m_depth(0) { } diff --git a/hphp/runtime/ext/asio/external_thread_event_wait_handle.cpp b/hphp/runtime/ext/asio/external_thread_event_wait_handle.cpp index ee97fbe80..311c4ebb5 100644 --- a/hphp/runtime/ext/asio/external_thread_event_wait_handle.cpp +++ b/hphp/runtime/ext/asio/external_thread_event_wait_handle.cpp @@ -27,7 +27,7 @@ namespace { StaticString s_externalThreadEvent(""); } -c_ExternalThreadEventWaitHandle::c_ExternalThreadEventWaitHandle(VM::Class *cb) +c_ExternalThreadEventWaitHandle::c_ExternalThreadEventWaitHandle(Class *cb) : c_WaitableWaitHandle(cb) { } diff --git a/hphp/runtime/ext/asio/gen_array_wait_handle.cpp b/hphp/runtime/ext/asio/gen_array_wait_handle.cpp index 27e76e9f7..205a0b8df 100644 --- a/hphp/runtime/ext/asio/gen_array_wait_handle.cpp +++ b/hphp/runtime/ext/asio/gen_array_wait_handle.cpp @@ -37,7 +37,7 @@ namespace { } } -c_GenArrayWaitHandle::c_GenArrayWaitHandle(VM::Class* cb) +c_GenArrayWaitHandle::c_GenArrayWaitHandle(Class* cb) : c_BlockableWaitHandle(cb), m_exception() { } diff --git a/hphp/runtime/ext/asio/reschedule_wait_handle.cpp b/hphp/runtime/ext/asio/reschedule_wait_handle.cpp index 7c5acf99d..2da0c73df 100644 --- a/hphp/runtime/ext/asio/reschedule_wait_handle.cpp +++ b/hphp/runtime/ext/asio/reschedule_wait_handle.cpp @@ -30,7 +30,7 @@ namespace { const int q_RescheduleWaitHandle$$QUEUE_DEFAULT = AsioContext::QUEUE_DEFAULT; const int q_RescheduleWaitHandle$$QUEUE_NO_PENDING_IO = AsioContext::QUEUE_NO_PENDING_IO; -c_RescheduleWaitHandle::c_RescheduleWaitHandle(VM::Class *cb) +c_RescheduleWaitHandle::c_RescheduleWaitHandle(Class *cb) : c_WaitableWaitHandle(cb) { } diff --git a/hphp/runtime/ext/asio/set_result_to_ref_wait_handle.cpp b/hphp/runtime/ext/asio/set_result_to_ref_wait_handle.cpp index 143a52f37..4bd02e751 100644 --- a/hphp/runtime/ext/asio/set_result_to_ref_wait_handle.cpp +++ b/hphp/runtime/ext/asio/set_result_to_ref_wait_handle.cpp @@ -28,7 +28,7 @@ namespace { StaticString s_setResultToRef(""); } -c_SetResultToRefWaitHandle::c_SetResultToRefWaitHandle(VM::Class* cb) +c_SetResultToRefWaitHandle::c_SetResultToRefWaitHandle(Class* cb) : c_BlockableWaitHandle(cb), m_child(), m_ref() { } diff --git a/hphp/runtime/ext/asio/static_exception_wait_handle.cpp b/hphp/runtime/ext/asio/static_exception_wait_handle.cpp index 800eb018a..d1c3bd1fd 100644 --- a/hphp/runtime/ext/asio/static_exception_wait_handle.cpp +++ b/hphp/runtime/ext/asio/static_exception_wait_handle.cpp @@ -25,7 +25,7 @@ namespace { StaticString s_staticException(""); } -c_StaticExceptionWaitHandle::c_StaticExceptionWaitHandle(VM::Class* cb) +c_StaticExceptionWaitHandle::c_StaticExceptionWaitHandle(Class* cb) : c_StaticWaitHandle(cb) { setState(STATE_FAILED); } diff --git a/hphp/runtime/ext/asio/static_result_wait_handle.cpp b/hphp/runtime/ext/asio/static_result_wait_handle.cpp index 00beea449..3dcc77f5f 100644 --- a/hphp/runtime/ext/asio/static_result_wait_handle.cpp +++ b/hphp/runtime/ext/asio/static_result_wait_handle.cpp @@ -25,7 +25,7 @@ namespace { StaticString s_staticResult(""); } -c_StaticResultWaitHandle::c_StaticResultWaitHandle(VM::Class* cb) +c_StaticResultWaitHandle::c_StaticResultWaitHandle(Class* cb) : c_StaticWaitHandle(cb) { setState(STATE_SUCCEEDED); } diff --git a/hphp/runtime/ext/asio/static_wait_handle.cpp b/hphp/runtime/ext/asio/static_wait_handle.cpp index fb85c6216..80bede08e 100644 --- a/hphp/runtime/ext/asio/static_wait_handle.cpp +++ b/hphp/runtime/ext/asio/static_wait_handle.cpp @@ -20,7 +20,7 @@ namespace HPHP { /////////////////////////////////////////////////////////////////////////////// -c_StaticWaitHandle::c_StaticWaitHandle(VM::Class* cb) +c_StaticWaitHandle::c_StaticWaitHandle(Class* cb) : c_WaitHandle(cb) { } diff --git a/hphp/runtime/ext/asio/wait_handle.cpp b/hphp/runtime/ext/asio/wait_handle.cpp index 33edc28ed..71e9ba79e 100644 --- a/hphp/runtime/ext/asio/wait_handle.cpp +++ b/hphp/runtime/ext/asio/wait_handle.cpp @@ -22,7 +22,7 @@ namespace HPHP { /////////////////////////////////////////////////////////////////////////////// -c_WaitHandle::c_WaitHandle(VM::Class* cb) +c_WaitHandle::c_WaitHandle(Class* cb) : ExtObjectData(cb) { } diff --git a/hphp/runtime/ext/asio/waitable_wait_handle.cpp b/hphp/runtime/ext/asio/waitable_wait_handle.cpp index 5a7c97448..444f9c8f1 100644 --- a/hphp/runtime/ext/asio/waitable_wait_handle.cpp +++ b/hphp/runtime/ext/asio/waitable_wait_handle.cpp @@ -23,7 +23,7 @@ namespace HPHP { /////////////////////////////////////////////////////////////////////////////// -c_WaitableWaitHandle::c_WaitableWaitHandle(VM::Class* cb) +c_WaitableWaitHandle::c_WaitableWaitHandle(Class* cb) : c_WaitHandle(cb) , m_creator(AsioSession::Get()->getCurrentWaitHandle()) , m_firstParent(nullptr) { diff --git a/hphp/runtime/ext/ext_array.cpp b/hphp/runtime/ext/ext_array.cpp index 76d5e5739..3f87fa4fe 100644 --- a/hphp/runtime/ext/ext_array.cpp +++ b/hphp/runtime/ext/ext_array.cpp @@ -63,7 +63,7 @@ const int64_t k_UCOL_STRENGTH = UCOL_STRENGTH; const int64_t k_UCOL_HIRAGANA_QUATERNARY_MODE = UCOL_HIRAGANA_QUATERNARY_MODE; const int64_t k_UCOL_NUMERIC_COLLATION = UCOL_NUMERIC_COLLATION; -using HPHP::VM::Transl::CallerFrame; +using HPHP::Transl::CallerFrame; #define getCheckedArrayRetType(input, fail, type) \ Variant::TypedValueAccessor tva_##input = input.getTypedAccessor(); \ diff --git a/hphp/runtime/ext/ext_asio.h b/hphp/runtime/ext/ext_asio.h index 32dde17ea..d1318e7ee 100644 --- a/hphp/runtime/ext/ext_asio.h +++ b/hphp/runtime/ext/ext_asio.h @@ -60,7 +60,7 @@ class c_WaitHandle : public ExtObjectData { DECLARE_CLASS(WaitHandle, WaitHandle, ObjectData) // need to implement - public: c_WaitHandle(VM::Class* cls = c_WaitHandle::s_cls); + public: c_WaitHandle(Class* cls = c_WaitHandle::s_cls); public: ~c_WaitHandle(); public: void t___construct(); public: static void ti_setonjoincallback(CVarRef callback); @@ -113,7 +113,7 @@ class c_StaticWaitHandle : public c_WaitHandle { DECLARE_CLASS(StaticWaitHandle, StaticWaitHandle, WaitHandle) // need to implement - public: c_StaticWaitHandle(VM::Class* cls = c_StaticWaitHandle::s_cls); + public: c_StaticWaitHandle(Class* cls = c_StaticWaitHandle::s_cls); public: ~c_StaticWaitHandle(); public: void t___construct(); @@ -131,7 +131,7 @@ class c_StaticResultWaitHandle : public c_StaticWaitHandle { DECLARE_CLASS(StaticResultWaitHandle, StaticResultWaitHandle, StaticWaitHandle) // need to implement - public: c_StaticResultWaitHandle(VM::Class* cls = c_StaticResultWaitHandle::s_cls); + public: c_StaticResultWaitHandle(Class* cls = c_StaticResultWaitHandle::s_cls); public: ~c_StaticResultWaitHandle(); public: void t___construct(); public: static Object ti_create(CVarRef result); @@ -153,7 +153,7 @@ class c_StaticExceptionWaitHandle : public c_StaticWaitHandle { DECLARE_CLASS(StaticExceptionWaitHandle, StaticExceptionWaitHandle, StaticWaitHandle) // need to implement - public: c_StaticExceptionWaitHandle(VM::Class* cls = c_StaticExceptionWaitHandle::s_cls); + public: c_StaticExceptionWaitHandle(Class* cls = c_StaticExceptionWaitHandle::s_cls); public: ~c_StaticExceptionWaitHandle(); public: void t___construct(); public: static Object ti_create(CObjRef exception); @@ -179,7 +179,7 @@ class c_WaitableWaitHandle : public c_WaitHandle { DECLARE_CLASS(WaitableWaitHandle, WaitableWaitHandle, WaitHandle) // need to implement - public: c_WaitableWaitHandle(VM::Class* cls = c_WaitableWaitHandle::s_cls); + public: c_WaitableWaitHandle(Class* cls = c_WaitableWaitHandle::s_cls); public: ~c_WaitableWaitHandle(); public: void t___construct(); public: int t_getcontextidx(); @@ -230,7 +230,7 @@ class c_BlockableWaitHandle : public c_WaitableWaitHandle { DECLARE_CLASS(BlockableWaitHandle, BlockableWaitHandle, WaitableWaitHandle) // need to implement - public: c_BlockableWaitHandle(VM::Class* cls = c_BlockableWaitHandle::s_cls); + public: c_BlockableWaitHandle(Class* cls = c_BlockableWaitHandle::s_cls); public: ~c_BlockableWaitHandle(); public: void t___construct(); @@ -270,7 +270,7 @@ class c_ContinuationWaitHandle : public c_BlockableWaitHandle { DECLARE_CLASS(ContinuationWaitHandle, ContinuationWaitHandle, BlockableWaitHandle) // need to implement - public: c_ContinuationWaitHandle(VM::Class* cls = c_ContinuationWaitHandle::s_cls); + public: c_ContinuationWaitHandle(Class* cls = c_ContinuationWaitHandle::s_cls); public: ~c_ContinuationWaitHandle(); public: void t___construct(); public: static void ti_setoncreatecallback(CVarRef callback); @@ -321,7 +321,7 @@ class c_GenArrayWaitHandle : public c_BlockableWaitHandle { DECLARE_CLASS(GenArrayWaitHandle, GenArrayWaitHandle, BlockableWaitHandle) // need to implement - public: c_GenArrayWaitHandle(VM::Class* cls = c_GenArrayWaitHandle::s_cls); + public: c_GenArrayWaitHandle(Class* cls = c_GenArrayWaitHandle::s_cls); public: ~c_GenArrayWaitHandle(); public: void t___construct(); public: static void ti_setoncreatecallback(CVarRef callback); @@ -357,7 +357,7 @@ class c_SetResultToRefWaitHandle : public c_BlockableWaitHandle { DECLARE_CLASS(SetResultToRefWaitHandle, SetResultToRefWaitHandle, BlockableWaitHandle) // need to implement - public: c_SetResultToRefWaitHandle(VM::Class* cls = c_SetResultToRefWaitHandle::s_cls); + public: c_SetResultToRefWaitHandle(Class* cls = c_SetResultToRefWaitHandle::s_cls); public: ~c_SetResultToRefWaitHandle(); public: void t___construct(); public: static void ti_setoncreatecallback(CVarRef callback); @@ -399,7 +399,7 @@ class c_RescheduleWaitHandle : public c_WaitableWaitHandle { DECLARE_CLASS(RescheduleWaitHandle, RescheduleWaitHandle, WaitableWaitHandle) // need to implement - public: c_RescheduleWaitHandle(VM::Class* cls = c_RescheduleWaitHandle::s_cls); + public: c_RescheduleWaitHandle(Class* cls = c_RescheduleWaitHandle::s_cls); public: ~c_RescheduleWaitHandle(); public: void t___construct(); public: static Object ti_create(int queue, int priority); @@ -434,7 +434,7 @@ class c_ExternalThreadEventWaitHandle : public c_WaitableWaitHandle, public Swee DECLARE_CLASS(ExternalThreadEventWaitHandle, ExternalThreadEventWaitHandle, WaitableWaitHandle) // need to implement - public: c_ExternalThreadEventWaitHandle(VM::Class* cls = c_ExternalThreadEventWaitHandle::s_cls); + public: c_ExternalThreadEventWaitHandle(Class* cls = c_ExternalThreadEventWaitHandle::s_cls); public: ~c_ExternalThreadEventWaitHandle(); public: void t___construct(); diff --git a/hphp/runtime/ext/ext_class.cpp b/hphp/runtime/ext/ext_class.cpp index dafaaddc8..abc228e2b 100644 --- a/hphp/runtime/ext/ext_class.cpp +++ b/hphp/runtime/ext/ext_class.cpp @@ -23,8 +23,8 @@ namespace HPHP { -using VM::Transl::CallerFrame; -using VM::Transl::VMRegAnchor; +using Transl::CallerFrame; +using Transl::VMRegAnchor; /////////////////////////////////////////////////////////////////////////////// // helpers @@ -37,17 +37,17 @@ static String get_classname(CVarRef class_or_object) { } static inline CStrRef ctxClassName() { - VM::Class* ctx = g_vmContext->getContextClass(); + Class* ctx = g_vmContext->getContextClass(); return ctx ? ctx->nameRef() : empty_string; } -static const VM::Class* get_cls(CVarRef class_or_object) { - VM::Class* cls = NULL; +static const Class* get_cls(CVarRef class_or_object) { + Class* cls = NULL; if (class_or_object.is(KindOfObject)) { ObjectData* obj = class_or_object.toCObjRef().get(); cls = obj->getVMClass(); } else { - cls = VM::Unit::loadClass(class_or_object.toString().get()); + cls = Unit::loadClass(class_or_object.toString().get()); } return cls; } @@ -67,20 +67,20 @@ Array f_get_declared_traits() { } bool f_class_exists(CStrRef class_name, bool autoload /* = true */) { - return VM::Unit::classExists(class_name.get(), autoload, AttrNone); + return Unit::classExists(class_name.get(), autoload, AttrNone); } bool f_interface_exists(CStrRef interface_name, bool autoload /* = true */) { - return VM::Unit::classExists(interface_name.get(), autoload, + return Unit::classExists(interface_name.get(), autoload, AttrInterface); } bool f_trait_exists(CStrRef trait_name, bool autoload /* = true */) { - return VM::Unit::classExists(trait_name.get(), autoload, AttrTrait); + return Unit::classExists(trait_name.get(), autoload, AttrTrait); } Array f_get_class_methods(CVarRef class_or_object) { - const VM::Class* cls = get_cls(class_or_object); + const Class* cls = get_cls(class_or_object); if (!cls) return Array(); VMRegAnchor _; @@ -91,14 +91,14 @@ Array f_get_class_methods(CVarRef class_or_object) { } Array vm_get_class_constants(CStrRef className) { - HPHP::VM::Class* cls = HPHP::VM::Unit::loadClass(className.get()); + HPHP::Class* cls = HPHP::Unit::loadClass(className.get()); if (cls == NULL) { return NEW(HphpArray)(0); } size_t numConstants = cls->numConstants(); HphpArray* retVal = NEW(HphpArray)(numConstants); - const VM::Class::Const* consts = cls->constants(); + const Class::Const* consts = cls->constants(); for (size_t i = 0; i < numConstants; i++) { // Note: hphpc doesn't include inherited constants in // get_class_constants(), so mimic that behavior @@ -121,29 +121,29 @@ Array f_get_class_constants(CStrRef class_name) { } Array vm_get_class_vars(CStrRef className) { - HPHP::VM::Class* cls = HPHP::VM::Unit::lookupClass(className.get()); + HPHP::Class* cls = HPHP::Unit::lookupClass(className.get()); if (cls == NULL) { raise_error("Unknown class %s", className->data()); } cls->initialize(); - const VM::Class::SProp* sPropInfo = cls->staticProperties(); + const Class::SProp* sPropInfo = cls->staticProperties(); const size_t numSProps = cls->numStaticProperties(); - const VM::Class::Prop* propInfo = cls->declProperties(); + const Class::Prop* propInfo = cls->declProperties(); const size_t numDeclProps = cls->numDeclProperties(); // The class' instance property initialization template is in different // places, depending on whether it has any request-dependent initializers // (i.e. constants) - const VM::Class::PropInitVec& declPropInitVec = cls->declPropInit(); - const VM::Class::PropInitVec* propVals = !cls->pinitVec().empty() + const Class::PropInitVec& declPropInitVec = cls->declPropInit(); + const Class::PropInitVec* propVals = !cls->pinitVec().empty() ? cls->getPropData() : &declPropInitVec; assert(propVals != NULL); assert(propVals->size() == numDeclProps); // For visibility checks CallerFrame cf; - HPHP::VM::Class* ctx = arGetContextClass(cf()); + HPHP::Class* ctx = arGetContextClass(cf()); HphpArray* ret = NEW(HphpArray)(numDeclProps + numSProps); @@ -151,7 +151,7 @@ Array vm_get_class_vars(CStrRef className) { StringData* name = const_cast(propInfo[i].m_name); // Empty names are used for invisible/private parent properties; skip them assert(name->size() != 0); - if (VM::Class::IsPropAccessible(propInfo[i], ctx)) { + if (Class::IsPropAccessible(propInfo[i], ctx)) { const TypedValue* value = &((*propVals)[i]); ret->nvSet(name, value, false); } @@ -179,7 +179,7 @@ Variant f_get_class(CVarRef object /* = null_variant */) { // No arg passed. String ret; CallerFrame cf; - HPHP::VM::Class* cls = arGetContextClassImpl(cf()); + HPHP::Class* cls = arGetContextClassImpl(cf()); if (cls) { ret = CStrRef(cls->nameRef()); } @@ -197,7 +197,7 @@ Variant f_get_class(CVarRef object /* = null_variant */) { Variant f_get_parent_class(CVarRef object /* = null_variant */) { if (!object.isInitialized()) { CallerFrame cf; - HPHP::VM::Class* cls = arGetContextClass(cf()); + HPHP::Class* cls = arGetContextClass(cf()); if (cls && cls->parent()) { return CStrRef(cls->parentRef()); } @@ -213,7 +213,7 @@ Variant f_get_parent_class(CVarRef object /* = null_variant */) { return false; } - VM::Class* cls = VM::Unit::lookupClass(class_name.toString().get()); + Class* cls = Unit::lookupClass(class_name.toString().get()); if (cls) { CStrRef parentClass = *(const String*)(&cls->parentRef()); if (!parentClass.empty()) { @@ -229,10 +229,10 @@ static bool is_a_impl(CVarRef class_or_object, CStrRef class_name, return false; } - const VM::Class* cls = get_cls(class_or_object); + const Class* cls = get_cls(class_or_object); if (!cls) return false; if (cls->attrs() & AttrTrait) return false; - const VM::Class* other = VM::Unit::lookupClass(class_name.get()); + const Class* other = Unit::lookupClass(class_name.get()); if (!other) return false; if (other->attrs() & AttrTrait) return false; if (other == cls) return !subclass_only; @@ -248,12 +248,12 @@ bool f_is_subclass_of(CVarRef class_or_object, CStrRef class_name, bool allow_st } bool f_method_exists(CVarRef class_or_object, CStrRef method_name) { - const VM::Class* cls = get_cls(class_or_object); + const Class* cls = get_cls(class_or_object); if (!cls) return false; if (cls->lookupMethod(method_name.get()) != NULL) return true; if (cls->attrs() & AttrAbstract) { - const VM::ClassSet& ifaces = cls->allInterfaces(); - for (VM::ClassSet::const_iterator it = ifaces.begin(); + const ClassSet& ifaces = cls->allInterfaces(); + for (ClassSet::const_iterator it = ifaces.begin(); it != ifaces.end(); ++it) { if ((*it)->lookupMethod(method_name.get())) return true; @@ -275,7 +275,7 @@ Variant f_property_exists(CVarRef class_or_object, CStrRef property) { return Variant(Variant::nullInit); } - VM::Class* cls = VM::Unit::lookupClass(get_classname(class_or_object).get()); + Class* cls = Unit::lookupClass(get_classname(class_or_object).get()); if (!cls) { return false; } diff --git a/hphp/runtime/ext/ext_closure.cpp b/hphp/runtime/ext/ext_closure.cpp index 37078228b..35badb227 100644 --- a/hphp/runtime/ext/ext_closure.cpp +++ b/hphp/runtime/ext/ext_closure.cpp @@ -22,7 +22,7 @@ namespace HPHP { /////////////////////////////////////////////////////////////////////////////// -c_Closure::c_Closure(VM::Class* cb) : ExtObjectData(cb), +c_Closure::c_Closure(Class* cb) : ExtObjectData(cb), m_thisOrClass(nullptr), m_func(nullptr) {} c_Closure::~c_Closure() { // same as ar->hasThis() @@ -41,7 +41,7 @@ void c_Closure::t___construct() { */ c_Closure* c_Closure::init(int numArgs, ActRec* ar, TypedValue* sp) { static StringData* invokeName = StringData::GetStaticString("__invoke"); - VM::Func* invokeFunc = getVMClass()->lookupMethod(invokeName); + Func* invokeFunc = getVMClass()->lookupMethod(invokeName); if (invokeFunc->attrs() & AttrStatic) { // Only set the class for static closures @@ -56,7 +56,7 @@ c_Closure* c_Closure::init(int numArgs, ActRec* ar, TypedValue* sp) { } // Change my __invoke's m_cls to be the same as my creator's - VM::Class* scope = ar->m_func->cls(); + Class* scope = ar->m_func->cls(); m_func = invokeFunc->cloneAndSetClass(scope); // copy the props to instance variables @@ -94,7 +94,7 @@ HphpArray* c_Closure::getStaticLocals() { /////////////////////////////////////////////////////////////////////////////// -c_DummyClosure::c_DummyClosure(VM::Class* cb) : +c_DummyClosure::c_DummyClosure(Class* cb) : ExtObjectData(cb) { } diff --git a/hphp/runtime/ext/ext_closure.h b/hphp/runtime/ext/ext_closure.h index 915f067bb..5ac0cf426 100644 --- a/hphp/runtime/ext/ext_closure.h +++ b/hphp/runtime/ext/ext_closure.h @@ -36,7 +36,7 @@ class c_Closure : public ExtObjectData { DECLARE_CLASS(Closure, Closure, ObjectData) // need to implement - public: c_Closure(VM::Class* cls = c_Closure::s_cls); + public: c_Closure(Class* cls = c_Closure::s_cls); public: ~c_Closure(); public: void t___construct(); @@ -47,7 +47,7 @@ public: c_Closure* init(int numArgs, ActRec* ar, TypedValue* sp); ObjectData* getThisOrClass() { return m_thisOrClass; } - const VM::Func* getInvokeFunc() { return m_func; } + const Func* getInvokeFunc() { return m_func; } HphpArray* getStaticLocals(); TypedValue* getUseVars() { return propVec(); } int getNumUseVars() { return m_cls->numDeclProperties(); } @@ -60,7 +60,7 @@ protected: private: SmartPtr m_VMStatics; ObjectData* m_thisOrClass; - const VM::Func* m_func; + const Func* m_func; }; /////////////////////////////////////////////////////////////////////////////// @@ -72,7 +72,7 @@ class c_DummyClosure : public ExtObjectData { DECLARE_CLASS(DummyClosure, DummyClosure, ObjectData) // need to implement - public: c_DummyClosure(VM::Class* cls = c_DummyClosure::s_cls); + public: c_DummyClosure(Class* cls = c_DummyClosure::s_cls); public: ~c_DummyClosure(); public: void t___construct(); diff --git a/hphp/runtime/ext/ext_collections.cpp b/hphp/runtime/ext/ext_collections.cpp index b74003349..2d12cd90b 100644 --- a/hphp/runtime/ext/ext_collections.cpp +++ b/hphp/runtime/ext/ext_collections.cpp @@ -93,7 +93,7 @@ static inline ArrayIter getArrayIterHelper(CVarRef v, size_t& sz) { /////////////////////////////////////////////////////////////////////////////// -c_Vector::c_Vector(VM::Class* cb) : +c_Vector::c_Vector(Class* cb) : ExtObjectDataFlags comp; CallCtx ctx; - VM::Transl::CallerFrame cf; + Transl::CallerFrame cf; vm_decode_function(cmp_function, cf(), false, ctx); comp.ctx = &ctx; HPHP::Sort::sort(m_data, m_data + m_size, comp); @@ -940,7 +940,7 @@ void c_Vector::Unserialize(ObjectData* obj, } } -c_VectorIterator::c_VectorIterator(VM::Class* cb) : +c_VectorIterator::c_VectorIterator(Class* cb) : ExtObjectData(cb) { } @@ -987,7 +987,7 @@ void c_VectorIterator::t_rewind() { static const char emptyMapSlot[sizeof(c_Map::Bucket)] = { 0 }; -c_Map::c_Map(VM::Class* cb) : +c_Map::c_Map(Class* cb) : ExtObjectDataFlags(buffer, acc_type(), false); \ ElmUCompare comp; \ CallCtx ctx; \ - VM::Transl::CallerFrame cf; \ + Transl::CallerFrame cf; \ vm_decode_function(cmp_function, cf(), false, ctx); \ comp.ctx = &ctx; \ try { \ @@ -3371,7 +3371,7 @@ do_unserialize: #undef CONNECT_TO_GLOBAL_DLLIST -c_StableMapIterator::c_StableMapIterator(VM::Class* cb) : +c_StableMapIterator::c_StableMapIterator(Class* cb) : ExtObjectData(cb) { } @@ -3427,7 +3427,7 @@ void c_StableMapIterator::t_rewind() { static const char emptySetSlot[sizeof(c_Set::Bucket)] = { 0 }; -c_Set::c_Set(VM::Class* cb) : +c_Set::c_Set(Class* cb) : ExtObjectDataFlagselm1).unserialize(uns, Uns::ColValueMode); } -c_PairIterator::c_PairIterator(VM::Class* cb) : +c_PairIterator::c_PairIterator(Class* cb) : ExtObjectData(cb) { } diff --git a/hphp/runtime/ext/ext_collections.h b/hphp/runtime/ext/ext_collections.h index eac752f2f..94e745ca4 100644 --- a/hphp/runtime/ext/ext_collections.h +++ b/hphp/runtime/ext/ext_collections.h @@ -37,7 +37,7 @@ class c_Vector : public ExtObjectDataFlagslookupMethod(s_next.get()); + const HPHP::Func* func = m_cls->lookupMethod(s_next.get()); g_vmContext->invokeContFunc(func, this); } void c_Continuation::call_send(TypedValue* v) { - const HPHP::VM::Func* func = m_cls->lookupMethod(s_send.get()); + const HPHP::Func* func = m_cls->lookupMethod(s_send.get()); g_vmContext->invokeContFunc(func, this, v); } @@ -195,7 +195,7 @@ void c_Continuation::call_raise(ObjectData* e) { assert(e); assert(e->instanceof(SystemLib::s_ExceptionClass)); - const HPHP::VM::Func* func = m_cls->lookupMethod(s_raise.get()); + const HPHP::Func* func = m_cls->lookupMethod(s_raise.get()); TypedValue arg; arg.m_type = KindOfObject; @@ -206,7 +206,7 @@ void c_Continuation::call_raise(ObjectData* e) { /////////////////////////////////////////////////////////////////////////////// -c_DummyContinuation::c_DummyContinuation(VM::Class* cb) : +c_DummyContinuation::c_DummyContinuation(Class* cb) : ExtObjectData(cb) { } diff --git a/hphp/runtime/ext/ext_continuation.h b/hphp/runtime/ext/ext_continuation.h index a7b81fb6b..3f89801aa 100644 --- a/hphp/runtime/ext/ext_continuation.h +++ b/hphp/runtime/ext/ext_continuation.h @@ -42,15 +42,15 @@ class c_Continuation : public ExtObjectData { this_->m_vmFunc->numIterators()))(this_); } - explicit c_Continuation(VM::Class* cls = c_Continuation::s_cls); + explicit c_Continuation(Class* cls = c_Continuation::s_cls); ~c_Continuation(); public: - void init(const VM::Func* vmFunc, + void init(const Func* vmFunc, const StringData* origFuncName, ObjectData* thisPtr, ArrayData* args) noexcept { - m_vmFunc = const_cast(vmFunc); + m_vmFunc = const_cast(vmFunc); assert(m_vmFunc); m_origFuncName = origFuncName; assert(m_origFuncName->isStatic()); @@ -83,7 +83,7 @@ public: String t_getcalledclass(); Variant t___clone(); - static c_Continuation* alloc(VM::Class* cls, int nLocals, int nIters) { + static c_Continuation* alloc(Class* cls, int nLocals, int nIters) { c_Continuation* cont = (c_Continuation*)ALLOCOBJSZ(sizeForLocalsAndIters(nLocals, nIters)); new ((void *)cont) c_Continuation(cls); @@ -133,7 +133,7 @@ public: bool m_should_throw; int m_localsOffset; - VM::Func *m_vmFunc; + Func *m_vmFunc; int64_t m_label; ActRec* m_arPtr; @@ -165,7 +165,7 @@ class c_DummyContinuation : public ExtObjectData { DECLARE_CLASS(DummyContinuation, DummyContinuation, ObjectData) // need to implement - public: c_DummyContinuation(VM::Class* cls = c_DummyContinuation::s_cls); + public: c_DummyContinuation(Class* cls = c_DummyContinuation::s_cls); public: ~c_DummyContinuation(); public: void t___construct(); public: Variant t_current(); diff --git a/hphp/runtime/ext/ext_datetime.cpp b/hphp/runtime/ext/ext_datetime.cpp index 9ec5cd9e7..90375927b 100644 --- a/hphp/runtime/ext/ext_datetime.cpp +++ b/hphp/runtime/ext/ext_datetime.cpp @@ -54,7 +54,7 @@ const int64_t q_DateTimeZone$$PER_COUNTRY = 4096; /////////////////////////////////////////////////////////////////////////////// // methods -c_DateTime::c_DateTime(VM::Class* cb) : ExtObjectData(cb) { +c_DateTime::c_DateTime(Class* cb) : ExtObjectData(cb) { } c_DateTime::~c_DateTime() { @@ -166,7 +166,7 @@ ObjectData *c_DateTime::clone() { return obj; } -c_DateTimeZone::c_DateTimeZone(VM::Class* cb) : +c_DateTimeZone::c_DateTimeZone(Class* cb) : ExtObjectData(cb) { } @@ -216,7 +216,7 @@ ObjectData *c_DateTimeZone::clone() { return obj; } -c_DateInterval::c_DateInterval(VM::Class* cb) : +c_DateInterval::c_DateInterval(Class* cb) : ExtObjectDataFlags(cb) { } diff --git a/hphp/runtime/ext/ext_datetime.h b/hphp/runtime/ext/ext_datetime.h index 5e857fda9..a948550af 100644 --- a/hphp/runtime/ext/ext_datetime.h +++ b/hphp/runtime/ext/ext_datetime.h @@ -46,7 +46,7 @@ class c_DateTime : public ExtObjectData { DECLARE_CLASS(DateTime, DateTime, ObjectData) // need to implement - public: c_DateTime(VM::Class* cls = c_DateTime::s_cls); + public: c_DateTime(Class* cls = c_DateTime::s_cls); public: ~c_DateTime(); public: Object t_add(CObjRef interval); public: void t___construct(CStrRef time = "now", @@ -112,7 +112,7 @@ class c_DateTimeZone : public ExtObjectData { DECLARE_CLASS(DateTimeZone, DateTimeZone, ObjectData) // need to implement - public: c_DateTimeZone(VM::Class* cls = c_DateTimeZone::s_cls); + public: c_DateTimeZone(Class* cls = c_DateTimeZone::s_cls); public: ~c_DateTimeZone(); public: void t___construct(CStrRef timezone); public: Array t_getlocation(); @@ -153,7 +153,7 @@ class c_DateInterval : public ExtObjectDataFlags(cb),m_node(NULL) { } @@ -2462,7 +2462,7 @@ static PropertyAccessorMap domattr_properties_map /////////////////////////////////////////////////////////////////////////////// -c_DOMAttr::c_DOMAttr(VM::Class* cb) : c_DOMNode(cb) { +c_DOMAttr::c_DOMAttr(Class* cb) : c_DOMNode(cb) { } c_DOMAttr::~c_DOMAttr() { @@ -2540,7 +2540,7 @@ static PropertyAccessorMap domcharacterdata_properties_map /////////////////////////////////////////////////////////////////////////////// -c_DOMCharacterData::c_DOMCharacterData(VM::Class* cb) : +c_DOMCharacterData::c_DOMCharacterData(Class* cb) : c_DOMNode(cb) { } @@ -2698,7 +2698,7 @@ String c_DOMCharacterData::t_substringdata(int64_t offset, int64_t count) { /////////////////////////////////////////////////////////////////////////////// -c_DOMComment::c_DOMComment(VM::Class* cb) : +c_DOMComment::c_DOMComment(Class* cb) : c_DOMCharacterData(cb) { } @@ -2748,7 +2748,7 @@ static PropertyAccessorMap domtext_properties_map /////////////////////////////////////////////////////////////////////////////// -c_DOMText::c_DOMText(VM::Class* cb) : c_DOMCharacterData(cb) { +c_DOMText::c_DOMText(Class* cb) : c_DOMCharacterData(cb) { } c_DOMText::~c_DOMText() { @@ -2818,7 +2818,7 @@ Variant c_DOMText::t_splittext(int64_t offset) { /////////////////////////////////////////////////////////////////////////////// -c_DOMCDATASection::c_DOMCDATASection(VM::Class* cb) : +c_DOMCDATASection::c_DOMCDATASection(Class* cb) : c_DOMText(cb) { } @@ -3009,7 +3009,7 @@ static PropertyAccessorMap domdocument_properties_map /////////////////////////////////////////////////////////////////////////////// -c_DOMDocument::c_DOMDocument(VM::Class* cb) : +c_DOMDocument::c_DOMDocument(Class* cb) : c_DOMNode(cb), m_formatoutput(false), m_validateonparse(false), @@ -3592,7 +3592,7 @@ Variant c_DOMDocument::t_xinclude(int64_t options /* = 0 */) { /////////////////////////////////////////////////////////////////////////////// -c_DOMDocumentFragment::c_DOMDocumentFragment(VM::Class* cb) : +c_DOMDocumentFragment::c_DOMDocumentFragment(Class* cb) : c_DOMNode(cb) { } @@ -3712,7 +3712,7 @@ static PropertyAccessorMap domdocumenttype_properties_map /////////////////////////////////////////////////////////////////////////////// -c_DOMDocumentType::c_DOMDocumentType(VM::Class* cb) : +c_DOMDocumentType::c_DOMDocumentType(Class* cb) : c_DOMNode(cb) { } @@ -3766,7 +3766,7 @@ static PropertyAccessorMap domelement_properties_map /////////////////////////////////////////////////////////////////////////////// -c_DOMElement::c_DOMElement(VM::Class* cb) : c_DOMNode(cb) { +c_DOMElement::c_DOMElement(Class* cb) : c_DOMNode(cb) { } c_DOMElement::~c_DOMElement() { @@ -4419,7 +4419,7 @@ static PropertyAccessorMap domentity_properties_map /////////////////////////////////////////////////////////////////////////////// -c_DOMEntity::c_DOMEntity(VM::Class* cb) : c_DOMNode(cb) { +c_DOMEntity::c_DOMEntity(Class* cb) : c_DOMNode(cb) { } c_DOMEntity::~c_DOMEntity() { @@ -4443,7 +4443,7 @@ bool c_DOMEntity::t___isset(Variant name) { /////////////////////////////////////////////////////////////////////////////// -c_DOMEntityReference::c_DOMEntityReference(VM::Class* cb) : +c_DOMEntityReference::c_DOMEntityReference(Class* cb) : c_DOMNode(cb) { } @@ -4502,7 +4502,7 @@ static PropertyAccessorMap domnotation_properties_map /////////////////////////////////////////////////////////////////////////////// -c_DOMNotation::c_DOMNotation(VM::Class* cb) : +c_DOMNotation::c_DOMNotation(Class* cb) : c_DOMNode(cb) { } @@ -4561,7 +4561,7 @@ static PropertyAccessorMap domprocessinginstruction_properties_map /////////////////////////////////////////////////////////////////////////////// -c_DOMProcessingInstruction::c_DOMProcessingInstruction(VM::Class* cb) : +c_DOMProcessingInstruction::c_DOMProcessingInstruction(Class* cb) : c_DOMNode(cb) { } @@ -4632,7 +4632,7 @@ static PropertyAccessorMap domnamednodemap_properties_map /////////////////////////////////////////////////////////////////////////////// -c_DOMNamedNodeMap::c_DOMNamedNodeMap(VM::Class* cb) : +c_DOMNamedNodeMap::c_DOMNamedNodeMap(Class* cb) : ExtObjectDataFlags(cb) { } @@ -4825,7 +4825,7 @@ static PropertyAccessorMap domnodelist_properties_map /////////////////////////////////////////////////////////////////////////////// -c_DOMNodeList::c_DOMNodeList(VM::Class* cb) : +c_DOMNodeList::c_DOMNodeList(Class* cb) : ExtObjectDataFlags(cb) { } @@ -4906,7 +4906,7 @@ Variant c_DOMNodeList::t_getiterator() { /////////////////////////////////////////////////////////////////////////////// -c_DOMImplementation::c_DOMImplementation(VM::Class* cb) +c_DOMImplementation::c_DOMImplementation(Class* cb) : ExtObjectData(cb) { } @@ -5187,7 +5187,7 @@ static void dom_xpath_ext_function_object_php(xmlXPathParserContextPtr ctxt, dom_xpath_ext_function_php(ctxt, nargs, 2); } -c_DOMXPath::c_DOMXPath(VM::Class* cb) : +c_DOMXPath::c_DOMXPath(Class* cb) : ExtObjectDataFlags(cb), m_node(NULL), m_registerPhpFunctions(0) { @@ -5276,7 +5276,7 @@ Variant c_DOMXPath::t_registerphpfunctions(CVarRef funcs /* = null */) { /////////////////////////////////////////////////////////////////////////////// -c_DOMNodeIterator::c_DOMNodeIterator(VM::Class* cb) : +c_DOMNodeIterator::c_DOMNodeIterator(Class* cb) : ExtObjectData(cb), m_objmap(NULL), m_iter(NULL), m_index(-1) { } diff --git a/hphp/runtime/ext/ext_domdocument.h b/hphp/runtime/ext/ext_domdocument.h index 372657254..f1ee25f85 100644 --- a/hphp/runtime/ext/ext_domdocument.h +++ b/hphp/runtime/ext/ext_domdocument.h @@ -107,7 +107,7 @@ class c_DOMNode : public ExtObjectDataFlagsgetVMClass()->lookupMethod(sd__invoke); + const Func* invoke = d->getVMClass()->lookupMethod(sd__invoke); if (name.isReferenced()) { if (d->instanceof(c_Closure::s_cls)) { // Hack to stop the mangled name from showing up diff --git a/hphp/runtime/ext/ext_hotprofiler.cpp b/hphp/runtime/ext/ext_hotprofiler.cpp index 5b1429c77..bcceed00f 100644 --- a/hphp/runtime/ext/ext_hotprofiler.cpp +++ b/hphp/runtime/ext/ext_hotprofiler.cpp @@ -1519,7 +1519,7 @@ public: if (!RuntimeOption::EnableHotProfiler) { return; } - HPHP::VM::EventHook::Enable(); + HPHP::EventHook::Enable(); if (m_profiler == NULL) { switch (level) { case Simple: @@ -1629,9 +1629,9 @@ void f_fb_setprofile(CVarRef callback) { #endif g_vmContext->m_setprofileCallback = callback; if (callback.isNull()) { - HPHP::VM::EventHook::Disable(); + HPHP::EventHook::Disable(); } else { - HPHP::VM::EventHook::Enable(); + HPHP::EventHook::Enable(); } } diff --git a/hphp/runtime/ext/ext_icu_ucnv.cpp b/hphp/runtime/ext/ext_icu_ucnv.cpp index 5e1fb7e9b..9352f4dc9 100644 --- a/hphp/runtime/ext/ext_icu_ucnv.cpp +++ b/hphp/runtime/ext/ext_icu_ucnv.cpp @@ -74,7 +74,7 @@ static StaticString s_fromUCallback("fromUCallback"); #define THROW_UFAILURE(fname, uerr, ierr) throwFailure(uerr, #fname, ierr); -c_UConverter::c_UConverter(VM::Class* cb) +c_UConverter::c_UConverter(Class* cb) : ExtObjectData(cb), m_src(NULL), m_dest(NULL) { m_error.code = U_ZERO_ERROR; m_error.custom_error_message = ""; diff --git a/hphp/runtime/ext/ext_icu_ucnv.h b/hphp/runtime/ext/ext_icu_ucnv.h index 56e7b62af..e97fe5c04 100644 --- a/hphp/runtime/ext/ext_icu_ucnv.h +++ b/hphp/runtime/ext/ext_icu_ucnv.h @@ -85,7 +85,7 @@ class c_UConverter : public ExtObjectData { DECLARE_CLASS(UConverter, UConverter, ObjectData) // need to implement - public: c_UConverter(VM::Class* cls = c_UConverter::s_cls); + public: c_UConverter(Class* cls = c_UConverter::s_cls); public: ~c_UConverter(); public: void t___construct(CStrRef toEncoding = "utf-8", CStrRef fromEncoding = "utf-8"); diff --git a/hphp/runtime/ext/ext_icu_ucsdet.cpp b/hphp/runtime/ext/ext_icu_ucsdet.cpp index ef3834a76..cda3cb977 100644 --- a/hphp/runtime/ext/ext_icu_ucsdet.cpp +++ b/hphp/runtime/ext/ext_icu_ucsdet.cpp @@ -24,7 +24,7 @@ namespace HPHP { /////////////////////////////////////////////////////////////////////////////// IMPLEMENT_DEFAULT_EXTENSION(icu_ucsdet); -c_EncodingDetector::c_EncodingDetector(VM::Class* cb) : +c_EncodingDetector::c_EncodingDetector(Class* cb) : ExtObjectData(cb) { UErrorCode status = U_ZERO_ERROR; m_encoding_detector = ucsdet_open(&status); @@ -110,7 +110,7 @@ Array c_EncodingDetector::t_detectall() { } /////////////////////////////////////////////////////////////////////////////// -c_EncodingMatch::c_EncodingMatch(VM::Class* cb) : +c_EncodingMatch::c_EncodingMatch(Class* cb) : ExtObjectData(cb), m_encoding_match(0) { } diff --git a/hphp/runtime/ext/ext_icu_ucsdet.h b/hphp/runtime/ext/ext_icu_ucsdet.h index ffbac2113..3022cbac3 100644 --- a/hphp/runtime/ext/ext_icu_ucsdet.h +++ b/hphp/runtime/ext/ext_icu_ucsdet.h @@ -42,7 +42,7 @@ class c_EncodingDetector : public ExtObjectData { DECLARE_CLASS(EncodingDetector, EncodingDetector, ObjectData) // need to implement - public: c_EncodingDetector(VM::Class* cls = c_EncodingDetector::s_cls); + public: c_EncodingDetector(Class* cls = c_EncodingDetector::s_cls); public: ~c_EncodingDetector(); public: void t___construct(); public: void t_settext(CStrRef text); @@ -67,7 +67,7 @@ class c_EncodingMatch : public ExtObjectData { DECLARE_CLASS(EncodingMatch, EncodingMatch, ObjectData) // need to implement - public: c_EncodingMatch(VM::Class* cls = c_EncodingMatch::s_cls); + public: c_EncodingMatch(Class* cls = c_EncodingMatch::s_cls); public: ~c_EncodingMatch(); public: void t___construct(); public: bool t_isvalid(); diff --git a/hphp/runtime/ext/ext_icu_uspoof.cpp b/hphp/runtime/ext/ext_icu_uspoof.cpp index fe21e62d2..84db29559 100644 --- a/hphp/runtime/ext/ext_icu_uspoof.cpp +++ b/hphp/runtime/ext/ext_icu_uspoof.cpp @@ -36,7 +36,7 @@ const int64_t q_SpoofChecker$$INVISIBLE = USPOOF_INVISIBLE; const int64_t q_SpoofChecker$$CHAR_LIMIT = USPOOF_CHAR_LIMIT; /////////////////////////////////////////////////////////////////////////////// -c_SpoofChecker::c_SpoofChecker(VM::Class* cb) : +c_SpoofChecker::c_SpoofChecker(Class* cb) : ExtObjectData(cb) { UErrorCode status = U_ZERO_ERROR; m_spoof_checker = uspoof_open(&status); diff --git a/hphp/runtime/ext/ext_icu_uspoof.h b/hphp/runtime/ext/ext_icu_uspoof.h index 51675fa41..e2695e359 100644 --- a/hphp/runtime/ext/ext_icu_uspoof.h +++ b/hphp/runtime/ext/ext_icu_uspoof.h @@ -49,7 +49,7 @@ class c_SpoofChecker : public ExtObjectData { DECLARE_CLASS(SpoofChecker, SpoofChecker, ObjectData) // need to implement - public: c_SpoofChecker(VM::Class* cls = c_SpoofChecker::s_cls); + public: c_SpoofChecker(Class* cls = c_SpoofChecker::s_cls); public: ~c_SpoofChecker(); public: void t___construct(); public: bool t_issuspicious(CStrRef text, VRefParam issuesFound = uninit_null()); diff --git a/hphp/runtime/ext/ext_imagesprite.cpp b/hphp/runtime/ext/ext_imagesprite.cpp index 73d6c37fb..184674cb8 100644 --- a/hphp/runtime/ext/ext_imagesprite.cpp +++ b/hphp/runtime/ext/ext_imagesprite.cpp @@ -456,7 +456,7 @@ void ImageFromHTTP::completed() { // PHP accessible classes/functions -c_ImageSprite::c_ImageSprite(VM::Class* cb) : +c_ImageSprite::c_ImageSprite(Class* cb) : ExtObjectData(cb) { m_image_string_buffer = null_string; m_image = NULL; diff --git a/hphp/runtime/ext/ext_imagesprite.h b/hphp/runtime/ext/ext_imagesprite.h index 0dcd5bebf..0a612a73a 100644 --- a/hphp/runtime/ext/ext_imagesprite.h +++ b/hphp/runtime/ext/ext_imagesprite.h @@ -37,7 +37,7 @@ class c_ImageSprite : public ExtObjectData, public Sweepable { DECLARE_CLASS(ImageSprite, ImageSprite, ObjectData) // need to implement - public: c_ImageSprite(VM::Class* cls = c_ImageSprite::s_cls); + public: c_ImageSprite(Class* cls = c_ImageSprite::s_cls); public: ~c_ImageSprite(); public: void t___construct(); public: Object t_addfile(CStrRef file, CArrRef options = uninit_null()); diff --git a/hphp/runtime/ext/ext_intl.cpp b/hphp/runtime/ext/ext_intl.cpp index 9b26dc577..4dd471be4 100644 --- a/hphp/runtime/ext/ext_intl.cpp +++ b/hphp/runtime/ext/ext_intl.cpp @@ -88,7 +88,7 @@ const int64_t q_Collator$$UPPER_FIRST = UCOL_UPPER_FIRST; /////////////////////////////////////////////////////////////////////////////// -c_Collator::c_Collator(VM::Class* cb) : +c_Collator::c_Collator(Class* cb) : ExtObjectData(cb), m_locale(), m_ucoll(NULL), m_errcode() { } @@ -540,7 +540,7 @@ const int64_t q_Locale$$VALID_LOCALE = 1; /////////////////////////////////////////////////////////////////////////////// -c_Locale::c_Locale(VM::Class* cb) : ExtObjectData(cb) { +c_Locale::c_Locale(Class* cb) : ExtObjectData(cb) { } c_Locale::~c_Locale() { @@ -563,7 +563,7 @@ const int64_t q_Normalizer$$NFKC = UNORM_NFKC; /////////////////////////////////////////////////////////////////////////////// -c_Normalizer::c_Normalizer(VM::Class* cb) : ExtObjectData(cb) { +c_Normalizer::c_Normalizer(Class* cb) : ExtObjectData(cb) { } c_Normalizer::~c_Normalizer() { diff --git a/hphp/runtime/ext/ext_intl.h b/hphp/runtime/ext/ext_intl.h index e8565fa53..86dc49741 100644 --- a/hphp/runtime/ext/ext_intl.h +++ b/hphp/runtime/ext/ext_intl.h @@ -82,7 +82,7 @@ class c_Collator : public ExtObjectData, public Sweepable { DECLARE_CLASS(Collator, Collator, ObjectData) // need to implement - public: c_Collator(VM::Class* cls = c_Collator::s_cls); + public: c_Collator(Class* cls = c_Collator::s_cls); public: ~c_Collator(); public: void t___construct(CStrRef locale); public: bool t_asort(VRefParam arr, int64_t sort_flag = q_Collator$$SORT_REGULAR); @@ -115,7 +115,7 @@ class c_Locale : public ExtObjectData { DECLARE_CLASS(Locale, Locale, ObjectData) // need to implement - public: c_Locale(VM::Class* cls = c_Locale::s_cls); + public: c_Locale(Class* cls = c_Locale::s_cls); public: ~c_Locale(); public: void t___construct(); }; @@ -138,7 +138,7 @@ class c_Normalizer : public ExtObjectData, public Sweepable { DECLARE_CLASS(Normalizer, Normalizer, ObjectData) // need to implement - public: c_Normalizer(VM::Class* cls = c_Normalizer::s_cls); + public: c_Normalizer(Class* cls = c_Normalizer::s_cls); public: ~c_Normalizer(); public: void t___construct(); public: static Variant ti_isnormalized(CStrRef input, int64_t form = q_Normalizer$$FORM_C); diff --git a/hphp/runtime/ext/ext_memcache.cpp b/hphp/runtime/ext/ext_memcache.cpp index 4dcb982e6..decc88826 100644 --- a/hphp/runtime/ext/ext_memcache.cpp +++ b/hphp/runtime/ext/ext_memcache.cpp @@ -79,7 +79,7 @@ bool ini_on_update_hash_function(CStrRef value, void *p) { /////////////////////////////////////////////////////////////////////////////// // methods -c_Memcache::c_Memcache(VM::Class* cb) : +c_Memcache::c_Memcache(Class* cb) : ExtObjectData(cb), m_memcache(), m_compress_threshold(0), m_min_compress_savings(0.2) { memcached_create(&m_memcache); diff --git a/hphp/runtime/ext/ext_memcache.h b/hphp/runtime/ext/ext_memcache.h index b0a7e324c..56d91c2e7 100644 --- a/hphp/runtime/ext/ext_memcache.h +++ b/hphp/runtime/ext/ext_memcache.h @@ -55,7 +55,7 @@ class c_Memcache : public ExtObjectData, public Sweepable { DECLARE_CLASS(Memcache, Memcache, ObjectData) // need to implement - public: c_Memcache(VM::Class* cls = c_Memcache::s_cls); + public: c_Memcache(Class* cls = c_Memcache::s_cls); public: ~c_Memcache(); public: void t___construct(); public: bool t_connect(CStrRef host, int port = 0, int timeout = 0, int timeoutms = 0); diff --git a/hphp/runtime/ext/ext_memcached.cpp b/hphp/runtime/ext/ext_memcached.cpp index 39dc741be..62402e50a 100644 --- a/hphp/runtime/ext/ext_memcached.cpp +++ b/hphp/runtime/ext/ext_memcached.cpp @@ -179,7 +179,7 @@ public: } -c_Memcached::c_Memcached(VM::Class* cb) : +c_Memcached::c_Memcached(Class* cb) : ExtObjectData(cb) { } c_Memcached::~c_Memcached() { diff --git a/hphp/runtime/ext/ext_memcached.h b/hphp/runtime/ext/ext_memcached.h index 2cf5886a6..04884d908 100644 --- a/hphp/runtime/ext/ext_memcached.h +++ b/hphp/runtime/ext/ext_memcached.h @@ -91,7 +91,7 @@ class c_Memcached : public ExtObjectData, public Sweepable { DECLARE_CLASS(Memcached, Memcached, ObjectData) // need to implement - public: c_Memcached(VM::Class* cls = c_Memcached::s_cls); + public: c_Memcached(Class* cls = c_Memcached::s_cls); public: ~c_Memcached(); public: void t___construct(CStrRef persistent_id = null_string); public: bool t_add(CStrRef key, CVarRef value, int expiration = 0); diff --git a/hphp/runtime/ext/ext_misc.cpp b/hphp/runtime/ext/ext_misc.cpp index 04c6b6c64..168fe6809 100644 --- a/hphp/runtime/ext/ext_misc.cpp +++ b/hphp/runtime/ext/ext_misc.cpp @@ -32,7 +32,7 @@ namespace HPHP { -using VM::Transl::CallerFrame; +using Transl::CallerFrame; // Make sure "tokenizer" gets added to the list of extensions IMPLEMENT_DEFAULT_EXTENSION(tokenizer); @@ -54,8 +54,8 @@ int64_t f_connection_timeout() { return f_connection_status() == k_CONNECTION_TIMEOUT; } -static VM::Class* getClassByName(const char* name, int len) { - VM::Class* cls = nullptr; +static Class* getClassByName(const char* name, int len) { + Class* cls = nullptr; // translate "self" or "parent" if (len == 4 && !memcmp(name, "self", 4)) { cls = g_vmContext->getContextClass(); @@ -84,7 +84,7 @@ static VM::Class* getClassByName(const char* name, int len) { } } else { String className(name, len, CopyString); - cls = VM::Unit::loadClass(className.get()); + cls = Unit::loadClass(className.get()); } return cls; } @@ -98,7 +98,7 @@ Variant f_constant(CStrRef name) { // class constant int classNameLen = colon - data; char *constantName = colon + 2; - VM::Class* cls = getClassByName(data, classNameLen); + Class* cls = getClassByName(data, classNameLen); if (cls) { String cnsName(constantName, data + len - constantName, CopyString); TypedValue* tv = cls->clsCnsGet(cnsName.get()); @@ -109,7 +109,7 @@ Variant f_constant(CStrRef name) { raise_warning("Couldn't find constant %s", data); return uninit_null(); } else { - TypedValue* cns = VM::Unit::loadCns(name.get()); + TypedValue* cns = Unit::loadCns(name.get()); if (cns) return tvAsVariant(cns); return uninit_null(); } @@ -120,7 +120,7 @@ bool f_define(CStrRef name, CVarRef value, if (case_insensitive) { raise_warning(Strings::CONSTANTS_CASE_SENSITIVE); } - return VM::Unit::defCns(name.get(), value.getTypedAccessor()); + return Unit::defCns(name.get(), value.getTypedAccessor()); } bool f_defined(CStrRef name, bool autoload /* = true */) { @@ -132,7 +132,7 @@ bool f_defined(CStrRef name, bool autoload /* = true */) { // class constant int classNameLen = colon - data; char *constantName = colon + 2; - VM::Class* cls = getClassByName(data, classNameLen); + Class* cls = getClassByName(data, classNameLen); if (cls) { String cnsName(constantName, data + len - constantName, CopyString); return cls->clsCnsGet(cnsName.get()); @@ -140,8 +140,8 @@ bool f_defined(CStrRef name, bool autoload /* = true */) { return false; } else { return autoload ? - VM::Unit::loadCns(name.get()) : - VM::Unit::lookupCns(name.get()); + Unit::loadCns(name.get()) : + Unit::lookupCns(name.get()); } } @@ -159,7 +159,7 @@ Variant f_exit(CVarRef status /* = null_variant */) { Variant f_eval(CStrRef code_str) { String prefixedCode = concat("compileEvalString(prefixedCode.get()); + Unit* unit = g_vmContext->compileEvalString(prefixedCode.get()); TypedValue retVal; g_vmContext->invokeUnit(&retVal, unit); return tvAsVariant(&retVal); diff --git a/hphp/runtime/ext/ext_pdo.cpp b/hphp/runtime/ext/ext_pdo.cpp index ef6961c35..1429fe309 100644 --- a/hphp/runtime/ext/ext_pdo.cpp +++ b/hphp/runtime/ext/ext_pdo.cpp @@ -570,22 +570,22 @@ static Object pdo_stmt_instantiate(sp_PDOConnection dbh, CStrRef clsname, "constructor arguments must be passed as an array"); return Object(); } - VM::Class* cls = VM::Unit::loadClass(name.get()); + Class* cls = Unit::loadClass(name.get()); if (!cls) { return Object(); } - return HPHP::VM::Instance::newInstance(cls); + return HPHP::Instance::newInstance(cls); } static void pdo_stmt_construct(sp_PDOStatement stmt, Object object, CStrRef clsname, CVarRef ctor_args) { - VM::Class* cls = VM::Unit::loadClass(clsname.get()); + Class* cls = Unit::loadClass(clsname.get()); if (!cls) { return; } object->o_set("queryString", stmt->query_string); TypedValue ret; - VM::Instance* inst = static_cast(object.get()); + Instance* inst = static_cast(object.get()); inst->invokeUserMethod(&ret, cls->getCtor(), ctor_args.toArray()); tvRefcountedDecRef(&ret); } @@ -610,9 +610,9 @@ static bool valid_statement_class(sp_PDOConnection dbh, CVarRef opt, PDO_HANDLE_DBH_ERR(dbh); return false; } - HPHP::VM::Class* cls = HPHP::VM::Unit::loadClass(clsname.get()); + HPHP::Class* cls = HPHP::Unit::loadClass(clsname.get()); if (cls) { - const HPHP::VM::Func* method = cls->getDeclaredCtor(); + const HPHP::Func* method = cls->getDeclaredCtor(); if (method && method->isPublic()) { pdo_raise_impl_error (dbh, NULL, "HY000", @@ -731,9 +731,9 @@ static bool do_fetch_class_prepare(sp_PDOStatement stmt) { stmt->fetch.clsname = "stdclass"; } stmt->fetch.constructor = empty_string; //NULL; - HPHP::VM::Class* cls = HPHP::VM::Unit::loadClass(clsname.get()); + HPHP::Class* cls = HPHP::Unit::loadClass(clsname.get()); if (cls) { - const HPHP::VM::Func* method = cls->getDeclaredCtor(); + const HPHP::Func* method = cls->getDeclaredCtor(); if (method) { stmt->fetch.constructor = method->nameRef(); return true; @@ -913,7 +913,7 @@ IMPLEMENT_STATIC_REQUEST_LOCAL(PDORequestData, s_pdo_request_data); /////////////////////////////////////////////////////////////////////////////// // PDO -c_PDO::c_PDO(VM::Class* cb) : ExtObjectData(cb) { +c_PDO::c_PDO(Class* cb) : ExtObjectData(cb) { } c_PDO::~c_PDO() { @@ -2598,7 +2598,7 @@ clean_up: /////////////////////////////////////////////////////////////////////////////// // PDOStatement -c_PDOStatement::c_PDOStatement(VM::Class* cb) : +c_PDOStatement::c_PDOStatement(Class* cb) : ExtObjectData(cb), m_rowIndex(-1) { } diff --git a/hphp/runtime/ext/ext_pdo.h b/hphp/runtime/ext/ext_pdo.h index d1906d466..c8c472f60 100644 --- a/hphp/runtime/ext/ext_pdo.h +++ b/hphp/runtime/ext/ext_pdo.h @@ -117,7 +117,7 @@ class c_PDO : public ExtObjectData, public Sweepable { DECLARE_CLASS(PDO, PDO, ObjectData) // need to implement - public: c_PDO(VM::Class* cls = c_PDO::s_cls); + public: c_PDO(Class* cls = c_PDO::s_cls); public: ~c_PDO(); public: void t___construct(CStrRef dsn, CStrRef username = null_string, CStrRef password = null_string, CArrRef options = null_array); public: Variant t_prepare(CStrRef statement, CArrRef options = null_array); @@ -148,7 +148,7 @@ class c_PDOStatement : public ExtObjectData, public Sweepable { DECLARE_CLASS(PDOStatement, PDOStatement, ObjectData) // need to implement - public: c_PDOStatement(VM::Class* cls = c_PDOStatement::s_cls); + public: c_PDOStatement(Class* cls = c_PDOStatement::s_cls); public: ~c_PDOStatement(); public: void t___construct(); public: Variant t_execute(CArrRef params = null_array); diff --git a/hphp/runtime/ext/ext_process.cpp b/hphp/runtime/ext/ext_process.cpp index b5de4639c..466ea8098 100644 --- a/hphp/runtime/ext/ext_process.cpp +++ b/hphp/runtime/ext/ext_process.cpp @@ -114,7 +114,7 @@ void f_pcntl_exec(CStrRef path, CArrRef args /* = null_array */, if (RuntimeOption::WhitelistExec && !check_cmd(path.data())) { return; } - if (VM::Repo::prefork()) { + if (Repo::prefork()) { raise_error("execing is disallowed in multi-threaded mode"); return; } @@ -152,7 +152,7 @@ int64_t f_pcntl_fork() { raise_error("forking is disallowed in server mode"); return -1; } - if (VM::Repo::prefork()) { + if (Repo::prefork()) { raise_error("forking is disallowed in multi-threaded mode"); return -1; } @@ -160,7 +160,7 @@ int64_t f_pcntl_fork() { std::cout.flush(); std::cerr.flush(); pid_t pid = fork(); - VM::Repo::postfork(pid); + Repo::postfork(pid); return pid; } diff --git a/hphp/runtime/ext/ext_reflection.cpp b/hphp/runtime/ext/ext_reflection.cpp index cdae28fa6..a553aa702 100644 --- a/hphp/runtime/ext/ext_reflection.cpp +++ b/hphp/runtime/ext/ext_reflection.cpp @@ -27,7 +27,7 @@ namespace HPHP { -using VM::Transl::VMRegAnchor; +using Transl::VMRegAnchor; IMPLEMENT_DEFAULT_EXTENSION(Reflection); /////////////////////////////////////////////////////////////////////////////// @@ -85,13 +85,13 @@ static StaticString s_closureobj("closureobj"); static StaticString s_return_type("return_type"); static StaticString s_type_hint("type_hint"); -static const VM::Class* get_cls(CVarRef class_or_object) { - VM::Class* cls = NULL; +static const Class* get_cls(CVarRef class_or_object) { + Class* cls = NULL; if (class_or_object.is(KindOfObject)) { ObjectData* obj = class_or_object.toCObjRef().get(); cls = obj->getVMClass(); } else { - cls = VM::Unit::loadClass(class_or_object.toString().get()); + cls = Unit::loadClass(class_or_object.toString().get()); } return cls; } @@ -202,7 +202,7 @@ static void set_property_info(Array &ret, ClassInfo::PropertyInfo *info, } -static void set_instance_prop_info(Array &ret, const VM::Class::Prop* prop) { +static void set_instance_prop_info(Array &ret, const Class::Prop* prop) { ret.set(s_name, VarNR(prop->m_name)); set_attrs(ret, get_modifiers(prop->m_attrs, false) & ~0x66); ret.set(s_class, VarNR(prop->m_class->name())); @@ -214,7 +214,7 @@ static void set_instance_prop_info(Array &ret, const VM::Class::Prop* prop) { } } -static void set_static_prop_info(Array &ret, const VM::Class::SProp* prop) { +static void set_static_prop_info(Array &ret, const Class::SProp* prop) { ret.set(s_name, VarNR(prop->m_name)); set_attrs(ret, get_modifiers(prop->m_attrs, false) & ~0x66); ret.set(s_class, VarNR(prop->m_class->name())); @@ -322,7 +322,7 @@ static void set_function_info(Array &ret, const ClassInfo::MethodInfo *info, } } -static void set_function_info(Array &ret, const VM::Func* func) { +static void set_function_info(Array &ret, const Func* func) { // return type if (func->attrs() & AttrReference) { ret.set(s_ref, true_varNR); @@ -341,10 +341,10 @@ static void set_function_info(Array &ret, const VM::Func* func) { // parameters { Array arr = Array::Create(); - const VM::Func::ParamInfoVec& params = func->params(); + const Func::ParamInfoVec& params = func->params(); for (int i = 0; i < func->numParams(); i++) { Array param = Array::Create(); - const VM::Func::ParamInfo& fpi = params[i]; + const Func::ParamInfo& fpi = params[i]; param.set(s_index, VarNR((int)i)); VarNR name(func->localNames()[i]); @@ -400,9 +400,9 @@ static void set_function_info(Array &ret, const VM::Func* func) { // static variables { Array arr = Array::Create(); - const VM::Func::SVInfoVec& staticVars = func->staticVars(); + const Func::SVInfoVec& staticVars = func->staticVars(); for (unsigned int i = 0; i < staticVars.size(); i++) { - const VM::Func::SVInfo &sv = staticVars[i]; + const Func::SVInfo &sv = staticVars[i]; arr.set(VarNR(sv.name), VarNR(sv.phpCode)); } ret.set(s_static_variables, VarNR(arr)); @@ -411,7 +411,7 @@ static void set_function_info(Array &ret, const VM::Func* func) { // user attributes { Array arr = Array::Create(); - VM::Func::UserAttributeMap::const_iterator it; + Func::UserAttributeMap::const_iterator it; for (it = func->userAttributes().begin(); it != func->userAttributes().end(); ++it) { arr.set(String(const_cast(it->first)), @@ -440,8 +440,8 @@ static void set_method_info(Array &ret, ClassInfo::MethodInfo *info, set_source_info(ret, info->file, info->line1, info->line2); } -static bool isConstructor(const VM::Func* func) { - VM::PreClass* pcls = func->preClass(); +static bool isConstructor(const Func* func) { + PreClass* pcls = func->preClass(); if (!pcls) return false; if (func->cls()) return func == func->cls()->getCtor(); /* A same named function is not a constructor in a trait, @@ -451,7 +451,7 @@ static bool isConstructor(const VM::Func* func) { return pcls->name()->isame(func->name()); } -static void set_method_info(Array &ret, const VM::Func* func) { +static void set_method_info(Array &ret, const Func* func) { ret.set(s_name, VarNR(func->nameRef())); set_attrs(ret, get_modifiers(func->attrs(), false)); @@ -480,7 +480,7 @@ static Array get_method_info(const ClassInfo *cls, CVarRef name) { } Array f_hphp_get_method_info(CVarRef cls, CVarRef name) { - const VM::Class* c = get_cls(cls); + const Class* c = get_cls(cls); if (!c) return Array(); if (c->clsInfo()) { /* @@ -490,10 +490,10 @@ Array f_hphp_get_method_info(CVarRef cls, CVarRef name) { return get_method_info(c->clsInfo(), name); } CStrRef method_name = name.toString(); - const VM::Func* func = c->lookupMethod(method_name.get()); + const Func* func = c->lookupMethod(method_name.get()); if (!func) { if (c->attrs() & AttrAbstract) { - VM::ClassSet::const_iterator it = c->allInterfaces().begin(), + ClassSet::const_iterator it = c->allInterfaces().begin(), end = c->allInterfaces().end(); while (it != end) { func = (*it)->lookupMethod(method_name.get()); @@ -668,7 +668,7 @@ static Array get_class_info(const ClassInfo *cls) { } Array f_hphp_get_class_info(CVarRef name) { - const VM::Class* cls = get_cls(name); + const Class* cls = get_cls(name); if (!cls) return Array(); if (cls->clsInfo()) { /* @@ -683,7 +683,7 @@ Array f_hphp_get_class_info(CVarRef name) { ret.set(s_extension, empty_string); ret.set(s_parent, cls->parentRef()); - typedef vector ClassVec; + typedef vector ClassVec; // interfaces { Array arr = Array::Create(); @@ -709,7 +709,7 @@ Array f_hphp_get_class_info(CVarRef name) { // trait aliases { Array arr = Array::Create(); - const VM::Class::TraitAliasVec& aliases = cls->traitAliases(); + const Class::TraitAliasVec& aliases = cls->traitAliases(); for (int i = 0, s = aliases.size(); i < s; ++i) { arr.set(*(String*)&aliases[i].first, VarNR(aliases[i].second)); } @@ -743,21 +743,21 @@ Array f_hphp_get_class_info(CVarRef name) { // methods { Array arr = Array::Create(); - VM::Func* const* methods = cls->preClass()->methods(); + Func* const* methods = cls->preClass()->methods(); size_t const numMethods = cls->preClass()->numMethods(); for (Slot i = 0; i < numMethods; ++i) { - const VM::Func* m = methods[i]; + const Func* m = methods[i]; if (isdigit(m->name()->data()[0])) continue; Array info = Array::Create(); set_method_info(info, m); arr.set(StringUtil::ToLower(m->nameRef()), VarNR(info)); } - VM::Func* const* clsMethods = cls->methods(); + Func* const* clsMethods = cls->methods(); for (Slot i = cls->traitsBeginIdx(); i < cls->traitsEndIdx(); ++i) { - const VM::Func* m = clsMethods[i]; + const Func* m = clsMethods[i]; if (isdigit(m->name()->data()[0])) continue; Array info = Array::Create(); set_method_info(info, m); @@ -771,11 +771,11 @@ Array f_hphp_get_class_info(CVarRef name) { Array arr = Array::Create(); Array arrPriv = Array::Create(); - const VM::Class::Prop* properties = cls->declProperties(); + const Class::Prop* properties = cls->declProperties(); const size_t nProps = cls->numDeclProperties(); for (Slot i = 0; i < nProps; ++i) { - const VM::Class::Prop& prop = properties[i]; + const Class::Prop& prop = properties[i]; Array info = Array::Create(); if ((prop.m_attrs & AttrPrivate) == AttrPrivate) { if (prop.m_class == cls) { @@ -788,11 +788,11 @@ Array f_hphp_get_class_info(CVarRef name) { arr.set(*(String*)(&prop.m_name), VarNR(info)); } - const VM::Class::SProp* staticProperties = cls->staticProperties(); + const Class::SProp* staticProperties = cls->staticProperties(); const size_t nSProps = cls->numStaticProperties(); for (Slot i = 0; i < nSProps; ++i) { - const VM::Class::SProp& prop = staticProperties[i]; + const Class::SProp& prop = staticProperties[i]; Array info = Array::Create(); if ((prop.m_attrs & AttrPrivate) == AttrPrivate) { if (prop.m_class == cls) { @@ -814,7 +814,7 @@ Array f_hphp_get_class_info(CVarRef name) { Array arr = Array::Create(); size_t numConsts = cls->numConstants(); - const VM::Class::Const* consts = cls->constants(); + const Class::Const* consts = cls->constants(); for (size_t i = 0; i < numConsts; i++) { // Note: hphpc doesn't include inherited constants in @@ -829,7 +829,7 @@ Array f_hphp_get_class_info(CVarRef name) { } { // source info - const VM::PreClass* pcls = cls->preClass(); + const PreClass* pcls = cls->preClass(); set_source_info(ret, pcls->unit()->filepath()->data(), pcls->line1(), pcls->line2()); set_doc_comment(ret, pcls->docComment()); @@ -838,8 +838,8 @@ Array f_hphp_get_class_info(CVarRef name) { // user attributes { Array arr = Array::Create(); - const VM::PreClass* pcls = cls->preClass(); - VM::PreClass::UserAttributeMap::const_iterator it; + const PreClass* pcls = cls->preClass(); + PreClass::UserAttributeMap::const_iterator it; for (it = pcls->userAttributes().begin(); it != pcls->userAttributes().end(); ++it) { arr.set(String(const_cast(it->first)), @@ -853,7 +853,7 @@ Array f_hphp_get_class_info(CVarRef name) { Array f_hphp_get_function_info(CStrRef name) { Array ret; - const VM::Func* func = VM::Unit::loadFunc(name.get()); + const Func* func = Unit::loadFunc(name.get()); if (!func) return ret; ret.set(s_name, VarNR(func->name())); ret.set(s_closure, empty_string); @@ -900,7 +900,7 @@ void f_hphp_set_property(CObjRef obj, CStrRef cls, CStrRef prop, } Variant f_hphp_get_static_property(CStrRef cls, CStrRef prop) { - VM::Class* class_ = VM::Unit::lookupClass(cls.get()); + Class* class_ = Unit::lookupClass(cls.get()); if (class_ == NULL) { raise_error("Non-existent class %s", cls.get()->data()); } @@ -921,7 +921,7 @@ Variant f_hphp_get_static_property(CStrRef cls, CStrRef prop) { } void f_hphp_set_static_property(CStrRef cls, CStrRef prop, CVarRef value) { - VM::Class* class_ = VM::Unit::lookupClass(cls.get()); + Class* class_ = Unit::lookupClass(cls.get()); if (class_ == NULL) { raise_error("Non-existent class %s", cls.get()->data()); } @@ -942,7 +942,7 @@ void f_hphp_set_static_property(CStrRef cls, CStrRef prop, CVarRef value) { } String f_hphp_get_original_class_name(CStrRef name) { - VM::Class* cls = VM::Unit::loadClass(name.get()); + Class* cls = Unit::loadClass(name.get()); if (!cls) return empty_string; return cls->nameRef(); } diff --git a/hphp/runtime/ext/ext_simplexml.cpp b/hphp/runtime/ext/ext_simplexml.cpp index 5de33f1f1..71813b750 100644 --- a/hphp/runtime/ext/ext_simplexml.cpp +++ b/hphp/runtime/ext/ext_simplexml.cpp @@ -246,9 +246,9 @@ Variant f_simplexml_load_string(CStrRef data, return uninit_null(); } - VM::Class* cls; + Class* cls; if (!class_name.empty()) { - cls = VM::Unit::lookupClass(class_name.get()); + cls = Unit::lookupClass(class_name.get()); if (!cls) { throw_invalid_argument("class not found: %s", class_name.data()); return uninit_null(); @@ -285,7 +285,7 @@ Variant f_simplexml_load_file(CStrRef filename, /////////////////////////////////////////////////////////////////////////////// // SimpleXMLElement -c_SimpleXMLElement::c_SimpleXMLElement(VM::Class* cb) : +c_SimpleXMLElement::c_SimpleXMLElement(Class* cb) : ExtObjectDataFlagsm_type == SOAP_OBJECT || server->m_type == SOAP_CLASS) { cls = server->m_soap_object->getVMClass(); } else if (server->m_soap_functions.functions_all) { @@ -2044,7 +2044,7 @@ static bool valid_function(c_SoapServer *server, Object &soap_obj, } else if (!server->m_soap_functions.ft.empty()) { return server->m_soap_functions.ft.exists(StringUtil::ToLower(fn_name)); } - HPHP::VM::Func* f = cls->lookupMethod(fn_name.get()); + HPHP::Func* f = cls->lookupMethod(fn_name.get()); return (f && f->isPublic()); } @@ -2297,7 +2297,7 @@ void c_SoapServer::t_addsoapheader(CObjRef fault) { /////////////////////////////////////////////////////////////////////////////// // class SoapClient -c_SoapClient::c_SoapClient(VM::Class* cb) : +c_SoapClient::c_SoapClient(Class* cb) : ExtObjectDataFlags(cb), m_soap_version(SOAP_1_1), m_sdl(NULL), @@ -2773,7 +2773,7 @@ bool c_SoapClient::t___setsoapheaders(CVarRef headers /* = null_variant */) { /////////////////////////////////////////////////////////////////////////////// // class SoapVar -c_SoapVar::c_SoapVar(VM::Class* cb) : ExtObjectData(cb) { +c_SoapVar::c_SoapVar(Class* cb) : ExtObjectData(cb) { } c_SoapVar::~c_SoapVar() { @@ -2808,7 +2808,7 @@ void c_SoapVar::t___construct(CVarRef data, CVarRef type, /////////////////////////////////////////////////////////////////////////////// // class SoapParam -c_SoapParam::c_SoapParam(VM::Class* cb) : ExtObjectData(cb) { +c_SoapParam::c_SoapParam(Class* cb) : ExtObjectData(cb) { } c_SoapParam::~c_SoapParam() { @@ -2826,7 +2826,7 @@ void c_SoapParam::t___construct(CVarRef data, CStrRef name) { /////////////////////////////////////////////////////////////////////////////// // class SoapHeader -c_SoapHeader::c_SoapHeader(VM::Class* cb) : +c_SoapHeader::c_SoapHeader(Class* cb) : ExtObjectData(cb) { } diff --git a/hphp/runtime/ext/ext_soap.h b/hphp/runtime/ext/ext_soap.h index 2af4b774e..f3827151a 100644 --- a/hphp/runtime/ext/ext_soap.h +++ b/hphp/runtime/ext/ext_soap.h @@ -38,7 +38,7 @@ class c_SoapServer : public ExtObjectData { DECLARE_CLASS(SoapServer, SoapServer, ObjectData) // need to implement - public: c_SoapServer(VM::Class* cls = c_SoapServer::s_cls); + public: c_SoapServer(Class* cls = c_SoapServer::s_cls); public: ~c_SoapServer(); public: void t___construct(CVarRef wsdl, CArrRef options = null_array); public: void t_setclass(int _argc, CStrRef name, CArrRef _argv = null_array); @@ -77,7 +77,7 @@ class c_SoapClient : public ExtObjectDataFlags { DECLARE_CLASS(SoapClient, SoapClient, ObjectData) // need to implement - public: c_SoapClient(VM::Class* cls = c_SoapClient::s_cls); + public: c_SoapClient(Class* cls = c_SoapClient::s_cls); public: ~c_SoapClient(); public: void t___construct(CVarRef wsdl, CArrRef options = null_array); public: Variant t___call(Variant name, Variant args); @@ -140,7 +140,7 @@ class c_SoapVar : public ExtObjectData { DECLARE_CLASS(SoapVar, SoapVar, ObjectData) // need to implement - public: c_SoapVar(VM::Class* cls = c_SoapVar::s_cls); + public: c_SoapVar(Class* cls = c_SoapVar::s_cls); public: ~c_SoapVar(); public: void t___construct(CVarRef data, CVarRef type, CStrRef type_name = null_string, CStrRef type_namespace = null_string, CStrRef node_name = null_string, CStrRef node_namespace = null_string); @@ -163,7 +163,7 @@ class c_SoapParam : public ExtObjectData { DECLARE_CLASS(SoapParam, SoapParam, ObjectData) // need to implement - public: c_SoapParam(VM::Class* cls = c_SoapParam::s_cls); + public: c_SoapParam(Class* cls = c_SoapParam::s_cls); public: ~c_SoapParam(); public: void t___construct(CVarRef data, CStrRef name); @@ -182,7 +182,7 @@ class c_SoapHeader : public ExtObjectData { DECLARE_CLASS(SoapHeader, SoapHeader, ObjectData) // need to implement - public: c_SoapHeader(VM::Class* cls = c_SoapHeader::s_cls); + public: c_SoapHeader(Class* cls = c_SoapHeader::s_cls); public: ~c_SoapHeader(); public: void t___construct(CStrRef ns, CStrRef name, CVarRef data = uninit_null(), bool mustunderstand = false, CVarRef actor = uninit_null()); diff --git a/hphp/runtime/ext/ext_spl.cpp b/hphp/runtime/ext/ext_spl.cpp index 1642dcc71..ac78e0959 100644 --- a/hphp/runtime/ext/ext_spl.cpp +++ b/hphp/runtime/ext/ext_spl.cpp @@ -140,9 +140,9 @@ Variant f_hphp_get_this() { } Variant f_class_implements(CVarRef obj, bool autoload /* = true */) { - VM::Class* cls; + Class* cls; if (obj.isString()) { - cls = VM::Unit::getClass(obj.getStringData(), autoload); + cls = Unit::getClass(obj.getStringData(), autoload); if (!cls) { return false; } @@ -162,9 +162,9 @@ Variant f_class_implements(CVarRef obj, bool autoload /* = true */) { } Variant f_class_parents(CVarRef obj, bool autoload /* = true */) { - VM::Class* cls; + Class* cls; if (obj.isString()) { - cls = VM::Unit::getClass(obj.getStringData(), autoload); + cls = Unit::getClass(obj.getStringData(), autoload); if (!cls) { return false; } @@ -182,9 +182,9 @@ Variant f_class_parents(CVarRef obj, bool autoload /* = true */) { } Variant f_class_uses(CVarRef obj, bool autoload /* = true */) { - VM::Class* cls; + Class* cls; if (obj.isString()) { - cls = VM::Unit::getClass(obj.getStringData(), autoload); + cls = Unit::getClass(obj.getStringData(), autoload); if (!cls) { return false; } diff --git a/hphp/runtime/ext/ext_sqlite3.cpp b/hphp/runtime/ext/ext_sqlite3.cpp index 0539358dd..f55eb282c 100644 --- a/hphp/runtime/ext/ext_sqlite3.cpp +++ b/hphp/runtime/ext/ext_sqlite3.cpp @@ -162,7 +162,7 @@ static void php_sqlite3_callback_final(sqlite3_context *context) { /////////////////////////////////////////////////////////////////////////////// // sqlite3 -c_SQLite3::c_SQLite3(VM::Class* cb) : +c_SQLite3::c_SQLite3(Class* cb) : ExtObjectData(cb), m_raw_db(NULL) { } @@ -432,7 +432,7 @@ bool c_SQLite3::t_openblob(CStrRef table, CStrRef column, int64_t rowid, /////////////////////////////////////////////////////////////////////////////// -c_SQLite3Stmt::c_SQLite3Stmt(VM::Class* cb) : +c_SQLite3Stmt::c_SQLite3Stmt(Class* cb) : ExtObjectData(cb), m_raw_stmt(NULL) { } @@ -600,7 +600,7 @@ Variant c_SQLite3Stmt::t_execute() { /////////////////////////////////////////////////////////////////////////////// -c_SQLite3Result::c_SQLite3Result(VM::Class* cb) : +c_SQLite3Result::c_SQLite3Result(Class* cb) : ExtObjectData(cb) { } diff --git a/hphp/runtime/ext/ext_sqlite3.h b/hphp/runtime/ext/ext_sqlite3.h index 7b40ab33b..b1a8a2c3b 100644 --- a/hphp/runtime/ext/ext_sqlite3.h +++ b/hphp/runtime/ext/ext_sqlite3.h @@ -46,7 +46,7 @@ class c_SQLite3 : public ExtObjectData { DECLARE_CLASS(SQLite3, SQLite3, ObjectData) // need to implement - public: c_SQLite3(VM::Class* cls = c_SQLite3::s_cls); + public: c_SQLite3(Class* cls = c_SQLite3::s_cls); public: ~c_SQLite3(); public: void t___construct(CStrRef filename, int64_t flags = k_SQLITE3_OPEN_READWRITE|k_SQLITE3_OPEN_CREATE, CStrRef encryption_key = null_string); public: void t_open(CStrRef filename, int64_t flags = k_SQLITE3_OPEN_READWRITE|k_SQLITE3_OPEN_CREATE, CStrRef encryption_key = null_string); @@ -89,7 +89,7 @@ class c_SQLite3Stmt : public ExtObjectData { DECLARE_CLASS(SQLite3Stmt, SQLite3Stmt, ObjectData) // need to implement - public: c_SQLite3Stmt(VM::Class* cls = c_SQLite3Stmt::s_cls); + public: c_SQLite3Stmt(Class* cls = c_SQLite3Stmt::s_cls); public: ~c_SQLite3Stmt(); public: void t___construct(CObjRef dbobject, CStrRef statement); public: int64_t t_paramcount(); @@ -123,7 +123,7 @@ class c_SQLite3Result : public ExtObjectData { DECLARE_CLASS(SQLite3Result, SQLite3Result, ObjectData) // need to implement - public: c_SQLite3Result(VM::Class* cls = c_SQLite3Result::s_cls); + public: c_SQLite3Result(Class* cls = c_SQLite3Result::s_cls); public: ~c_SQLite3Result(); public: void t___construct(); public: int64_t t_numcolumns(); diff --git a/hphp/runtime/ext/ext_xmlreader.cpp b/hphp/runtime/ext/ext_xmlreader.cpp index cfa2c2a87..3e5dfe9c3 100644 --- a/hphp/runtime/ext/ext_xmlreader.cpp +++ b/hphp/runtime/ext/ext_xmlreader.cpp @@ -121,7 +121,7 @@ static xmlRelaxNGPtr _xmlreader_get_relaxNG(String source, int type, } /////////////////////////////////////////////////////////////////////////////// -c_XMLReader::c_XMLReader(VM::Class* cb) : +c_XMLReader::c_XMLReader(Class* cb) : ExtObjectDataFlags(cb), m_ptr(NULL), m_input(NULL), m_schema(NULL) { } diff --git a/hphp/runtime/ext/ext_xmlreader.h b/hphp/runtime/ext/ext_xmlreader.h index b172b2c87..707685e44 100644 --- a/hphp/runtime/ext/ext_xmlreader.h +++ b/hphp/runtime/ext/ext_xmlreader.h @@ -65,7 +65,7 @@ class c_XMLReader : public ExtObjectDataFlags, public Sweepa DECLARE_CLASS(XMLReader, XMLReader, ObjectData) // need to implement - public: c_XMLReader(VM::Class* cls = c_XMLReader::s_cls); + public: c_XMLReader(Class* cls = c_XMLReader::s_cls); public: ~c_XMLReader(); public: void t___construct(); public: bool t_open(CStrRef uri, CStrRef encoding = null_string, int64_t options = 0); diff --git a/hphp/runtime/ext/ext_xmlwriter.cpp b/hphp/runtime/ext/ext_xmlwriter.cpp index 8a535cda9..3468c3ba8 100644 --- a/hphp/runtime/ext/ext_xmlwriter.cpp +++ b/hphp/runtime/ext/ext_xmlwriter.cpp @@ -282,7 +282,7 @@ static xmlChar *xmls(CStrRef s) { /////////////////////////////////////////////////////////////////////////////// -c_XMLWriter::c_XMLWriter(VM::Class* cb) : +c_XMLWriter::c_XMLWriter(Class* cb) : ExtObjectData(cb), m_ptr(NULL), m_output(NULL), m_uri_output(NULL) { } diff --git a/hphp/runtime/ext/ext_xmlwriter.h b/hphp/runtime/ext/ext_xmlwriter.h index 05157e161..de337b21f 100644 --- a/hphp/runtime/ext/ext_xmlwriter.h +++ b/hphp/runtime/ext/ext_xmlwriter.h @@ -80,7 +80,7 @@ class c_XMLWriter : public ExtObjectData, public Sweepable { DECLARE_CLASS(XMLWriter, XMLWriter, ObjectData) // need to implement - public: c_XMLWriter(VM::Class* cls = c_XMLWriter::s_cls); + public: c_XMLWriter(Class* cls = c_XMLWriter::s_cls); public: ~c_XMLWriter(); public: void t___construct(); public: bool t_openmemory(); diff --git a/hphp/runtime/ext_hhvm/ext_hhvm.h b/hphp/runtime/ext_hhvm/ext_hhvm.h index 042109301..0f48c162d 100644 --- a/hphp/runtime/ext_hhvm/ext_hhvm.h +++ b/hphp/runtime/ext_hhvm/ext_hhvm.h @@ -24,9 +24,8 @@ namespace HPHP { struct ActRec; -namespace VM { class Instance; -}; +; struct HhbcExtFuncInfo { const char* m_name; @@ -41,11 +40,11 @@ struct HhbcExtMethodInfo { struct HhbcExtClassInfo { const char* m_name; - HPHP::VM::Instance* (*m_InstanceCtor)(HPHP::VM::Class*); + HPHP::Instance* (*m_InstanceCtor)(HPHP::Class*); int m_sizeof; long long m_methodCount; const HhbcExtMethodInfo* m_methods; - HPHP::VM::Class** m_clsPtr; + HPHP::Class** m_clsPtr; }; extern const long long hhbc_ext_funcs_count; diff --git a/hphp/runtime/vm/as.cpp b/hphp/runtime/vm/as.cpp index d8681ba6f..fd3e71174 100644 --- a/hphp/runtime/vm/as.cpp +++ b/hphp/runtime/vm/as.cpp @@ -93,7 +93,7 @@ TRACE_SET_MOD(hhas); -namespace HPHP { namespace VM { +namespace HPHP { ////////////////////////////////////////////////////////////////////// @@ -1852,4 +1852,4 @@ Unit* assemble_file(const char* filename, const MD5& md5) { ////////////////////////////////////////////////////////////////////// -}} +} diff --git a/hphp/runtime/vm/as.h b/hphp/runtime/vm/as.h index 38fbadc25..4d94fc232 100644 --- a/hphp/runtime/vm/as.h +++ b/hphp/runtime/vm/as.h @@ -19,7 +19,7 @@ #include -namespace HPHP { namespace VM { +namespace HPHP { class Unit; @@ -34,6 +34,6 @@ Unit* assemble_file(const char* filename, const MD5&); ////////////////////////////////////////////////////////////////////// -}} +} #endif diff --git a/hphp/runtime/vm/backup_gc.cpp b/hphp/runtime/vm/backup_gc.cpp index 7e6848665..2edf1b62f 100644 --- a/hphp/runtime/vm/backup_gc.cpp +++ b/hphp/runtime/vm/backup_gc.cpp @@ -31,7 +31,7 @@ #include "runtime/base/array/hphp_array.h" #include "runtime/vm/class.h" -namespace HPHP { namespace VM { +namespace HPHP { static const Trace::Module TRACEMOD = Trace::gc; @@ -250,7 +250,7 @@ void traceImpl(const Visitor& visit, ObjectData* obj) { } // Declared properties. We need to indirect through the TypedValue - // before visiting, since these are in-situ in the VM::Instance. + // before visiting, since these are in-situ in the Instance. void* vpObj = obj; unsigned char* address = static_cast(vpObj); @@ -604,5 +604,5 @@ void gc_detect_cycles(const std::string& filename) { ////////////////////////////////////////////////////////////////////// -}} +} diff --git a/hphp/runtime/vm/backup_gc.h b/hphp/runtime/vm/backup_gc.h index 44300ba6c..39f67d8b6 100644 --- a/hphp/runtime/vm/backup_gc.h +++ b/hphp/runtime/vm/backup_gc.h @@ -18,7 +18,7 @@ #include -namespace HPHP { namespace VM { +namespace HPHP { ////////////////////////////////////////////////////////////////////// @@ -41,6 +41,6 @@ void gc_detect_cycles(const std::string& filename); ////////////////////////////////////////////////////////////////////// -}} +} #endif diff --git a/hphp/runtime/vm/blob_helper.h b/hphp/runtime/vm/blob_helper.h index e662193dc..85d3a85ab 100644 --- a/hphp/runtime/vm/blob_helper.h +++ b/hphp/runtime/vm/blob_helper.h @@ -58,7 +58,7 @@ * code implement both serialization and deserialization. */ -namespace HPHP { namespace VM { +namespace HPHP { ////////////////////////////////////////////////////////////////////// @@ -314,6 +314,6 @@ private: ////////////////////////////////////////////////////////////////////// -}} +} #endif diff --git a/hphp/runtime/vm/bytecode.cpp b/hphp/runtime/vm/bytecode.cpp index b1808f261..3774147e2 100644 --- a/hphp/runtime/vm/bytecode.cpp +++ b/hphp/runtime/vm/bytecode.cpp @@ -84,13 +84,7 @@ bool RuntimeOption::RepoAuthoritative = false; using std::string; -using VM::Transl::tx64; -using VM::Unit; -using VM::Class; -using VM::Func; -using VM::FPIEnt; -using VM::EHEnt; -using VM::NameValueTable; +using Transl::tx64; #if DEBUG #define OPTBLD_INLINE @@ -226,7 +220,7 @@ VarEnv::VarEnv() TypedValue globalArray; globalArray.m_type = KindOfArray; globalArray.m_data.parr = - new (request_arena()) VM::GlobalNameValueTableWrapper(&*m_nvTable); + new (request_arena()) GlobalNameValueTableWrapper(&*m_nvTable); globalArray.m_data.parr->incRefCount(); m_nvTable->set(StringData::GetStaticString("GLOBALS"), &globalArray); tvRefcountedDecRef(&globalArray); @@ -936,7 +930,7 @@ UnwindStatus Stack::unwindFrag(ActRec* fp, int offset, const bool unwindingGeneratorFrame = func->isGenerator(); auto const curOp = *reinterpret_cast(pc); - using namespace VM; + using namespace HPHP; const bool unwindingReturningFrame = curOp == OpRetC || curOp == OpRetV; TypedValue* evalTop; if (UNLIKELY(unwindingGeneratorFrame)) { @@ -1187,7 +1181,7 @@ __thread VarEnvArenaStorage s_varEnvArenaStorage; //============================================================================= // ExecutionContext. -using namespace HPHP::VM; +using namespace HPHP; using namespace HPHP::MethodLookup; ActRec* VMExecutionContext::getOuterVMFrame(const ActRec* ar) { @@ -1569,7 +1563,7 @@ void VMExecutionContext::newPreConst(StringData* name, name->incRefCount(); PreConst pc = { val, this, name }; m_preConsts.push_back(pc); - VM::Transl::mergePreConst(m_preConsts.back()); + Transl::mergePreConst(m_preConsts.back()); } bool VMExecutionContext::renameFunction(const StringData* oldName, @@ -2764,7 +2758,7 @@ Unit* VMExecutionContext::evalInclude(StringData* path, return nullptr; } -HPHP::VM::Unit* VMExecutionContext::evalIncludeRoot( +HPHP::Unit* VMExecutionContext::evalIncludeRoot( StringData* path, InclOpFlags flags, bool* initial) { HPHP::Eval::PhpFile* efile = lookupIncludeRoot(path, flags, initial); return efile ? efile->unit() : 0; @@ -2825,7 +2819,7 @@ bool VMExecutionContext::evalUnit(Unit* unit, bool local, ActRec* ar = m_stack.allocA(); assert((uintptr_t)&ar->m_func < (uintptr_t)&ar->m_r); - VM::Class* cls = curClass(); + Class* cls = curClass(); if (local) { cls = nullptr; ar->setThis(nullptr); @@ -2876,7 +2870,7 @@ CVarRef VMExecutionContext::getEvaledArg(const StringData* val) { if (&arg != &null_variant) return arg; } String code = HPHP::concat3(" EvaledUnitsMap; static EvaledUnitsMap s_evaledUnits; @@ -5828,7 +5822,7 @@ inline void OPTBLD_INLINE VMExecutionContext::doFPushCuf(PC& pc, TypedValue func = m_stack.topTV()[safe]; ObjectData* obj = nullptr; - HPHP::VM::Class* cls = nullptr; + HPHP::Class* cls = nullptr; StringData* invName = nullptr; const Func* f = vm_decode_function(tvAsVariant(&func), getFP(), diff --git a/hphp/runtime/vm/bytecode.h b/hphp/runtime/vm/bytecode.h index a9bb09d07..8269275d3 100644 --- a/hphp/runtime/vm/bytecode.h +++ b/hphp/runtime/vm/bytecode.h @@ -55,7 +55,7 @@ namespace HPHP { } \ } while (0) -namespace VM { class Func; } + class Func; class ActRec; // max number of arguments for direct call to builtin @@ -129,7 +129,7 @@ class VarEnv { // TinyVector<> for now increased icache misses, but maybe will be // feasable later (see D511561). std::vector m_restoreLocations; - boost::optional m_nvTable; + boost::optional m_nvTable; private: explicit VarEnv(); @@ -228,7 +228,7 @@ struct ActRec { union { TypedValue _dummyB; struct { - const VM::Func* m_func; // Function. + const Func* m_func; // Function. uint32_t m_soff; // Saved offset of caller from beginning of // caller's Func's bytecode. @@ -243,7 +243,7 @@ struct ActRec { struct { union { ObjectData* m_this; // This. - VM::Class* m_cls; // Late bound class. + Class* m_cls; // Late bound class. }; union { VarEnv* m_varEnv; // Variable environment; only used when the @@ -292,20 +292,20 @@ struct ActRec { initNumArgs(numArgs, isFromFPushCtor()); } - static void* encodeThis(ObjectData* obj, VM::Class* cls) { + static void* encodeThis(ObjectData* obj, Class* cls) { if (obj) return obj; if (cls) return (char*)cls + 1; } static void* encodeThis(ObjectData* obj) { return obj; } - static void* encodeClass(const VM::Class* cls) { + static void* encodeClass(const Class* cls) { return cls ? (char*)cls + 1 : nullptr; } static ObjectData* decodeThis(void* p) { return uintptr_t(p) & 1 ? nullptr : (ObjectData*)p; } - static VM::Class* decodeClass(void* p) { - return uintptr_t(p) & 1 ? (VM::Class*)(uintptr_t(p)&~1LL) : nullptr; + static Class* decodeClass(void* p) { + return uintptr_t(p) & 1 ? (Class*)(uintptr_t(p)&~1LL) : nullptr; } /** @@ -377,7 +377,7 @@ struct ActRec { // Note that reordering these is likely to require changes to the // translator. - UNION_FIELD_ACCESSORS2(This, ObjectData*, m_this, Class, VM::Class*, m_cls) + UNION_FIELD_ACCESSORS2(This, ObjectData*, m_this, Class, Class*, m_cls) static const int8_t kInvNameBit = 0x1; static const int8_t kExtraArgsBit = 0x2; UNION_FIELD_ACCESSORS3(VarEnv, VarEnv*, m_varEnv, InvName, StringData*, @@ -415,13 +415,13 @@ inline void arSetSfp(ActRec* ar, const ActRec* sfp) { ar->m_savedRbp = (uint64_t)sfp; } -template VM::Class* arGetContextClassImpl(const ActRec* ar); -template <> VM::Class* arGetContextClassImpl(const ActRec* ar); -template <> VM::Class* arGetContextClassImpl(const ActRec* ar); -inline VM::Class* arGetContextClass(const ActRec* ar) { +template Class* arGetContextClassImpl(const ActRec* ar); +template <> Class* arGetContextClassImpl(const ActRec* ar); +template <> Class* arGetContextClassImpl(const ActRec* ar); +inline Class* arGetContextClass(const ActRec* ar) { return arGetContextClassImpl(ar); } -inline VM::Class* arGetContextClassFromBuiltin(const ActRec* ar) { +inline Class* arGetContextClassFromBuiltin(const ActRec* ar) { return arGetContextClassImpl(ar); } @@ -429,9 +429,9 @@ inline VM::Class* arGetContextClassFromBuiltin(const ActRec* ar) { // figure out the callback context once and call it multiple times. (e.g. // array_map, array_filter, ...) struct CallCtx { - const VM::Func* func; + const Func* func; ObjectData* this_; - VM::Class* cls; + Class* cls; StringData* invName; }; @@ -513,7 +513,7 @@ private: void toStringFrag(std::ostream& os, const ActRec* fp, const TypedValue* top) const; void toStringAR(std::ostream& os, const ActRec* fp, - const VM::FPIEnt *fe, const TypedValue* top) const; + const FPIEnt *fe, const TypedValue* top) const; void toStringFragAR(std::ostream& os, const ActRec* fp, int offset, const TypedValue* top) const; void toStringFrame(std::ostream& os, const ActRec* fp, @@ -530,7 +530,7 @@ private: // it's impossible to have more than one chain of nested unactivated ActRecs // on the stack, this means that after this function returns, everything // between the stack pointer and frame pointer is a value, Iter or local. - void unwindAR(ActRec* fp, const VM::FPIEnt* fe); + void unwindAR(ActRec* fp, const FPIEnt* fe); public: static const int sSurprisePageSize; static const uint sMinStackElms; @@ -815,7 +815,7 @@ public: assert(m_top != m_base); return &m_top[ind]; } - inline void ALWAYS_INLINE pushClass(VM::Class* clss) { + inline void ALWAYS_INLINE pushClass(Class* clss) { assert(m_top != m_elms); m_top--; m_top->m_data.pcls = clss; diff --git a/hphp/runtime/vm/class.cpp b/hphp/runtime/vm/class.cpp index 049dcd951..8b8b594fa 100644 --- a/hphp/runtime/vm/class.cpp +++ b/hphp/runtime/vm/class.cpp @@ -41,7 +41,6 @@ #include namespace HPHP { -namespace VM { static StringData* sd86ctor = StringData::GetStaticString("86ctor"); static StringData* sd86pinit = StringData::GetStaticString("86pinit"); @@ -2635,4 +2634,4 @@ void Class::setSPropData(TypedValue* sPropData) const { handleToRef(m_propSDataCache) = sPropData; } -} } // HPHP::VM + } // HPHP::VM diff --git a/hphp/runtime/vm/class.h b/hphp/runtime/vm/class.h index 8f846b5b9..59549c128 100644 --- a/hphp/runtime/vm/class.h +++ b/hphp/runtime/vm/class.h @@ -43,7 +43,6 @@ class HphpArray; class ObjectData; struct HhbcExtClassInfo; -namespace VM { // Forward declarations. class Func; @@ -1033,6 +1032,6 @@ struct class_same { } }; -} } // HPHP::VM + } // HPHP::VM #endif diff --git a/hphp/runtime/vm/debug/debug.cpp b/hphp/runtime/vm/debug/debug.cpp index fdcc8aaf0..0c8fec699 100644 --- a/hphp/runtime/vm/debug/debug.cpp +++ b/hphp/runtime/vm/debug/debug.cpp @@ -28,10 +28,9 @@ #include -using namespace HPHP::VM::Transl; +using namespace HPHP::Transl; namespace HPHP { -namespace VM { namespace Debug { DebugInfo* DebugInfo::Get() { @@ -152,4 +151,3 @@ std::string lookupFunction(const Func* f, } } -} diff --git a/hphp/runtime/vm/debug/debug.h b/hphp/runtime/vm/debug/debug.h index 42beb5138..2de9007b6 100644 --- a/hphp/runtime/vm/debug/debug.h +++ b/hphp/runtime/vm/debug/debug.h @@ -22,10 +22,9 @@ #include "dwarf.h" namespace HPHP { -namespace VM { namespace Debug { -using namespace HPHP::VM::Transl; +using namespace HPHP::Transl; class DebugInfo { public: @@ -71,6 +70,5 @@ std::string lookupFunction(const Func* func, } } -} #endif diff --git a/hphp/runtime/vm/debug/dwarf.cpp b/hphp/runtime/vm/debug/dwarf.cpp index ae8b668f1..fd29956bb 100644 --- a/hphp/runtime/vm/debug/dwarf.cpp +++ b/hphp/runtime/vm/debug/dwarf.cpp @@ -24,10 +24,9 @@ #include #include -using namespace HPHP::VM::Transl; +using namespace HPHP::Transl; namespace HPHP { -namespace VM { namespace Debug { @@ -303,4 +302,3 @@ void DwarfInfo::syncChunks() { } } -} diff --git a/hphp/runtime/vm/debug/dwarf.h b/hphp/runtime/vm/debug/dwarf.h index d3319709d..f30dc5dd2 100644 --- a/hphp/runtime/vm/debug/dwarf.h +++ b/hphp/runtime/vm/debug/dwarf.h @@ -24,10 +24,9 @@ #include #include -using namespace HPHP::VM::Transl; +using namespace HPHP::Transl; namespace HPHP { -namespace VM { namespace Debug { typedef enum { @@ -183,7 +182,6 @@ struct DwarfInfo { void syncChunks(); }; -} } } diff --git a/hphp/runtime/vm/debug/elfwriter.cpp b/hphp/runtime/vm/debug/elfwriter.cpp index 5411eaf99..5dd9961e3 100644 --- a/hphp/runtime/vm/debug/elfwriter.cpp +++ b/hphp/runtime/vm/debug/elfwriter.cpp @@ -29,10 +29,9 @@ #include #include -using namespace HPHP::VM::Transl; +using namespace HPHP::Transl; namespace HPHP { -namespace VM { namespace Debug { static const Trace::Module TRACEMOD = Trace::debuginfo; @@ -611,4 +610,3 @@ ElfWriter::~ElfWriter() { } } -} diff --git a/hphp/runtime/vm/debug/elfwriter.h b/hphp/runtime/vm/debug/elfwriter.h index 3bf39e6aa..a07f2b514 100644 --- a/hphp/runtime/vm/debug/elfwriter.h +++ b/hphp/runtime/vm/debug/elfwriter.h @@ -23,10 +23,9 @@ #include #include -using namespace HPHP::VM::Transl; +using namespace HPHP::Transl; namespace HPHP { -namespace VM { namespace Debug { struct ElfWriter { @@ -61,7 +60,6 @@ struct ElfWriter { int writeTextSection(); }; -} } } diff --git a/hphp/runtime/vm/debug/gdb-jit.h b/hphp/runtime/vm/debug/gdb-jit.h index 0e75dfc3e..7e789f165 100644 --- a/hphp/runtime/vm/debug/gdb-jit.h +++ b/hphp/runtime/vm/debug/gdb-jit.h @@ -19,7 +19,7 @@ #include "dwarf.h" #include -using namespace HPHP::VM::Debug; +using namespace HPHP::Debug; typedef enum { JIT_NOACTION = 0, diff --git a/hphp/runtime/vm/debugger_hook.cpp b/hphp/runtime/vm/debugger_hook.cpp index a4df89f16..770d90527 100644 --- a/hphp/runtime/vm/debugger_hook.cpp +++ b/hphp/runtime/vm/debugger_hook.cpp @@ -26,7 +26,6 @@ #include namespace HPHP { -namespace VM { ////////////////////////////////////////////////////////////////////////// @@ -356,4 +355,4 @@ void PCFilter::removeOffset(const Unit* unit, Offset offset) { } ////////////////////////////////////////////////////////////////////////// -}} +} diff --git a/hphp/runtime/vm/debugger_hook.h b/hphp/runtime/vm/debugger_hook.h index 607af519c..7dfc63372 100644 --- a/hphp/runtime/vm/debugger_hook.h +++ b/hphp/runtime/vm/debugger_hook.h @@ -32,7 +32,6 @@ class PhpFile; // the debugger interacts directly with the VM. namespace HPHP { -namespace VM { // "Hooks" called by the VM at various points during program execution while // debugging to give the debugger a chance to act. The debugger may block @@ -128,6 +127,6 @@ public: } }; -}} // namespace HPHP::VM +} // namespace HPHP::VM #endif /* incl_HPHP_DEBUGGER_HOOK_H_ */ diff --git a/hphp/runtime/vm/event_hook.cpp b/hphp/runtime/vm/event_hook.cpp index 2dda380ad..a1d13bfc5 100644 --- a/hphp/runtime/vm/event_hook.cpp +++ b/hphp/runtime/vm/event_hook.cpp @@ -24,7 +24,6 @@ #include "runtime/vm/runtime.h" namespace HPHP { -namespace VM { static StaticString s_args("args"); static StaticString s_enter("enter"); @@ -235,5 +234,4 @@ void EventHook::onFunctionExit(const ActRec* ar) { } } -} // namespace VM } // namespace HPHP diff --git a/hphp/runtime/vm/event_hook.h b/hphp/runtime/vm/event_hook.h index c5c72aa77..f5416363f 100644 --- a/hphp/runtime/vm/event_hook.h +++ b/hphp/runtime/vm/event_hook.h @@ -21,7 +21,6 @@ #include "runtime/vm/translator/targetcache.h" namespace HPHP { -namespace VM { class EventHook { public: @@ -76,7 +75,6 @@ private: #undef DECLARE_HOOK -} // namespace VM } // namespace HPHP #endif diff --git a/hphp/runtime/vm/fixed_string_map.cpp b/hphp/runtime/vm/fixed_string_map.cpp index f63514eb7..0c63220ce 100644 --- a/hphp/runtime/vm/fixed_string_map.cpp +++ b/hphp/runtime/vm/fixed_string_map.cpp @@ -19,7 +19,6 @@ #include "runtime/base/macros.h" namespace HPHP { -namespace VM { TRACE_SET_MOD(runtime); @@ -87,4 +86,4 @@ template class FixedStringMap; /////////////////////////////////////////////////////////////////////////////// -} } + } diff --git a/hphp/runtime/vm/fixed_string_map.h b/hphp/runtime/vm/fixed_string_map.h index 3693de7ee..8e7ec3563 100644 --- a/hphp/runtime/vm/fixed_string_map.h +++ b/hphp/runtime/vm/fixed_string_map.h @@ -21,7 +21,6 @@ #include namespace HPHP { -namespace VM { /////////////////////////////////////////////////////////////////////////////// template class FixedStringMap { @@ -49,6 +48,6 @@ private: }; /////////////////////////////////////////////////////////////////////////////// -} } + } #endif // incl_HPHP_FIXED_STRING_MAP_H_ diff --git a/hphp/runtime/vm/func.cpp b/hphp/runtime/vm/func.cpp index 878ce786c..12ce62070 100644 --- a/hphp/runtime/vm/func.cpp +++ b/hphp/runtime/vm/func.cpp @@ -34,7 +34,6 @@ #include "system/lib/systemlib.h" namespace HPHP { -namespace VM { static const Trace::Module TRACEMOD = Trace::bcinterp; const StringData* Func::s___call = StringData::GetStaticString("__call"); @@ -113,7 +112,7 @@ void Func::setFullName() { } void Func::initPrologues(int numParams, bool isGenerator) { - m_funcBody = (TCA)HPHP::VM::Transl::funcBodyHelperThunk; + m_funcBody = (TCA)HPHP::Transl::funcBodyHelperThunk; int maxNumPrologues = Func::getMaxNumPrologues(numParams); int numPrologues = @@ -122,7 +121,7 @@ void Func::initPrologues(int numParams, bool isGenerator) { TRACE(2, "initPrologues func %p %d\n", this, numPrologues); for (int i = 0; i < numPrologues; i++) { - m_prologueTable[i] = (TCA)HPHP::VM::Transl::fcallHelperThunk; + m_prologueTable[i] = (TCA)HPHP::Transl::fcallHelperThunk; } } @@ -1127,4 +1126,4 @@ void FuncRepoProxy::GetFuncsStmt txn.commit(); } -} } // HPHP::VM + } // HPHP::VM diff --git a/hphp/runtime/vm/func.h b/hphp/runtime/vm/func.h index bf1bc4a13..33409c71a 100644 --- a/hphp/runtime/vm/func.h +++ b/hphp/runtime/vm/func.h @@ -24,7 +24,6 @@ #include "runtime/base/intercept.h" namespace HPHP { -namespace VM { static const int kNumFixedPrologues = 6; @@ -720,6 +719,6 @@ FRP_OPS #undef FRP_OP }; -} } + } #endif diff --git a/hphp/runtime/vm/func_inline.h b/hphp/runtime/vm/func_inline.h index 508a2fec2..22b66735b 100644 --- a/hphp/runtime/vm/func_inline.h +++ b/hphp/runtime/vm/func_inline.h @@ -18,7 +18,6 @@ #define incl_HPHP_VM_FUNC_INLINE_H_ namespace HPHP { -namespace VM { inline ALWAYS_INLINE Func** getCachedFuncAddr(unsigned offset) { assert(offset != 0u); @@ -38,6 +37,6 @@ inline ALWAYS_INLINE void setCachedFunc(Func* func, bool debugger) { if (UNLIKELY(debugger)) phpDebuggerDefFuncHook(func); } -} } // HPHP::VM + } // HPHP::VM #endif diff --git a/hphp/runtime/vm/funcdict.cpp b/hphp/runtime/vm/funcdict.cpp index 4bf25ca84..2e58ea2e9 100644 --- a/hphp/runtime/vm/funcdict.cpp +++ b/hphp/runtime/vm/funcdict.cpp @@ -27,7 +27,6 @@ #include namespace HPHP { -namespace VM { RenamedFuncDict::RenamedFuncDict() : m_restrictRenameableFunctions(false) { } @@ -72,7 +71,7 @@ bool RenamedFuncDict::rename(const StringData* old, const StringData* n3w) { newNe->setCachedFunc(func); if (RuntimeOption::EvalJit) { - VM::Transl::TargetCache::invalidateForRename(old); + Transl::TargetCache::invalidateForRename(old); } return true; @@ -93,4 +92,4 @@ void RenamedFuncDict::addRenameableFunctions(ArrayData* arr) { } } -} } // HPHP::VM + } // HPHP::VM diff --git a/hphp/runtime/vm/funcdict.h b/hphp/runtime/vm/funcdict.h index 803d8a8bb..1ff4e1386 100644 --- a/hphp/runtime/vm/funcdict.h +++ b/hphp/runtime/vm/funcdict.h @@ -20,7 +20,6 @@ #include namespace HPHP { -namespace VM { /* * Abstraction around the Name -> Function mapping. @@ -47,7 +46,6 @@ private: void addRenameableFunctions(ArrayData* arr); }; -} } // HPHP::VM #endif diff --git a/hphp/runtime/vm/hhbc.cpp b/hphp/runtime/vm/hhbc.cpp index 74329b204..f0af409ff 100644 --- a/hphp/runtime/vm/hhbc.cpp +++ b/hphp/runtime/vm/hhbc.cpp @@ -21,7 +21,6 @@ #include namespace HPHP { -namespace VM { /////////////////////////////////////////////////////////////////////////////// bool isValidOpcode(Opcode op) { @@ -970,5 +969,4 @@ int instrSpToArDelta(const Opcode* opcode) { /////////////////////////////////////////////////////////////////////////////// } -} diff --git a/hphp/runtime/vm/hhbc.h b/hphp/runtime/vm/hhbc.h index 7ca9fd5d2..d3d79e948 100644 --- a/hphp/runtime/vm/hhbc.h +++ b/hphp/runtime/vm/hhbc.h @@ -20,7 +20,6 @@ #include namespace HPHP { -namespace VM { struct Unit; @@ -851,6 +850,6 @@ mcodeMaybeArrayIntKey(MemberCode mcode) { } -} } + } #endif diff --git a/hphp/runtime/vm/indexed_string_map.h b/hphp/runtime/vm/indexed_string_map.h index a12f4db5b..c36a1a743 100644 --- a/hphp/runtime/vm/indexed_string_map.h +++ b/hphp/runtime/vm/indexed_string_map.h @@ -23,7 +23,7 @@ #include "runtime/base/string_data.h" #include "runtime/vm/fixed_string_map.h" -namespace HPHP { namespace VM { +namespace HPHP { ////////////////////////////////////////////////////////////////////// @@ -225,6 +225,6 @@ private: ////////////////////////////////////////////////////////////////////// -}} +} #endif diff --git a/hphp/runtime/vm/instance.cpp b/hphp/runtime/vm/instance.cpp index d05c5695f..38e0612c9 100644 --- a/hphp/runtime/vm/instance.cpp +++ b/hphp/runtime/vm/instance.cpp @@ -27,7 +27,6 @@ #include "system/lib/systemlib.h" namespace HPHP { -namespace VM { static StaticString s___get(LITSTR_INIT("__get")); static StaticString s___set(LITSTR_INIT("__set")); @@ -38,8 +37,8 @@ static StaticString s___callStatic(LITSTR_INIT("__callStatic")); TRACE_SET_MOD(runtime); -int HPHP::VM::Instance::ObjAllocatorSizeClassCount = - HPHP::VM::InitializeAllocators(); +int HPHP::Instance::ObjAllocatorSizeClassCount = + HPHP::InitializeAllocators(); void deepInitHelper(TypedValue* propVec, const TypedValueAux* propData, size_t nProps) { @@ -809,4 +808,4 @@ ObjectData* Instance::cloneImpl() { return obj; } -} } // HPHP::VM + } // HPHP::VM diff --git a/hphp/runtime/vm/instance.h b/hphp/runtime/vm/instance.h index 8818f6506..1d08c5472 100644 --- a/hphp/runtime/vm/instance.h +++ b/hphp/runtime/vm/instance.h @@ -26,7 +26,6 @@ #include "runtime/vm/unit.h" namespace HPHP { -namespace VM { void deepInitHelper(TypedValue* propVec, const TypedValueAux* propData, size_t nProps); @@ -245,21 +244,21 @@ inline Instance* instanceFromTv(TypedValue* tv) { return static_cast(tv->m_data.pobj); } -} } // HPHP::VM + } // HPHP::VM namespace HPHP { -class ExtObjectData : public HPHP::VM::Instance { +class ExtObjectData : public HPHP::Instance { public: - explicit ExtObjectData(HPHP::VM::Class* cls) - : HPHP::VM::Instance(cls, false) { + explicit ExtObjectData(HPHP::Class* cls) + : HPHP::Instance(cls, false) { assert(!m_cls->callsCustomInstanceInit()); } }; template class ExtObjectDataFlags : public ExtObjectData { public: - explicit ExtObjectDataFlags(HPHP::VM::Class* cb) : ExtObjectData(cb) { + explicit ExtObjectDataFlags(HPHP::Class* cb) : ExtObjectData(cb) { ObjectData::setAttributes(flags); } }; diff --git a/hphp/runtime/vm/instrumentation.cpp b/hphp/runtime/vm/instrumentation.cpp index d0d93b5d9..db6b4bc41 100644 --- a/hphp/runtime/vm/instrumentation.cpp +++ b/hphp/runtime/vm/instrumentation.cpp @@ -20,7 +20,6 @@ #include namespace HPHP { -namespace VM { /////////////////////////////////////////////////////////////////////////////// @@ -220,22 +219,22 @@ void InjectionTables::clear() { InjectionTables* InjectionTables::clone() { InjectionTables* newTables = new InjectionTables(); for (int i = 0; i < InstHookTypeInt64Count; i++) { - VM::InjectionTableInt64* table = m_int64Tables[i]; + InjectionTableInt64* table = m_int64Tables[i]; if (!table) { newTables->m_int64Tables[i] = nullptr; continue; } - VM::InjectionTableInt64* newTable = new InjectionTableInt64(); + InjectionTableInt64* newTable = new InjectionTableInt64(); newTable->insert(table->begin(), table->end()); newTables->m_int64Tables[i] = newTable; } for (int i = 0; i < InstHookTypeSDCount; i++) { - VM::InjectionTableSD* table = m_sdTables[i]; + InjectionTableSD* table = m_sdTables[i]; if (!table) { newTables->m_sdTables[i] = nullptr; continue; } - VM::InjectionTableSD* newTable = new InjectionTableSD(); + InjectionTableSD* newTable = new InjectionTableSD(); newTable->insert(table->begin(), table->end()); newTables->m_sdTables[i] = newTable; } @@ -270,4 +269,4 @@ int InjectionTables::countInjections() { /////////////////////////////////////////////////////////////////////////////// -} } // HPHP::VM + } // HPHP::VM diff --git a/hphp/runtime/vm/instrumentation.h b/hphp/runtime/vm/instrumentation.h index dd5add2a6..55449e8fd 100644 --- a/hphp/runtime/vm/instrumentation.h +++ b/hphp/runtime/vm/instrumentation.h @@ -23,7 +23,6 @@ #include namespace HPHP { -namespace VM { // Define a set of hooks to be used enum InstHookTypeInt64 { @@ -150,6 +149,6 @@ private: /////////////////////////////////////////////////////////////////////////////// -} } // HPHP::VM + } // HPHP::VM #endif /* incl_HPHP_INSTRUMENTATION_H_ */ diff --git a/hphp/runtime/vm/instrumentation_hook.h b/hphp/runtime/vm/instrumentation_hook.h index e9314c61d..f1beb9517 100644 --- a/hphp/runtime/vm/instrumentation_hook.h +++ b/hphp/runtime/vm/instrumentation_hook.h @@ -21,7 +21,6 @@ #include namespace HPHP { -namespace VM { static inline void instHookInt64Impl(InjectionTableInt64* table, int64_t val) { if (!table) return; @@ -59,6 +58,6 @@ static inline void instHookStr(int type, const char* str) { #define INST_HOOK_FENTRY(sd) instHookSD(InstHookTypeFuncEntry, sd) -} } // HPHP::VM + } // HPHP::VM #endif /* incl_HPHP_INSTRUMENTATION_HOOK_H_ */ diff --git a/hphp/runtime/vm/member_operations.cpp b/hphp/runtime/vm/member_operations.cpp index c113f54a6..c9f07d2ae 100644 --- a/hphp/runtime/vm/member_operations.cpp +++ b/hphp/runtime/vm/member_operations.cpp @@ -18,7 +18,6 @@ #include "runtime/ext/ext_collections.h" namespace HPHP { -namespace VM { StringData* prepareAnyKey(TypedValue* tv) { if (IS_STRING_TYPE(tv->m_type)) { @@ -121,4 +120,3 @@ void objOffsetUnset(Instance* base, CVarRef offset) { /////////////////////////////////////////////////////////////////////////////// } -} diff --git a/hphp/runtime/vm/member_operations.h b/hphp/runtime/vm/member_operations.h index 4d5bad406..93ea0e9b6 100644 --- a/hphp/runtime/vm/member_operations.h +++ b/hphp/runtime/vm/member_operations.h @@ -26,7 +26,6 @@ #include "runtime/ext/ext_collections.h" namespace HPHP { -namespace VM { // When MoreWarnings is set to true, the VM will raise more warnings // on SetOpM, IncDecM and CGetG, intended to match Zend. @@ -1756,5 +1755,4 @@ inline void UnsetProp(Class* ctx, TypedValue* base, /////////////////////////////////////////////////////////////////////////////// } -} #endif // incl_HPHP_VM_MEMBER_OPERATIONS_H_ diff --git a/hphp/runtime/vm/name_value_table.h b/hphp/runtime/vm/name_value_table.h index 29fb706ba..ae5a4615a 100644 --- a/hphp/runtime/vm/name_value_table.h +++ b/hphp/runtime/vm/name_value_table.h @@ -25,7 +25,7 @@ #include "util/exp_arena.h" #include "runtime/base/complex_types.h" -namespace HPHP { namespace VM { +namespace HPHP { ////////////////////////////////////////////////////////////////////// @@ -504,6 +504,6 @@ inline NameValueTable::~NameValueTable() { ////////////////////////////////////////////////////////////////////// -}} +} #endif diff --git a/hphp/runtime/vm/name_value_table_wrapper.cpp b/hphp/runtime/vm/name_value_table_wrapper.cpp index 6791951a6..aefa5b9ba 100644 --- a/hphp/runtime/vm/name_value_table_wrapper.cpp +++ b/hphp/runtime/vm/name_value_table_wrapper.cpp @@ -18,7 +18,7 @@ #include "runtime/base/array/array_iterator.h" #include "runtime/base/array/array_init.h" -namespace HPHP { namespace VM { +namespace HPHP { ////////////////////////////////////////////////////////////////////// @@ -317,4 +317,4 @@ void NameValueTableWrapper::uasort(CVarRef cmp_function) {} ////////////////////////////////////////////////////////////////////// -}} +} diff --git a/hphp/runtime/vm/name_value_table_wrapper.h b/hphp/runtime/vm/name_value_table_wrapper.h index 984967842..d00cc7161 100644 --- a/hphp/runtime/vm/name_value_table_wrapper.h +++ b/hphp/runtime/vm/name_value_table_wrapper.h @@ -19,7 +19,7 @@ #include "runtime/vm/name_value_table.h" #include "runtime/base/array/array_data.h" -namespace HPHP { namespace VM { +namespace HPHP { ////////////////////////////////////////////////////////////////////// @@ -172,6 +172,6 @@ class GlobalNameValueTableWrapper : public NameValueTableWrapper { ////////////////////////////////////////////////////////////////////// -}} +} #endif diff --git a/hphp/runtime/vm/named_entity.h b/hphp/runtime/vm/named_entity.h index c4d3ccb4f..82d64e3f2 100644 --- a/hphp/runtime/vm/named_entity.h +++ b/hphp/runtime/vm/named_entity.h @@ -24,7 +24,7 @@ #include "util/atomic.h" -namespace HPHP { namespace VM { +namespace HPHP { class Class; class Typedef; @@ -122,6 +122,6 @@ typedef std::pair NamedEntityPair; ////////////////////////////////////////////////////////////////////// -}} +} #endif diff --git a/hphp/runtime/vm/object_allocator_sizes.cpp b/hphp/runtime/vm/object_allocator_sizes.cpp index d0aecf66d..afaae28d6 100644 --- a/hphp/runtime/vm/object_allocator_sizes.cpp +++ b/hphp/runtime/vm/object_allocator_sizes.cpp @@ -20,7 +20,6 @@ #include namespace HPHP { -namespace VM { namespace { @@ -47,4 +46,4 @@ int InitializeAllocators() { } -}} +} diff --git a/hphp/runtime/vm/object_allocator_sizes.h b/hphp/runtime/vm/object_allocator_sizes.h index 8bbb4578f..4c18417c6 100644 --- a/hphp/runtime/vm/object_allocator_sizes.h +++ b/hphp/runtime/vm/object_allocator_sizes.h @@ -18,7 +18,6 @@ #define incl_HPHP_OBJECT_ALLOCATOR_SIZES_H_ namespace HPHP { -namespace VM { // SmartAllocator (or, to be more specific, ObjectAllocator) is templatized by // the size of the chunks it allocates. This works fine when we're only @@ -32,6 +31,6 @@ namespace VM { // end up falling into will have an ObjectAllocator. int InitializeAllocators(); -}} +} #endif diff --git a/hphp/runtime/vm/pendq.cpp b/hphp/runtime/vm/pendq.cpp index 7a9672014..69262e7f3 100644 --- a/hphp/runtime/vm/pendq.cpp +++ b/hphp/runtime/vm/pendq.cpp @@ -19,7 +19,6 @@ #include namespace HPHP { -namespace VM { static __thread PendQ* tl_q; @@ -41,4 +40,4 @@ void PendQ::drain() { } } -}} +} diff --git a/hphp/runtime/vm/pendq.h b/hphp/runtime/vm/pendq.h index 638768bd0..8f45e47fb 100644 --- a/hphp/runtime/vm/pendq.h +++ b/hphp/runtime/vm/pendq.h @@ -20,7 +20,6 @@ #include namespace HPHP { -namespace VM { /* * We sometimes have work to do that must be deferred to a lower-ranked @@ -49,7 +48,7 @@ struct PendQ : private std::queue { static void drain(); }; -}} +} #endif diff --git a/hphp/runtime/vm/repo.cpp b/hphp/runtime/vm/repo.cpp index afadfb675..3b3b0b488 100644 --- a/hphp/runtime/vm/repo.cpp +++ b/hphp/runtime/vm/repo.cpp @@ -20,7 +20,6 @@ #include "util/repo_schema.h" namespace HPHP { -namespace VM { static const Trace::Module TRACEMOD = Trace::hhbc; @@ -701,4 +700,4 @@ bool Repo::writable(int repoId) { return true; } -} } // HPHP::VM + } // HPHP::VM diff --git a/hphp/runtime/vm/repo.h b/hphp/runtime/vm/repo.h index e59d69314..609c22d46 100644 --- a/hphp/runtime/vm/repo.h +++ b/hphp/runtime/vm/repo.h @@ -30,7 +30,6 @@ #include namespace HPHP { -namespace VM { class Repo : public RepoProxy { private: @@ -172,6 +171,6 @@ class Repo : public RepoProxy { FuncRepoProxy m_frp; }; -}} +} #endif diff --git a/hphp/runtime/vm/repo_helpers.cpp b/hphp/runtime/vm/repo_helpers.cpp index 63f262968..2c380dfcb 100644 --- a/hphp/runtime/vm/repo_helpers.cpp +++ b/hphp/runtime/vm/repo_helpers.cpp @@ -20,7 +20,6 @@ #include "runtime/base/builtin_functions.h" namespace HPHP { -namespace VM { static const Trace::Module TRACEMOD = Trace::hhbc; @@ -449,4 +448,4 @@ void RepoTxnQuery::exec() { m_txn.exec(*this); } -} } // HPHP::VM + } // HPHP::VM diff --git a/hphp/runtime/vm/repo_helpers.h b/hphp/runtime/vm/repo_helpers.h index 44e4155ea..989dc5298 100644 --- a/hphp/runtime/vm/repo_helpers.h +++ b/hphp/runtime/vm/repo_helpers.h @@ -23,7 +23,6 @@ #include "runtime/base/md5.h" namespace HPHP { -namespace VM { // Forward declaration. class Repo; @@ -207,6 +206,6 @@ class RepoProxy { Repo& m_repo; }; -} } + } #endif diff --git a/hphp/runtime/vm/runtime.cpp b/hphp/runtime/vm/runtime.cpp index 77fe6fe1c..e9a9cc5e5 100644 --- a/hphp/runtime/vm/runtime.cpp +++ b/hphp/runtime/vm/runtime.cpp @@ -34,9 +34,7 @@ namespace HPHP { -using VM::Unit; -using VM::Func; -using VM::Transl::tx64; +using Transl::tx64; static const Trace::Module TRACEMOD = Trace::runtime; @@ -335,7 +333,7 @@ Unit* compile_string(const char* s, size_t sz) { int out_len; md5 = MD5(string_md5(s, sz, false, out_len)); - VM::Unit* u = VM::Repo::get().loadUnit("", md5); + Unit* u = Repo::get().loadUnit("", md5); if (u != nullptr) { return u; } diff --git a/hphp/runtime/vm/runtime.h b/hphp/runtime/vm/runtime.h index 1b377267d..c402bce45 100644 --- a/hphp/runtime/vm/runtime.h +++ b/hphp/runtime/vm/runtime.h @@ -123,13 +123,13 @@ frame_free_locals_inl_no_hook(ActRec* fp, int numLocals) { inline void ALWAYS_INLINE frame_free_locals_inl(ActRec* fp, int numLocals) { frame_free_locals_inl_no_hook(fp, numLocals); - VM::EventHook::FunctionExit(fp); + EventHook::FunctionExit(fp); } inline void ALWAYS_INLINE frame_free_locals_no_this_inl(ActRec* fp, int numLocals) { frame_free_locals_helper_inl(fp, numLocals); - VM::EventHook::FunctionExit(fp); + EventHook::FunctionExit(fp); } inline void ALWAYS_INLINE @@ -145,20 +145,20 @@ frame_free_args(TypedValue* args, int count) { } -VM::Unit* +Unit* compile_file(const char* s, size_t sz, const MD5& md5, const char* fname); -VM::Unit* compile_string(const char* s, size_t sz); -VM::Unit* build_native_func_unit(const HhbcExtFuncInfo* builtinFuncs, +Unit* compile_string(const char* s, size_t sz); +Unit* build_native_func_unit(const HhbcExtFuncInfo* builtinFuncs, ssize_t numBuiltinFuncs); -VM::Unit* build_native_class_unit(const HhbcExtClassInfo* builtinClasses, +Unit* build_native_class_unit(const HhbcExtClassInfo* builtinClasses, ssize_t numBuiltinClasses); HphpArray* pack_args_into_array(ActRec* ar, int nargs); -static inline VM::Instance* -newInstance(VM::Class* cls) { +static inline Instance* +newInstance(Class* cls) { assert(cls); - auto* inst = VM::Instance::newInstance(cls); + auto* inst = Instance::newInstance(cls); if (UNLIKELY(RuntimeOption::EnableObjDestructCall)) { g_vmContext->m_liveBCObjs.insert(inst); } @@ -175,9 +175,9 @@ HphpArray* get_static_locals(const ActRec* ar); * be set up before you use those parts of the runtime. */ -typedef VM::Unit* (*CompileStringFn)(const char*, int, const MD5&, const char*); -typedef VM::Unit* (*BuildNativeFuncUnitFn)(const HhbcExtFuncInfo*, ssize_t); -typedef VM::Unit* (*BuildNativeClassUnitFn)(const HhbcExtClassInfo*, ssize_t); +typedef Unit* (*CompileStringFn)(const char*, int, const MD5&, const char*); +typedef Unit* (*BuildNativeFuncUnitFn)(const HhbcExtFuncInfo*, ssize_t); +typedef Unit* (*BuildNativeClassUnitFn)(const HhbcExtClassInfo*, ssize_t); extern CompileStringFn g_hphp_compiler_parse; extern BuildNativeFuncUnitFn g_hphp_build_native_func_unit; diff --git a/hphp/runtime/vm/translator/abi-x64.h b/hphp/runtime/vm/translator/abi-x64.h index 9122e55f9..20e918c03 100644 --- a/hphp/runtime/vm/translator/abi-x64.h +++ b/hphp/runtime/vm/translator/abi-x64.h @@ -29,7 +29,7 @@ #include "util/asm-x64.h" #include "runtime/vm/translator/regalloc.h" -namespace HPHP { namespace VM { namespace Transl { +namespace HPHP { namespace Transl { ////////////////////////////////////////////////////////////////////// /* @@ -304,6 +304,6 @@ const size_t kReservedRSPSpillSpace = 0x80; ////////////////////////////////////////////////////////////////////// -}}} +}} #endif diff --git a/hphp/runtime/vm/translator/annotation.cpp b/hphp/runtime/vm/translator/annotation.cpp index 9a19e70a0..21b86bf83 100644 --- a/hphp/runtime/vm/translator/annotation.cpp +++ b/hphp/runtime/vm/translator/annotation.cpp @@ -20,7 +20,6 @@ #include namespace HPHP { -namespace VM { namespace Transl { static const Trace::Module TRACEMOD = Trace::trans; @@ -220,5 +219,5 @@ fcallToFuncName(const NormalizedInstruction* i) { return nullptr; } -} } } +} } diff --git a/hphp/runtime/vm/translator/annotation.h b/hphp/runtime/vm/translator/annotation.h index 446b97da5..883bb4246 100644 --- a/hphp/runtime/vm/translator/annotation.h +++ b/hphp/runtime/vm/translator/annotation.h @@ -19,7 +19,6 @@ #include namespace HPHP { -namespace VM { namespace Transl { /* @@ -31,6 +30,6 @@ const StringData* encodeCallAndArgs(const StringData *name, int numArgs); const StringData* fcallToFuncName(const NormalizedInstruction* fcall); int getMaxEncodedArgs(); -} } } +} } #endif diff --git a/hphp/runtime/vm/translator/asm-x64-test.cpp b/hphp/runtime/vm/translator/asm-x64-test.cpp index d85edd0a4..18f415fcb 100644 --- a/hphp/runtime/vm/translator/asm-x64-test.cpp +++ b/hphp/runtime/vm/translator/asm-x64-test.cpp @@ -19,7 +19,6 @@ #include "util/asm-x64.h" namespace HPHP { -namespace VM { namespace Transl { /////////////////////////////////////////////////////////////////////////////// @@ -205,7 +204,7 @@ void testEmitMethods() { X64Assembler e; e.init(10 << 20); - using namespace HPHP::VM::Transl::reg; + using namespace HPHP::Transl::reg; int n = sizeof(instr_list) / sizeof(instr_list[0]); for (int i = 0; i < n; ++i) { @@ -572,5 +571,4 @@ void testEmitMethods() { /////////////////////////////////////////////////////////////////////////////// } } -} diff --git a/hphp/runtime/vm/translator/collector.cpp b/hphp/runtime/vm/translator/collector.cpp index fa08e3cf3..b8ce16894 100644 --- a/hphp/runtime/vm/translator/collector.cpp +++ b/hphp/runtime/vm/translator/collector.cpp @@ -34,7 +34,6 @@ #include "runtime/vm/translator/translator-x64.h" namespace HPHP { -namespace VM { namespace Transl { /* @@ -164,4 +163,4 @@ struct Tx64Annihilator { static Tx64Annihilator boom; -} } } // HPHP::VM::Transl +} } // HPHP::Transl diff --git a/hphp/runtime/vm/translator/fixup.h b/hphp/runtime/vm/translator/fixup.h index fe58f3fc6..e1a371c0a 100644 --- a/hphp/runtime/vm/translator/fixup.h +++ b/hphp/runtime/vm/translator/fixup.h @@ -28,7 +28,7 @@ namespace HPHP { class ExecutionContext; -namespace VM { namespace Transl { + namespace Transl { /* * The Fixup map allows us to reconstruct the state of the VM @@ -214,6 +214,6 @@ private: TreadHashMap m_fixups; }; -}}} +}} #endif diff --git a/hphp/runtime/vm/translator/hooks.h b/hphp/runtime/vm/translator/hooks.h index e732e441f..170eb4dd8 100644 --- a/hphp/runtime/vm/translator/hooks.h +++ b/hphp/runtime/vm/translator/hooks.h @@ -18,10 +18,9 @@ #define incl_HPHP_HOOKS_H_ namespace HPHP { -namespace VM { extern void invalidatePath(const std::string& path); -}} +} #endif diff --git a/hphp/runtime/vm/translator/hopt/check.cpp b/hphp/runtime/vm/translator/hopt/check.cpp index a79346da1..23826a498 100644 --- a/hphp/runtime/vm/translator/hopt/check.cpp +++ b/hphp/runtime/vm/translator/hopt/check.cpp @@ -20,7 +20,7 @@ #include "runtime/vm/translator/hopt/linearscan.h" #include "runtime/vm/translator/physreg.h" -namespace HPHP { namespace VM { namespace JIT { +namespace HPHP { namespace JIT { /* * Check one block for being well formed. It must: @@ -149,5 +149,5 @@ bool checkRegisters(Trace* trace, const IRFactory& factory, return true; } -}}} +}} diff --git a/hphp/runtime/vm/translator/hopt/check.h b/hphp/runtime/vm/translator/hopt/check.h index bfe204f59..8e54c4aaa 100644 --- a/hphp/runtime/vm/translator/hopt/check.h +++ b/hphp/runtime/vm/translator/hopt/check.h @@ -18,7 +18,6 @@ #define incl_HPHP_VM_CHECK_H_ namespace HPHP { -namespace VM { namespace JIT { class Trace; @@ -37,6 +36,6 @@ bool checkCfg(Trace*, const IRFactory&); */ bool checkRegisters(Trace*, const IRFactory&, const RegAllocInfo&); -}}} +}} #endif diff --git a/hphp/runtime/vm/translator/hopt/codegen.cpp b/hphp/runtime/vm/translator/hopt/codegen.cpp index 180c8cb24..4eea6d5e8 100644 --- a/hphp/runtime/vm/translator/hopt/codegen.cpp +++ b/hphp/runtime/vm/translator/hopt/codegen.cpp @@ -46,11 +46,10 @@ #include "runtime/vm/translator/hopt/nativecalls.h" #include "runtime/vm/translator/hopt/print.h" -using HPHP::VM::Transl::TCA; -using namespace HPHP::VM::Transl::TargetCache; +using HPHP::Transl::TCA; +using namespace HPHP::Transl::TargetCache; namespace HPHP { -namespace VM { namespace JIT { namespace { @@ -2501,7 +2500,7 @@ void CodeGenerator::cgExitTrace(IRInstruction* inst) { assert(toSmash); } } - using namespace HPHP::VM::Transl; + using namespace HPHP::Transl; Asm& a = m_as; // Note: m_as is the same as m_atubs for Exit Traces, // unless exit trace was moved to end of main trace @@ -2574,11 +2573,11 @@ void CodeGenerator::cgExitTrace(IRInstruction* inst) { } if (HPHP::Trace::moduleEnabled(HPHP::Trace::punt, 1)) { - VM::Op op = (VM::Op)*func->getValFunc()->unit()->at(destSK.m_offset); + Op op = (Op)*func->getValFunc()->unit()->at(destSK.m_offset); std::string name = folly::format( "exitSlow{}-{}", exitType == TraceExitType::SlowNoProgress ? "-np" : "", - VM::opcodeToName(op)).str(); + opcodeToName(op)).str(); m_tx64->emitRecordPunt(a, name); } if (RuntimeOption::EvalHHIRDisableTx64) { @@ -2806,14 +2805,14 @@ void CodeGenerator::cgGenericRetDecRefs(IRInstruction* inst) { static void tv_release_generic(TypedValue* tv) { - assert(VM::Transl::tx64->stateIsDirty()); + assert(Transl::tx64->stateIsDirty()); assert(tv->m_type >= KindOfString && tv->m_type <= KindOfRef); g_destructors[typeToDestrIndex(tv->m_type)](tv->m_data.pref); } static void tv_release_typed(RefData* pv, DataType dt) { - assert(VM::Transl::tx64->stateIsDirty()); + assert(Transl::tx64->stateIsDirty()); assert(dt >= KindOfString && dt <= KindOfRef); g_destructors[typeToDestrIndex(dt)](pv); } @@ -5289,4 +5288,4 @@ void genCodeForTrace(Trace* trace, } } -}}} +}} diff --git a/hphp/runtime/vm/translator/hopt/codegen.h b/hphp/runtime/vm/translator/hopt/codegen.h index 218dcbc64..02a0d06cc 100644 --- a/hphp/runtime/vm/translator/hopt/codegen.h +++ b/hphp/runtime/vm/translator/hopt/codegen.h @@ -26,7 +26,6 @@ #include "runtime/vm/translator/hopt/state_vector.h" namespace HPHP { -namespace VM { namespace JIT { class FailedCodeGen : public std::exception { @@ -552,6 +551,6 @@ void genCodeForTrace(Trace* trace, const LifetimeInfo* lifetime = nullptr, AsmInfo* asmInfo = nullptr); -}}} +}} #endif diff --git a/hphp/runtime/vm/translator/hopt/cse.h b/hphp/runtime/vm/translator/hopt/cse.h index d01dd2197..e355f8096 100644 --- a/hphp/runtime/vm/translator/hopt/cse.h +++ b/hphp/runtime/vm/translator/hopt/cse.h @@ -24,7 +24,6 @@ #include "runtime/vm/translator/hopt/ir.h" namespace HPHP { -namespace VM { namespace JIT { /* @@ -89,7 +88,7 @@ private: MapType map; }; -}}} +}} #endif diff --git a/hphp/runtime/vm/translator/hopt/dce.cpp b/hphp/runtime/vm/translator/hopt/dce.cpp index 30215539f..2f14ed7f5 100644 --- a/hphp/runtime/vm/translator/hopt/dce.cpp +++ b/hphp/runtime/vm/translator/hopt/dce.cpp @@ -24,7 +24,6 @@ #include "runtime/vm/translator/hopt/state_vector.h" namespace HPHP { -namespace VM { namespace JIT { namespace { @@ -618,4 +617,4 @@ void eliminateDeadCode(Trace* trace, IRFactory* irFactory) { removeEmptyExitTraces(); } -} } } +} } diff --git a/hphp/runtime/vm/translator/hopt/hhbctranslator.cpp b/hphp/runtime/vm/translator/hopt/hhbctranslator.cpp index 23a696e8c..ca0f3ce89 100644 --- a/hphp/runtime/vm/translator/hopt/hhbctranslator.cpp +++ b/hphp/runtime/vm/translator/hopt/hhbctranslator.cpp @@ -29,12 +29,11 @@ #include "util/assert_throw.h" namespace HPHP { -namespace VM { namespace JIT { TRACE_SET_MOD(hhir); -using namespace HPHP::VM::Transl; +using namespace HPHP::Transl; ArrayData* HhbcTranslator::lookupArrayId(int arrId) { return getCurUnit()->lookupArrayId(arrId); @@ -1414,7 +1413,7 @@ void HhbcTranslator::emitFPassV() { gen(DecRef, tmp); } -void HhbcTranslator::emitFPushCufOp(VM::Op op, Class* cls, StringData* invName, +void HhbcTranslator::emitFPushCufOp(Op op, Class* cls, StringData* invName, const Func* callee, int numArgs) { const Func* curFunc = getCurFunc(); const bool safe = op == OpFPushCufSafe; @@ -1670,7 +1669,7 @@ void HhbcTranslator::emitFPushObjMethodD(int32_t numParams, const Class* baseClass) { const StringData* methodName = lookupStringId(methodNameStrId); bool magicCall = false; - const Func* func = HPHP::VM::Transl::lookupImmutableMethod(baseClass, + const Func* func = HPHP::Transl::lookupImmutableMethod(baseClass, methodName, magicCall, /* staticLookup: */ @@ -1778,7 +1777,7 @@ void HhbcTranslator::emitFPushClsMethodD(int32_t numParams, const StringData* className = np.first; const Class* baseClass = Unit::lookupUniqueClass(np.second); bool magicCall = false; - const Func* func = HPHP::VM::Transl::lookupImmutableMethod(baseClass, + const Func* func = HPHP::Transl::lookupImmutableMethod(baseClass, methodName, magicCall, /* staticLookup: */ @@ -3208,4 +3207,4 @@ void HhbcTranslator::end(int nextPc) { m_tb->genTraceEnd(nextPc); } -}}} // namespace HPHP::VM::JIT +}} // namespace HPHP::JIT diff --git a/hphp/runtime/vm/translator/hopt/hhbctranslator.h b/hphp/runtime/vm/translator/hopt/hhbctranslator.h index 922e6efa0..f4cc3773e 100644 --- a/hphp/runtime/vm/translator/hopt/hhbctranslator.h +++ b/hphp/runtime/vm/translator/hopt/hhbctranslator.h @@ -27,11 +27,10 @@ #include "runtime/vm/translator/runtime-type.h" #include "runtime/vm/translator/hopt/tracebuilder.h" -using HPHP::VM::Transl::SrcKey; -using HPHP::VM::Transl::NormalizedInstruction; +using HPHP::Transl::SrcKey; +using HPHP::Transl::NormalizedInstruction; namespace HPHP { -namespace VM { namespace Transl { struct PropInfo; } namespace JIT { @@ -222,7 +221,7 @@ struct HhbcTranslator { void emitFPassCOp(); void emitFPassR(); void emitFPassV(); - void emitFPushCufOp(VM::Op op, Class* cls, StringData* invName, + void emitFPushCufOp(Op op, Class* cls, StringData* invName, const Func* func, int numArgs); void emitFPushActRec(SSATmp* func, SSATmp* objOrClass, int32_t numArgs, const StringData* invName); @@ -533,7 +532,7 @@ private: Type resultType, int stkIndex); bool checkSupportedGblName(const StringData* gblName, - HPHP::VM::JIT::Type resultType, + HPHP::JIT::Type resultType, int stkIndex); SSATmp* emitLdClsPropAddrOrExit(const StringData* propName, Block* block); SSATmp* emitLdClsPropAddr(const StringData* propName) { @@ -683,6 +682,6 @@ private: ////////////////////////////////////////////////////////////////////// -}}} // namespace HPHP::VM::JIT +}} // namespace HPHP::JIT #endif diff --git a/hphp/runtime/vm/translator/hopt/ir.cpp b/hphp/runtime/vm/translator/hopt/ir.cpp index e8eb027a6..baf28efe0 100644 --- a/hphp/runtime/vm/translator/hopt/ir.cpp +++ b/hphp/runtime/vm/translator/hopt/ir.cpp @@ -39,9 +39,9 @@ // Include last to localize effects to this file #include "util/assert_throw.h" -namespace HPHP { namespace VM { namespace JIT { +namespace HPHP { namespace JIT { -using namespace HPHP::VM::Transl; +using namespace HPHP::Transl; #define IRT(name, ...) const Type Type::name(Type::k##name); IR_TYPES @@ -984,5 +984,5 @@ bool hasInternalFlow(Trace* trace) { return false; } -}}} +}} diff --git a/hphp/runtime/vm/translator/hopt/ir.h b/hphp/runtime/vm/translator/hopt/ir.h index b8a94c761..1b37daa9f 100644 --- a/hphp/runtime/vm/translator/hopt/ir.h +++ b/hphp/runtime/vm/translator/hopt/ir.h @@ -51,13 +51,12 @@ namespace HPHP { // forward declaration class StringData; -namespace VM { namespace JIT { -using HPHP::VM::Transl::TCA; -using HPHP::VM::Transl::RegSet; -using HPHP::VM::Transl::PhysReg; -using HPHP::VM::Transl::ConditionCode; +using HPHP::Transl::TCA; +using HPHP::Transl::RegSet; +using HPHP::Transl::PhysReg; +using HPHP::Transl::ConditionCode; struct IRInstruction; @@ -928,7 +927,7 @@ inline Opcode queryJmpToQueryOp(Opcode opc) { inline ConditionCode queryJmpToCC(Opcode opc) { assert(isQueryJmpOp(opc)); - using namespace HPHP::VM::Transl; + using namespace HPHP::Transl; switch (opc) { case JmpGt: return CC_G; @@ -1594,12 +1593,12 @@ class RawMemSlot { } static RawMemSlot& GetContEntry() { static RawMemSlot m( - Func::prologueTableOff() + sizeof(HPHP::VM::Transl::TCA), + Func::prologueTableOff() + sizeof(HPHP::Transl::TCA), Transl::sz::qword, Type::TCA); return m; } static RawMemSlot& GetMisCtx() { - using namespace HPHP::VM::Transl; + using namespace HPHP::Transl; static RawMemSlot m(HHIR_MISOFF(ctx), Transl::sz::qword, Type::Cls); return m; } @@ -2490,14 +2489,14 @@ void forEachTraceInst(Trace* main, Body body) { }); } -}}} +}} namespace std { - template<> struct hash { - size_t operator()(HPHP::VM::JIT::Opcode op) const { return op; } + template<> struct hash { + size_t operator()(HPHP::JIT::Opcode op) const { return op; } }; - template<> struct hash { - size_t operator()(HPHP::VM::JIT::Type t) const { return t.hash(); } + template<> struct hash { + size_t operator()(HPHP::JIT::Type t) const { return t.hash(); } }; } diff --git a/hphp/runtime/vm/translator/hopt/irfactory.cpp b/hphp/runtime/vm/translator/hopt/irfactory.cpp index 0878d2717..dc5705ae5 100644 --- a/hphp/runtime/vm/translator/hopt/irfactory.cpp +++ b/hphp/runtime/vm/translator/hopt/irfactory.cpp @@ -15,7 +15,7 @@ */ #include "runtime/vm/translator/hopt/irfactory.h" -namespace HPHP { namespace VM { namespace JIT { +namespace HPHP { namespace JIT { IRInstruction* IRFactory::defLabel() { IRInstruction inst(DefLabel); @@ -56,4 +56,4 @@ SSATmp* IRFactory::findConst(ConstData& cdata, Type ctype) { return m_constTable.insert(cloneInstruction(&inst)->getDst()); } -}}} +}} diff --git a/hphp/runtime/vm/translator/hopt/irfactory.h b/hphp/runtime/vm/translator/hopt/irfactory.h index 2823694ee..688975dab 100644 --- a/hphp/runtime/vm/translator/hopt/irfactory.h +++ b/hphp/runtime/vm/translator/hopt/irfactory.h @@ -26,7 +26,7 @@ #include "runtime/vm/translator/hopt/cse.h" #include "runtime/base/memory/memory_manager.h" -namespace HPHP { namespace VM { namespace JIT { +namespace HPHP { namespace JIT { ////////////////////////////////////////////////////////////////////// @@ -267,6 +267,6 @@ private: ////////////////////////////////////////////////////////////////////// -}}} +}} #endif diff --git a/hphp/runtime/vm/translator/hopt/irtranslator.cpp b/hphp/runtime/vm/translator/hopt/irtranslator.cpp index b0aba059e..4f825d977 100644 --- a/hphp/runtime/vm/translator/hopt/irtranslator.cpp +++ b/hphp/runtime/vm/translator/hopt/irtranslator.cpp @@ -44,7 +44,6 @@ #include "util/assert_throw.h" namespace HPHP { -namespace VM { namespace Transl { using namespace reg; @@ -66,7 +65,7 @@ static const bool debug = false; * tx64LocPhysicalOffset -- * * The translator uses the stack pointer slightly differently from - * VM::Stack. Consequently, the translated code accesses slightly + * Stack. Consequently, the translated code accesses slightly * different offsets from rVmSp than the C++ runtime. */ static inline int @@ -1923,7 +1922,7 @@ void TranslatorX64::hhirTraceCodeGen(vector* bcMap) { using namespace JIT; assert(m_useHHIR); - Trace* trace = m_hhbcTrans->getTrace(); + HPHP::JIT::Trace* trace = m_hhbcTrans->getTrace(); auto finishPass = [&](const char* msg, int level, const RegAllocInfo* regs = nullptr, const LifetimeInfo* lifetime = nullptr) { @@ -1970,4 +1969,4 @@ void TranslatorX64::hhirTraceFree() { m_irFactory.reset(); } -}}} +}} diff --git a/hphp/runtime/vm/translator/hopt/jumpsopts.cpp b/hphp/runtime/vm/translator/hopt/jumpsopts.cpp index e7d8f3728..f420c45e1 100644 --- a/hphp/runtime/vm/translator/hopt/jumpsopts.cpp +++ b/hphp/runtime/vm/translator/hopt/jumpsopts.cpp @@ -18,7 +18,7 @@ #include "runtime/vm/translator/hopt/opt.h" #include "runtime/vm/translator/hopt/irfactory.h" -namespace HPHP { namespace VM { namespace JIT { +namespace HPHP { namespace JIT { // These are the conditional branches supported for direct branch // to their target trace at TraceExit, TraceExitType::NormalCc @@ -192,4 +192,4 @@ void optimizeJumps(Trace* trace, IRFactory* irFactory) { } } -}}} +}} diff --git a/hphp/runtime/vm/translator/hopt/linearscan.cpp b/hphp/runtime/vm/translator/hopt/linearscan.cpp index eab2d2b51..7c932ac47 100644 --- a/hphp/runtime/vm/translator/hopt/linearscan.cpp +++ b/hphp/runtime/vm/translator/hopt/linearscan.cpp @@ -28,7 +28,6 @@ #include namespace HPHP { -namespace VM { namespace JIT{ using namespace Transl::reg; @@ -1491,4 +1490,4 @@ RegAllocInfo allocRegsForTrace(Trace* trace, IRFactory* irFactory, return LinearScan(irFactory).allocRegs(trace, lifetime); } -}}} // HPHP::VM::JIT +}} // HPHP::JIT diff --git a/hphp/runtime/vm/translator/hopt/linearscan.h b/hphp/runtime/vm/translator/hopt/linearscan.h index 3c8c78d19..ce92051d1 100644 --- a/hphp/runtime/vm/translator/hopt/linearscan.h +++ b/hphp/runtime/vm/translator/hopt/linearscan.h @@ -21,7 +21,7 @@ #include "runtime/vm/translator/physreg.h" #include "runtime/vm/translator/abi-x64.h" -namespace HPHP { namespace VM { namespace JIT { +namespace HPHP { namespace JIT { class Trace; class IRFactory; @@ -215,6 +215,6 @@ inline int SpillInfo::offset() const { return (m_val + 1) * sizeof(uint64_t); } -}}} +}} #endif diff --git a/hphp/runtime/vm/translator/hopt/memelim.cpp b/hphp/runtime/vm/translator/hopt/memelim.cpp index d4a6f9c6b..b8a06459e 100644 --- a/hphp/runtime/vm/translator/hopt/memelim.cpp +++ b/hphp/runtime/vm/translator/hopt/memelim.cpp @@ -23,7 +23,6 @@ #include "runtime/vm/translator/hopt/simplifier.h" namespace HPHP { -namespace VM { namespace JIT { static const HPHP::Trace::Module TRACEMOD = HPHP::Trace::hhir; @@ -824,4 +823,4 @@ void optimizeMemoryAccesses(Trace* trace, IRFactory* factory) { } } -} } } +} } diff --git a/hphp/runtime/vm/translator/hopt/nativecalls.cpp b/hphp/runtime/vm/translator/hopt/nativecalls.cpp index bbe794555..0d6fb976a 100644 --- a/hphp/runtime/vm/translator/hopt/nativecalls.cpp +++ b/hphp/runtime/vm/translator/hopt/nativecalls.cpp @@ -22,10 +22,10 @@ #include "runtime/vm/translator/translator-runtime.h" #include "runtime/vm/translator/hopt/ir.h" -namespace HPHP { namespace VM { namespace JIT { namespace NativeCalls { +namespace HPHP { namespace JIT { namespace NativeCalls { -using namespace HPHP::VM::Transl; -using namespace HPHP::VM::Transl::TargetCache; +using namespace HPHP::Transl; +using namespace HPHP::Transl::TargetCache; static const SyncOptions SNone = kNoSyncPoint; static const SyncOptions SSync = kSyncPoint; @@ -270,4 +270,4 @@ const CallInfo& CallMap::getInfo(Opcode op) { return it->second; } -} } } } +} } } diff --git a/hphp/runtime/vm/translator/hopt/nativecalls.h b/hphp/runtime/vm/translator/hopt/nativecalls.h index d5bb95d2d..1f485e452 100644 --- a/hphp/runtime/vm/translator/hopt/nativecalls.h +++ b/hphp/runtime/vm/translator/hopt/nativecalls.h @@ -23,7 +23,7 @@ #include "runtime/vm/translator/types.h" #include "runtime/vm/translator/hopt/codegen.h" -namespace HPHP { namespace VM { namespace JIT { namespace NativeCalls { +namespace HPHP { namespace JIT { namespace NativeCalls { // Information about C++ helpers called by translated code, used by // CodeGenerator and LinearScan. See nativecalls.cpp for a full @@ -81,6 +81,6 @@ private: CallInfoMap m_map; }; -} } } } +} } } #endif diff --git a/hphp/runtime/vm/translator/hopt/opt.cpp b/hphp/runtime/vm/translator/hopt/opt.cpp index 955589264..f5446c0ea 100644 --- a/hphp/runtime/vm/translator/hopt/opt.cpp +++ b/hphp/runtime/vm/translator/hopt/opt.cpp @@ -21,7 +21,6 @@ #include "runtime/vm/translator/hopt/check.h" namespace HPHP { -namespace VM { namespace JIT { // insert inst after the point dst is defined @@ -141,4 +140,4 @@ void optimizeTrace(Trace* trace, TraceBuilder* traceBuilder) { } } -} } } +} } diff --git a/hphp/runtime/vm/translator/hopt/opt.h b/hphp/runtime/vm/translator/hopt/opt.h index e31a7c77f..1649e45ba 100644 --- a/hphp/runtime/vm/translator/hopt/opt.h +++ b/hphp/runtime/vm/translator/hopt/opt.h @@ -16,7 +16,7 @@ #ifndef incl_HPHP_HHIR_OPT_H_ #define incl_HPHP_HHIR_OPT_H_ -namespace HPHP { namespace VM { namespace JIT { +namespace HPHP { namespace JIT { class Trace; class TraceBuilder; @@ -35,6 +35,6 @@ void optimizeJumps(Trace*, IRFactory*); */ void optimizeTrace(Trace*, TraceBuilder*); -}}} +}} #endif diff --git a/hphp/runtime/vm/translator/hopt/print.cpp b/hphp/runtime/vm/translator/hopt/print.cpp index 80ac9f1e7..a6cb7089d 100644 --- a/hphp/runtime/vm/translator/hopt/print.cpp +++ b/hphp/runtime/vm/translator/hopt/print.cpp @@ -23,7 +23,7 @@ #include "util/disasm.h" #include "util/text_color.h" -namespace HPHP { namespace VM { namespace JIT { +namespace HPHP { namespace JIT { ////////////////////////////////////////////////////////////////////// @@ -421,5 +421,5 @@ void dumpTrace(int level, const Trace* trace, const char* caption, } } -}}} +}} diff --git a/hphp/runtime/vm/translator/hopt/print.h b/hphp/runtime/vm/translator/hopt/print.h index ef089e516..38f0b2f4a 100644 --- a/hphp/runtime/vm/translator/hopt/print.h +++ b/hphp/runtime/vm/translator/hopt/print.h @@ -22,7 +22,6 @@ #include "runtime/vm/translator/hopt/linearscan.h" namespace HPHP { -namespace VM { namespace JIT { struct IRInstruction; @@ -75,6 +74,6 @@ void dumpTrace(int level, const Trace* trace, const char* caption, const LifetimeInfo* lifetime = nullptr, AsmInfo* ai = nullptr); -}}} +}} #endif diff --git a/hphp/runtime/vm/translator/hopt/simplifier.cpp b/hphp/runtime/vm/translator/hopt/simplifier.cpp index c70c0ec10..db56b2f51 100644 --- a/hphp/runtime/vm/translator/hopt/simplifier.cpp +++ b/hphp/runtime/vm/translator/hopt/simplifier.cpp @@ -24,7 +24,6 @@ #include "runtime/vm/runtime.h" namespace HPHP { -namespace VM { namespace JIT { TRACE_SET_MOD(hhir); @@ -1686,4 +1685,4 @@ SSATmp* Simplifier::simplifyDecRefStack(IRInstruction* inst) { ////////////////////////////////////////////////////////////////////// -}}} +}} diff --git a/hphp/runtime/vm/translator/hopt/simplifier.h b/hphp/runtime/vm/translator/hopt/simplifier.h index cc9e47f0b..93ee9cc62 100644 --- a/hphp/runtime/vm/translator/hopt/simplifier.h +++ b/hphp/runtime/vm/translator/hopt/simplifier.h @@ -20,7 +20,7 @@ #include "runtime/vm/translator/hopt/cse.h" #include "runtime/vm/translator/hopt/ir.h" -namespace HPHP { namespace VM { namespace JIT { +namespace HPHP { namespace JIT { ////////////////////////////////////////////////////////////////////// @@ -184,6 +184,6 @@ bool canUseSPropCache(SSATmp* clsTmp, ////////////////////////////////////////////////////////////////////// -}}} +}} #endif diff --git a/hphp/runtime/vm/translator/hopt/state_vector.h b/hphp/runtime/vm/translator/hopt/state_vector.h index 8f8a04b8a..4bee7d9e0 100644 --- a/hphp/runtime/vm/translator/hopt/state_vector.h +++ b/hphp/runtime/vm/translator/hopt/state_vector.h @@ -21,7 +21,7 @@ #include "runtime/vm/translator/hopt/irfactory.h" -namespace HPHP { namespace VM { namespace JIT { +namespace HPHP { namespace JIT { ////////////////////////////////////////////////////////////////////// @@ -98,6 +98,6 @@ private: ////////////////////////////////////////////////////////////////////// -}}} +}} #endif diff --git a/hphp/runtime/vm/translator/hopt/test/type.cpp b/hphp/runtime/vm/translator/hopt/test/type.cpp index 5b67f7eb5..dde8f3d84 100644 --- a/hphp/runtime/vm/translator/hopt/test/type.cpp +++ b/hphp/runtime/vm/translator/hopt/test/type.cpp @@ -20,12 +20,12 @@ #include "runtime/vm/translator/hopt/ir.h" namespace std { namespace tr1 { - template<> struct hash { - size_t operator()(HPHP::VM::JIT::Type t) const { return t.hash(); } + template<> struct hash { + size_t operator()(HPHP::JIT::Type t) const { return t.hash(); } }; } } -namespace HPHP { namespace VM { namespace JIT { +namespace HPHP { namespace JIT { namespace { @@ -159,4 +159,4 @@ TEST(Type, UnionOf) { EXPECT_EQ(Type::Gen, Type::unionOf(Type::Cell, Type::BoxedInt)); } -} } } +} } diff --git a/hphp/runtime/vm/translator/hopt/test/vector.cpp b/hphp/runtime/vm/translator/hopt/test/vector.cpp index 9d94f8e94..bf89797d8 100644 --- a/hphp/runtime/vm/translator/hopt/test/vector.cpp +++ b/hphp/runtime/vm/translator/hopt/test/vector.cpp @@ -21,7 +21,7 @@ #include "util/base.h" #include "runtime/vm/translator/hopt/ir.h" -namespace HPHP { namespace VM { namespace JIT { +namespace HPHP { namespace JIT { #define EXPECT_TEQ(exp, act) \ EXPECT_EQ(exp, act) \ @@ -95,4 +95,4 @@ TEST(VectorEffects, UnknownBase) { EXPECT_TRUE(ve.valTypeChanged); } -} } } +} } diff --git a/hphp/runtime/vm/translator/hopt/tracebuilder.cpp b/hphp/runtime/vm/translator/hopt/tracebuilder.cpp index 1613b252d..b923b2c1c 100644 --- a/hphp/runtime/vm/translator/hopt/tracebuilder.cpp +++ b/hphp/runtime/vm/translator/hopt/tracebuilder.cpp @@ -23,7 +23,6 @@ #include "runtime/vm/translator/hopt/irfactory.h" namespace HPHP { -namespace VM { namespace JIT { static const HPHP::Trace::Module TRACEMOD = HPHP::Trace::hhir; @@ -1086,4 +1085,4 @@ void TraceBuilder::killLocals() { } } -}}} // namespace HPHP::VM::JIT +}} // namespace HPHP::JIT diff --git a/hphp/runtime/vm/translator/hopt/tracebuilder.h b/hphp/runtime/vm/translator/hopt/tracebuilder.h index d53d126c9..f20464bb8 100644 --- a/hphp/runtime/vm/translator/hopt/tracebuilder.h +++ b/hphp/runtime/vm/translator/hopt/tracebuilder.h @@ -27,7 +27,7 @@ #include "folly/ScopeGuard.h" -namespace HPHP { namespace VM { namespace JIT { +namespace HPHP { namespace JIT { ////////////////////////////////////////////////////////////////////// @@ -454,6 +454,6 @@ private: ////////////////////////////////////////////////////////////////////// -}}} +}} #endif diff --git a/hphp/runtime/vm/translator/hopt/type.cpp b/hphp/runtime/vm/translator/hopt/type.cpp index 63606737f..a943d34c4 100644 --- a/hphp/runtime/vm/translator/hopt/type.cpp +++ b/hphp/runtime/vm/translator/hopt/type.cpp @@ -21,9 +21,9 @@ #include "util/trace.h" #include "runtime/vm/translator/hopt/ir.h" -using namespace HPHP::VM::Transl; +using namespace HPHP::Transl; -namespace HPHP { namespace VM { namespace JIT { +namespace HPHP { namespace JIT { TRACE_SET_MOD(hhir); @@ -306,5 +306,5 @@ void assertOperandTypes(const IRInstruction* inst) { ////////////////////////////////////////////////////////////////////// -}}} +}} diff --git a/hphp/runtime/vm/translator/hopt/vectortranslator-internal.h b/hphp/runtime/vm/translator/hopt/vectortranslator-internal.h index 93fdf7f12..24e22414c 100644 --- a/hphp/runtime/vm/translator/hopt/vectortranslator-internal.h +++ b/hphp/runtime/vm/translator/hopt/vectortranslator-internal.h @@ -23,7 +23,7 @@ #include "runtime/vm/translator/translator.h" #include "runtime/vm/member_operations.h" -namespace HPHP { namespace VM { namespace JIT { +namespace HPHP { namespace JIT { #define CTX() cns(contextClass()) @@ -143,6 +143,6 @@ static inline TypedValue* keyPtr(TypedValue& key) { } } -} } } +} } #endif diff --git a/hphp/runtime/vm/translator/hopt/vectortranslator.cpp b/hphp/runtime/vm/translator/hopt/vectortranslator.cpp index 7c41b0217..ba0759349 100644 --- a/hphp/runtime/vm/translator/hopt/vectortranslator.cpp +++ b/hphp/runtime/vm/translator/hopt/vectortranslator.cpp @@ -24,11 +24,11 @@ #include "util/assert_throw.h" #include "runtime/vm/translator/hopt/vectortranslator-internal.h" -namespace HPHP { namespace VM { namespace JIT { +namespace HPHP { namespace JIT { TRACE_SET_MOD(hhir); -using HPHP::VM::Transl::Location; +using HPHP::Transl::Location; static bool wantPropSpecializedWarnings() { return !RuntimeOption::RepoAuthoritative || @@ -569,7 +569,7 @@ void HhbcTranslator::VectorTranslator::emitBaseLCR() { // Str key? bool HhbcTranslator::VectorTranslator::isSimpleArrayOp() { SSATmp* base = getInput(m_mii.valCount()); - HPHP::VM::Op op = m_ni.mInstrOp(); + HPHP::Op op = m_ni.mInstrOp(); if ((op == OpSetM || op == OpCGetM || op == OpIssetM) && isSimpleBase() && isSingleMember() && @@ -1136,7 +1136,7 @@ template static inline RefData* vGetPropImpl(Class* ctx, TypedValue* base, TypedValue keyVal, MInstrState* mis) { TypedValue* key = keyPtr(keyVal); - TypedValue* result = HPHP::VM::Prop( + TypedValue* result = HPHP::Prop( mis->tvScratch, mis->tvRef, ctx, base, key); if (result->m_type != KindOfRef) { @@ -1178,7 +1178,7 @@ void HhbcTranslator::VectorTranslator::emitVGetProp() { template static inline bool issetEmptyPropImpl(Class* ctx, TypedValue* base, TypedValue keyVal) { - return HPHP::VM::IssetEmptyProp(ctx, base, &keyVal); + return HPHP::IssetEmptyProp(ctx, base, &keyVal); } #define HELPER_TABLE(m) \ @@ -1219,7 +1219,7 @@ void HhbcTranslator::VectorTranslator::emitEmptyProp() { template static inline TypedValue setPropImpl(Class* ctx, TypedValue* base, TypedValue keyVal, Cell val) { - HPHP::VM::SetProp(ctx, base, &keyVal, &val); + HPHP::SetProp(ctx, base, &keyVal, &val); return val; } @@ -1269,7 +1269,7 @@ void HhbcTranslator::VectorTranslator::emitSetProp() { template static inline TypedValue setOpPropImpl(TypedValue* base, TypedValue keyVal, Cell val, MInstrState* mis, SetOpOp op) { - TypedValue* result = HPHP::VM::SetOpProp( + TypedValue* result = HPHP::SetOpProp( mis->tvScratch, mis->tvRef, mis->ctx, op, base, &keyVal, &val); TypedValue ret; @@ -1312,7 +1312,7 @@ static inline TypedValue incDecPropImpl(TypedValue* base, TypedValue keyVal, MInstrState* mis, IncDecOp op) { TypedValue result; result.m_type = KindOfUninit; - HPHP::VM::IncDecProp( + HPHP::IncDecProp( mis->tvScratch, mis->tvRef, mis->ctx, op, base, &keyVal, result); assert(result.m_type != KindOfRef); return result; @@ -1351,7 +1351,7 @@ void HhbcTranslator::VectorTranslator::emitIncDecProp() { template static inline void bindPropImpl(Class* ctx, TypedValue* base, TypedValue keyVal, RefData* val, MInstrState* mis) { - TypedValue* prop = HPHP::VM::Prop( + TypedValue* prop = HPHP::Prop( mis->tvScratch, mis->tvRef, ctx, base, &keyVal); if (!(prop == &mis->tvScratch && prop->m_type == KindOfUninit)) { tvBindRef(val, prop); @@ -1388,7 +1388,7 @@ void HhbcTranslator::VectorTranslator::emitBindProp() { template static inline void unsetPropImpl(Class* ctx, TypedValue* base, TypedValue keyVal) { - HPHP::VM::UnsetProp(ctx, base, &keyVal); + HPHP::UnsetProp(ctx, base, &keyVal); } #define HELPER_TABLE(m) \ @@ -1536,7 +1536,7 @@ template static inline RefData* vGetElemImpl(TypedValue* base, TypedValue keyVal, MInstrState* mis) { TypedValue* key = keyPtr(keyVal); - TypedValue* result = HPHP::VM::ElemD( + TypedValue* result = HPHP::ElemD( mis->tvScratch, mis->tvRef, base, key); if (result->m_type != KindOfRef) { @@ -1578,7 +1578,7 @@ static inline bool issetEmptyElemImpl(TypedValue* base, TypedValue keyVal, // mis == nullptr if we proved that it won't be used. mis->tvScratch and // mis->tvRef are ok because those params are passed by // reference. - return HPHP::VM::IssetEmptyElem( + return HPHP::IssetEmptyElem( mis->tvScratch, mis->tvRef, base, key); } @@ -1770,7 +1770,7 @@ template static inline TypedValue setElemImpl(TypedValue* base, TypedValue keyVal, Cell val) { TypedValue* key = keyPtr(keyVal); - HPHP::VM::SetElem(base, key, &val); + HPHP::SetElem(base, key, &val); return val; } @@ -1812,7 +1812,7 @@ template static inline TypedValue setOpElemImpl(TypedValue* base, TypedValue keyVal, Cell val, MInstrState* mis) { TypedValue* result = - HPHP::VM::SetOpElem(mis->tvScratch, mis->tvRef, op, base, &keyVal, &val); + HPHP::SetOpElem(mis->tvScratch, mis->tvRef, op, base, &keyVal, &val); TypedValue ret; tvReadCell(result, &ret); @@ -1853,7 +1853,7 @@ template static inline TypedValue incDecElemImpl(TypedValue* base, TypedValue keyVal, MInstrState* mis) { TypedValue result; - HPHP::VM::IncDecElem( + HPHP::IncDecElem( mis->tvScratch, mis->tvRef, op, base, &keyVal, result); assert(result.m_type != KindOfRef); return result; @@ -1886,7 +1886,7 @@ void HhbcTranslator::VectorTranslator::emitIncDecElem() { namespace VectorHelpers { void bindElemC(TypedValue* base, TypedValue keyVal, RefData* val, MInstrState* mis) { - base = HPHP::VM::ElemD(mis->tvScratch, mis->tvRef, base, &keyVal); + base = HPHP::ElemD(mis->tvScratch, mis->tvRef, base, &keyVal); if (!(base == &mis->tvScratch && base->m_type == KindOfUninit)) { tvBindRef(val, base); } @@ -1905,7 +1905,7 @@ void HhbcTranslator::VectorTranslator::emitBindElem() { template static inline void unsetElemImpl(TypedValue* base, TypedValue keyVal) { TypedValue* key = keyPtr(keyVal); - HPHP::VM::UnsetElem(base, key); + HPHP::UnsetElem(base, key); } #define HELPER_TABLE(m) \ @@ -2127,4 +2127,4 @@ int HhbcTranslator::VectorTranslator::ratchetInd() const { return needFirstRatchet() ? int(m_mInd) : int(m_mInd) - 1; } -} } } +} } diff --git a/hphp/runtime/vm/translator/immstack.cpp b/hphp/runtime/vm/translator/immstack.cpp index c86e9169c..5cb6d3037 100644 --- a/hphp/runtime/vm/translator/immstack.cpp +++ b/hphp/runtime/vm/translator/immstack.cpp @@ -17,7 +17,6 @@ #include namespace HPHP { -namespace VM { /////////////////////////////////////////////////////////////////////////////// void ImmStack::processOpcode(const Opcode* opcode) { @@ -102,4 +101,3 @@ bool ImmStack::isLitstr(int above) { } } -} diff --git a/hphp/runtime/vm/translator/immstack.h b/hphp/runtime/vm/translator/immstack.h index f7962e8da..4676ff8e3 100644 --- a/hphp/runtime/vm/translator/immstack.h +++ b/hphp/runtime/vm/translator/immstack.h @@ -20,7 +20,6 @@ #include namespace HPHP { -namespace VM { /////////////////////////////////////////////////////////////////////////////// class ImmStack { @@ -69,6 +68,5 @@ private: /////////////////////////////////////////////////////////////////////////////// } -} #endif diff --git a/hphp/runtime/vm/translator/physreg.cpp b/hphp/runtime/vm/translator/physreg.cpp index ba826de08..2808d2fa0 100644 --- a/hphp/runtime/vm/translator/physreg.cpp +++ b/hphp/runtime/vm/translator/physreg.cpp @@ -16,7 +16,7 @@ #include "runtime/vm/translator/physreg.h" -namespace HPHP { namespace VM { namespace Transl { +namespace HPHP { namespace Transl { PhysRegSaverParity::PhysRegSaverParity(int parity, X64Assembler& as, RegSet regs) @@ -51,4 +51,4 @@ void PhysRegSaverParity::bytesPushed(int64_t bytes) { m_adjust += bytes; } -} } } +} } diff --git a/hphp/runtime/vm/translator/physreg.h b/hphp/runtime/vm/translator/physreg.h index 2f3033678..b3fa2cc21 100644 --- a/hphp/runtime/vm/translator/physreg.h +++ b/hphp/runtime/vm/translator/physreg.h @@ -19,7 +19,7 @@ #include "util/asm-x64.h" #include "util/bitops.h" -namespace HPHP { namespace VM { namespace Transl { +namespace HPHP { namespace Transl { ////////////////////////////////////////////////////////////////////// @@ -255,7 +255,7 @@ struct PhysRegSaver : public PhysRegSaverParity { ////////////////////////////////////////////////////////////////////// -}}} +}} #endif diff --git a/hphp/runtime/vm/translator/regalloc.cpp b/hphp/runtime/vm/translator/regalloc.cpp index 2dc6467a2..7e41035ef 100644 --- a/hphp/runtime/vm/translator/regalloc.cpp +++ b/hphp/runtime/vm/translator/regalloc.cpp @@ -22,7 +22,7 @@ #include "runtime/base/types.h" #include "util/trace.h" -namespace HPHP { namespace VM { namespace Transl { +namespace HPHP { namespace Transl { using std::set; using namespace reg; @@ -1020,4 +1020,4 @@ std::string RegContent::pretty() const { return std::string(buf); } -} } } // HPHP::VM::Transl +} } // HPHP::Transl diff --git a/hphp/runtime/vm/translator/regalloc.h b/hphp/runtime/vm/translator/regalloc.h index bd9989715..6fe50cc3a 100644 --- a/hphp/runtime/vm/translator/regalloc.h +++ b/hphp/runtime/vm/translator/regalloc.h @@ -23,7 +23,7 @@ #include "runtime/vm/translator/translator.h" #include "runtime/vm/translator/physreg.h" -namespace HPHP { namespace VM { namespace Transl { +namespace HPHP { namespace Transl { // Assumption: the set interfaces are limited to the first 64 registers. static const int kMaxRegs = 64; @@ -469,6 +469,6 @@ private: const PhysReg m_reg; }; -} } } // HPHP::VM::Transl +} } // HPHP::Transl #endif /* incl_HPHP_REG_ALLOC_H_ */ diff --git a/hphp/runtime/vm/translator/runtime-type.cpp b/hphp/runtime/vm/translator/runtime-type.cpp index 6a90a3122..6516a0ebe 100644 --- a/hphp/runtime/vm/translator/runtime-type.cpp +++ b/hphp/runtime/vm/translator/runtime-type.cpp @@ -23,7 +23,6 @@ #include "runtime/vm/translator/translator.h" namespace HPHP { -namespace VM { namespace Transl { static inline DataType @@ -374,4 +373,4 @@ std::string Location::pretty() const { return std::string(buf); } -} } } +} } diff --git a/hphp/runtime/vm/translator/runtime-type.h b/hphp/runtime/vm/translator/runtime-type.h index 4852f7562..425c45040 100644 --- a/hphp/runtime/vm/translator/runtime-type.h +++ b/hphp/runtime/vm/translator/runtime-type.h @@ -20,7 +20,6 @@ #include "runtime/vm/bytecode.h" namespace HPHP { -namespace VM { namespace Transl { // Location -- @@ -286,6 +285,6 @@ class RuntimeType { std::string pretty() const; }; -} } } +} } #endif // incl_HPHP_RUNTIME_TYPE_H_ diff --git a/hphp/runtime/vm/translator/srcdb.cpp b/hphp/runtime/vm/translator/srcdb.cpp index b47374363..24ce12b2b 100644 --- a/hphp/runtime/vm/translator/srcdb.cpp +++ b/hphp/runtime/vm/translator/srcdb.cpp @@ -24,7 +24,6 @@ #include "runtime/vm/translator/translator-x64.h" namespace HPHP { -namespace VM { namespace Transl { TRACE_SET_MOD(trans) @@ -247,4 +246,4 @@ size_t SrcDB::invalidateCode(const Eval::PhpFile* file) { return i; } -} } } // HPHP::VM::Transl +} } // HPHP::Transl diff --git a/hphp/runtime/vm/translator/srcdb.h b/hphp/runtime/vm/translator/srcdb.h index 09131152c..a683f2d36 100644 --- a/hphp/runtime/vm/translator/srcdb.h +++ b/hphp/runtime/vm/translator/srcdb.h @@ -25,7 +25,6 @@ #include "runtime/vm/tread_hash_map.h" namespace HPHP { -namespace VM { namespace Transl { /* @@ -242,6 +241,6 @@ public: size_t invalidateCode(const Eval::PhpFile* file); }; -} } } +} } #endif diff --git a/hphp/runtime/vm/translator/targetcache.cpp b/hphp/runtime/vm/translator/targetcache.cpp index ba7126f40..d6d77af27 100644 --- a/hphp/runtime/vm/translator/targetcache.cpp +++ b/hphp/runtime/vm/translator/targetcache.cpp @@ -40,7 +40,6 @@ using std::string; * The targetcache module provides a set of per-request caches. */ namespace HPHP { -namespace VM { /* * Put this where the compiler has a chance to inline it. @@ -1147,4 +1146,4 @@ StaticMethodFCache::lookup(Handle handle, const Class* cls, return nullptr; } -} } } } // HPHP::VM::Transl::TargetCache +} } } // HPHP::Transl::TargetCache diff --git a/hphp/runtime/vm/translator/targetcache.h b/hphp/runtime/vm/translator/targetcache.h index a00961273..520b758eb 100644 --- a/hphp/runtime/vm/translator/targetcache.h +++ b/hphp/runtime/vm/translator/targetcache.h @@ -23,7 +23,6 @@ #include namespace HPHP { -namespace VM { namespace Transl { namespace TargetCache { @@ -384,6 +383,6 @@ void methodCacheSlowPath(MethodCache::Pair* mce, StringData* name, Class* cls); -} } } } +} } } #endif diff --git a/hphp/runtime/vm/translator/test/fixup_map.cpp b/hphp/runtime/vm/translator/test/fixup_map.cpp index 8cb395b89..21a3862fe 100644 --- a/hphp/runtime/vm/translator/test/fixup_map.cpp +++ b/hphp/runtime/vm/translator/test/fixup_map.cpp @@ -18,7 +18,7 @@ #include #include "hhvm/process_init.h" -namespace HPHP { namespace VM { namespace Transl { +namespace HPHP { namespace Transl { ////////////////////////////////////////////////////////////////////// @@ -89,4 +89,4 @@ TEST(FixupMap, Concurrent) { ////////////////////////////////////////////////////////////////////// -}}} +}} diff --git a/hphp/runtime/vm/translator/test/tread_hash_map.cpp b/hphp/runtime/vm/translator/test/tread_hash_map.cpp index ef0841117..5dc4b3807 100644 --- a/hphp/runtime/vm/translator/test/tread_hash_map.cpp +++ b/hphp/runtime/vm/translator/test/tread_hash_map.cpp @@ -23,7 +23,7 @@ #include "util/base.h" -namespace HPHP { namespace VM { +namespace HPHP { TEST(TreadHashMap, Iteration) { TreadHashMap thm(64); @@ -46,4 +46,4 @@ TEST(TreadHashMap, Iteration) { } } -}} +} diff --git a/hphp/runtime/vm/translator/trans-data.h b/hphp/runtime/vm/translator/trans-data.h index fea8e50f0..1a1af174d 100644 --- a/hphp/runtime/vm/translator/trans-data.h +++ b/hphp/runtime/vm/translator/trans-data.h @@ -23,7 +23,6 @@ #include namespace HPHP { -namespace VM { namespace Transl { // Interface for classes maintaining meta-data about translations @@ -46,6 +45,6 @@ public: virtual const TransIDSet& getTransSuccs(TransID transId) const = 0; }; -} } } +} } #endif diff --git a/hphp/runtime/vm/translator/translator-deps.cpp b/hphp/runtime/vm/translator/translator-deps.cpp index eecca2fbe..d3ad09ed5 100644 --- a/hphp/runtime/vm/translator/translator-deps.cpp +++ b/hphp/runtime/vm/translator/translator-deps.cpp @@ -18,7 +18,6 @@ #include namespace HPHP { -namespace VM { namespace Transl { PreConstDepMap gPreConsts; @@ -141,4 +140,4 @@ void unmergePreConsts(const PreConstVec& preConsts, void* owner) { } } -} } } // HPHP::VM::Transl +} } // HPHP::Transl diff --git a/hphp/runtime/vm/translator/translator-deps.h b/hphp/runtime/vm/translator/translator-deps.h index c36806323..15f629f67 100644 --- a/hphp/runtime/vm/translator/translator-deps.h +++ b/hphp/runtime/vm/translator/translator-deps.h @@ -30,7 +30,6 @@ // Invalidation tracking for constants namespace HPHP { -namespace VM { namespace Transl { typedef std::vector PreConstPtrVec; @@ -82,6 +81,6 @@ void mergePreConst(const PreConst& preConst); void mergePreConsts(const PreConstVec& preConsts); void unmergePreConsts(const PreConstVec& preConsts, void* owner); -} } } // HPHP::VM::Transl +} } // HPHP::Transl #endif // TRANSLATOR_DEPS_H_ diff --git a/hphp/runtime/vm/translator/translator-inline.h b/hphp/runtime/vm/translator/translator-inline.h index 801b9a9c2..f983ab859 100644 --- a/hphp/runtime/vm/translator/translator-inline.h +++ b/hphp/runtime/vm/translator/translator-inline.h @@ -43,9 +43,9 @@ static inline const uchar*& vmpc() { return g_vmContext->m_pc; } static inline ActRec*& vmFirstAR() { return g_vmContext->m_firstAR; } static inline ActRec* curFrame() { return (ActRec*)vmfp(); } -static inline const VM::Func* curFunc() { return curFrame()->m_func; } -static inline const VM::Unit* curUnit() { return curFunc()->unit(); } -static inline VM::Class* curClass() { +static inline const Func* curFunc() { return curFrame()->m_func; } +static inline const Unit* curUnit() { return curFunc()->unit(); } +static inline Class* curClass() { const auto* func = curFunc(); auto* cls = func->cls(); if (func->isPseudoMain() || func->isTraitMethod() || cls == nullptr) { @@ -54,7 +54,6 @@ static inline VM::Class* curClass() { return cls; } -namespace VM { namespace Transl { static inline uintptr_t tlsBase() { @@ -133,8 +132,8 @@ struct CallerFrame : public VMRegAnchor { }; #define SYNC_VM_REGS_SCOPED() \ - HPHP::VM::Transl::VMRegAnchor _anchorUnused + HPHP::Transl::VMRegAnchor _anchorUnused -} } } // HPHP::VM::Transl +} } // HPHP::Transl #endif diff --git a/hphp/runtime/vm/translator/translator-runtime.cpp b/hphp/runtime/vm/translator/translator-runtime.cpp index 888ed44ad..2e44fe65e 100644 --- a/hphp/runtime/vm/translator/translator-runtime.cpp +++ b/hphp/runtime/vm/translator/translator-runtime.cpp @@ -20,7 +20,7 @@ #include "runtime/vm/member_operations.h" #include "runtime/vm/type_constraint.h" -namespace HPHP { namespace VM { namespace Transl { +namespace HPHP { namespace Transl { ArrayData* addElemIntKeyHelper(ArrayData* ad, int64_t key, @@ -305,4 +305,4 @@ RefData* staticLocInitCached(StringData* name, ActRec* fp, TypedValue val, return staticLocInitImpl(name, fp, val, ch); } -} } } +} } diff --git a/hphp/runtime/vm/translator/translator-runtime.h b/hphp/runtime/vm/translator/translator-runtime.h index 5693dc2b9..e6fb99876 100644 --- a/hphp/runtime/vm/translator/translator-runtime.h +++ b/hphp/runtime/vm/translator/translator-runtime.h @@ -20,7 +20,7 @@ #include "runtime/vm/translator/abi-x64.h" #include "runtime/vm/translator/targetcache.h" -namespace HPHP { namespace VM { namespace Transl { +namespace HPHP { namespace Transl { struct MInstrState { // Room for this structure is allocated on the stack before we @@ -116,6 +116,6 @@ RefData* staticLocInit(StringData* name, ActRec* fp, TypedValue val); RefData* staticLocInitCached(StringData* name, ActRec* fp, TypedValue val, TargetCache::CacheHandle ch); -} } } +} } #endif diff --git a/hphp/runtime/vm/translator/translator-x64-helpers.cpp b/hphp/runtime/vm/translator/translator-x64-helpers.cpp index 4ab69962b..4813b4f8e 100644 --- a/hphp/runtime/vm/translator/translator-x64-helpers.cpp +++ b/hphp/runtime/vm/translator/translator-x64-helpers.cpp @@ -22,7 +22,6 @@ #include namespace HPHP { -namespace VM { namespace Transl { inline bool @@ -271,4 +270,4 @@ void functionEnterHelper(const ActRec* ar) { sp = g_vmContext->m_stack.top(); } -} } } // HPHP::VM::Transl +} } // HPHP::Transl diff --git a/hphp/runtime/vm/translator/translator-x64-internal.h b/hphp/runtime/vm/translator/translator-x64-internal.h index dee931260..87b575616 100644 --- a/hphp/runtime/vm/translator/translator-x64-internal.h +++ b/hphp/runtime/vm/translator/translator-x64-internal.h @@ -22,13 +22,12 @@ #include -using namespace HPHP::VM::Transl::reg; +using namespace HPHP::Transl::reg; using namespace HPHP::Util; using namespace HPHP::Trace; using std::max; namespace HPHP { -namespace VM { namespace Transl { static const Trace::Module TRACEMOD = Trace::tx64; @@ -912,7 +911,7 @@ inline void emitCopyToAligned(X64Assembler& a, // ArgManager -- support for passing VM-level data to helper functions. class ArgManager { - typedef HPHP::VM::Transl::X64Assembler& A; + typedef HPHP::Transl::X64Assembler& A; public: ArgManager(TranslatorX64 &tx64, A& a) : m_tx64(tx64), m_a(a) { } @@ -1048,7 +1047,7 @@ struct Deleter : private boost::noncopyable { T** p; }; -}}} +}} #endif diff --git a/hphp/runtime/vm/translator/translator-x64-vector.cpp b/hphp/runtime/vm/translator/translator-x64-vector.cpp index 3d9d73fe0..8bce1d20e 100644 --- a/hphp/runtime/vm/translator/translator-x64-vector.cpp +++ b/hphp/runtime/vm/translator/translator-x64-vector.cpp @@ -29,7 +29,6 @@ #include namespace HPHP { -namespace VM { namespace Transl { /* @@ -3275,4 +3274,4 @@ TranslatorX64::translateFPassM(const Tracelet& t, } } -}}} +}} diff --git a/hphp/runtime/vm/translator/translator-x64.cpp b/hphp/runtime/vm/translator/translator-x64.cpp index bb7ac872e..693ee4512 100644 --- a/hphp/runtime/vm/translator/translator-x64.cpp +++ b/hphp/runtime/vm/translator/translator-x64.cpp @@ -93,7 +93,6 @@ typedef __sighandler_t *sighandler_t; #include "runtime/vm/translator/translator-x64-internal.h" namespace HPHP { -namespace VM { namespace Transl { using namespace reg; @@ -2981,9 +2980,9 @@ TranslatorX64::enterTC(TCA start, void* data) { sk = SrcKey(curFunc(), newPc); start = getTranslation(sk, true); } - assert(start == (TCA)HPHP::VM::Transl::funcBodyHelperThunk || + assert(start == (TCA)HPHP::Transl::funcBodyHelperThunk || isValidCodeAddress(start) || - (start == (TCA)HPHP::VM::Transl::fcallHelperThunk && + (start == (TCA)HPHP::Transl::fcallHelperThunk && info.saved_rStashedAr == (uintptr_t)data)); assert(!s_writeLease.amOwner()); const Func* func = (vmfp() ? (ActRec*)vmfp() : (ActRec*)data)->m_func; @@ -9348,7 +9347,7 @@ TranslatorX64::findCuf(const NormalizedInstruction& ni, StringData* sclass = nullptr; StringData* sname = nullptr; if (str) { - Func* f = HPHP::VM::Unit::lookupFunc(str); + Func* f = HPHP::Unit::lookupFunc(str); if (f) return f; String name(const_cast(str)); int pos = name.find("::"); @@ -9384,7 +9383,7 @@ TranslatorX64::findCuf(const NormalizedInstruction& ni, } else if (sclass->isame(s_static.get())) { return nullptr; } else { - cls = VM::Unit::lookupUniqueClass(sclass); + cls = Unit::lookupUniqueClass(sclass); if (!cls) return nullptr; } @@ -12260,7 +12259,7 @@ void TranslatorX64::invalidateOutLocal(const NormalizedInstruction& ni) { } } -} // HPHP::VM::Transl +} // HPHP::Transl static const Trace::Module TRACEMOD = Trace::tx64; @@ -12313,4 +12312,4 @@ void ArgManager::addRegPlus(PhysReg reg, int32_t off) { } -} } // HPHP::VM +} // HPHP::VM diff --git a/hphp/runtime/vm/translator/translator-x64.h b/hphp/runtime/vm/translator/translator-x64.h index 138441b85..af3977b4a 100644 --- a/hphp/runtime/vm/translator/translator-x64.h +++ b/hphp/runtime/vm/translator/translator-x64.h @@ -33,15 +33,15 @@ namespace HPHP { class ExecutionContext; } -namespace HPHP { namespace VM { namespace JIT { +namespace HPHP { namespace JIT { class HhbcTranslator; class IRFactory; class CSEHash; class TraceBuilder; class CodeGenerator; -}}} +}} -namespace HPHP { namespace VM { namespace Transl { +namespace HPHP { namespace Transl { class IRTranslator; class MVecTransState; @@ -113,8 +113,8 @@ class TranslatorX64 : public Translator friend class RedirectSpillFill; friend class Tx64Reaper; friend class IRTranslator; - friend class HPHP::VM::JIT::CodeGenerator; - friend class HPHP::VM::JIT::HhbcTranslator; // packBitVec() + friend class HPHP::JIT::CodeGenerator; + friend class HPHP::JIT::HhbcTranslator; // packBitVec() friend TCA funcBodyHelper(ActRec* fp); template friend class CondBlock; template friend class JccBlock; @@ -1224,6 +1224,6 @@ struct SpaceRecorder { typedef const int COff; // Const offsets -}}} +}} #endif diff --git a/hphp/runtime/vm/translator/translator.cpp b/hphp/runtime/vm/translator/translator.cpp index 57b1ccc77..124c0c4c6 100644 --- a/hphp/runtime/vm/translator/translator.cpp +++ b/hphp/runtime/vm/translator/translator.cpp @@ -45,10 +45,9 @@ #include "runtime/vm/runtime.h" namespace HPHP { -namespace VM { namespace Transl { -using namespace HPHP::VM; +using namespace HPHP; TRACE_SET_MOD(trans) @@ -3918,4 +3917,4 @@ std::string traceletShape(const Tracelet& trace) { return ret; } -} } } +} } diff --git a/hphp/runtime/vm/translator/translator.h b/hphp/runtime/vm/translator/translator.h index 9c21ca8df..4a5abfbe7 100644 --- a/hphp/runtime/vm/translator/translator.h +++ b/hphp/runtime/vm/translator/translator.h @@ -42,7 +42,6 @@ /* Translator front-end. */ namespace HPHP { -namespace VM { namespace Transl { static const bool trustSigSegv = false; @@ -1114,6 +1113,6 @@ static inline bool isSmartPtrRef(DataType t) { t == KindOfArray || t == KindOfObject; } -} } } // HPHP::VM::Transl +} } // HPHP::Transl #endif diff --git a/hphp/runtime/vm/translator/types.h b/hphp/runtime/vm/translator/types.h index 82bfcca63..308855689 100644 --- a/hphp/runtime/vm/translator/types.h +++ b/hphp/runtime/vm/translator/types.h @@ -20,7 +20,6 @@ #include "util/base.h" namespace HPHP { -namespace VM { namespace Transl { /* @@ -44,6 +43,6 @@ struct ctca_identity_hash { typedef uint32_t TransID; typedef hphp_hash_set TransIDSet; -}}} +}} #endif diff --git a/hphp/runtime/vm/translator/unwind-x64.cpp b/hphp/runtime/vm/translator/unwind-x64.cpp index 4407eddb2..96e7694d8 100644 --- a/hphp/runtime/vm/translator/unwind-x64.cpp +++ b/hphp/runtime/vm/translator/unwind-x64.cpp @@ -33,7 +33,7 @@ extern "C" void __register_frame(void*); extern "C" void __deregister_frame(void*); -namespace HPHP { namespace VM { namespace Transl { +namespace HPHP { namespace Transl { ////////////////////////////////////////////////////////////////////// @@ -322,4 +322,4 @@ register_unwind_region(unsigned char* startAddr, size_t size) { ////////////////////////////////////////////////////////////////////// -}}} +}} diff --git a/hphp/runtime/vm/translator/unwind-x64.h b/hphp/runtime/vm/translator/unwind-x64.h index 17acfe6a0..98a525408 100644 --- a/hphp/runtime/vm/translator/unwind-x64.h +++ b/hphp/runtime/vm/translator/unwind-x64.h @@ -30,7 +30,7 @@ #include "util/asm-x64.h" #include "runtime/vm/translator/runtime-type.h" -namespace HPHP { namespace VM { namespace Transl { +namespace HPHP { namespace Transl { ////////////////////////////////////////////////////////////////////// @@ -79,6 +79,6 @@ UnwindInfoHandle register_unwind_region(unsigned char* address, size_t size); ////////////////////////////////////////////////////////////////////// -}}} +}} #endif diff --git a/hphp/runtime/vm/translator/writelease.cpp b/hphp/runtime/vm/translator/writelease.cpp index 5faa95ae2..ff6ab6a32 100644 --- a/hphp/runtime/vm/translator/writelease.cpp +++ b/hphp/runtime/vm/translator/writelease.cpp @@ -20,7 +20,7 @@ #include #include -namespace HPHP { namespace VM { namespace Transl { +namespace HPHP { namespace Transl { TRACE_SET_MOD(txlease); bool @@ -143,4 +143,4 @@ bool LeaseHolderBase::acquire() { return m_haveLock = m_acquired = m_lease.acquire(); } -}}} +}} diff --git a/hphp/runtime/vm/translator/writelease.h b/hphp/runtime/vm/translator/writelease.h index d854919a6..cadb28357 100644 --- a/hphp/runtime/vm/translator/writelease.h +++ b/hphp/runtime/vm/translator/writelease.h @@ -18,7 +18,7 @@ #include -namespace HPHP { namespace VM { namespace Transl { +namespace HPHP { namespace Transl { /* * The write Lease guards write access to the translation caches, @@ -97,6 +97,6 @@ struct BlockingLeaseHolder : public LeaseHolderBase { : LeaseHolderBase(l, ACQUIRE, true) {} }; -}}} // HPHP::VM::Transl +}} // HPHP::Transl #endif /* incl_HPHP_WRITELEASE_H_ */ diff --git a/hphp/runtime/vm/translator/x64-util.h b/hphp/runtime/vm/translator/x64-util.h index c084568dd..2cee23022 100644 --- a/hphp/runtime/vm/translator/x64-util.h +++ b/hphp/runtime/vm/translator/x64-util.h @@ -20,7 +20,6 @@ #include namespace HPHP { -namespace VM { namespace Transl { static inline void @@ -71,5 +70,5 @@ emitTLSLoad(X64Assembler& a, const ThreadLocalNoCheck& datum, emitTLSLoad(a, &datum.m_node.m_p, reg); } -} } } +} } #endif diff --git a/hphp/runtime/vm/tread_hash_map.h b/hphp/runtime/vm/tread_hash_map.h index 3904f3ef3..b21104f3f 100644 --- a/hphp/runtime/vm/tread_hash_map.h +++ b/hphp/runtime/vm/tread_hash_map.h @@ -24,7 +24,7 @@ #include "util/util.h" #include "util/atomic.h" -namespace HPHP { namespace VM { +namespace HPHP { ////////////////////////////////////////////////////////////////////// @@ -239,6 +239,6 @@ private: ////////////////////////////////////////////////////////////////////// -}} +} #endif diff --git a/hphp/runtime/vm/treadmill.cpp b/hphp/runtime/vm/treadmill.cpp index 7c501ebf1..40667170a 100644 --- a/hphp/runtime/vm/treadmill.cpp +++ b/hphp/runtime/vm/treadmill.cpp @@ -28,7 +28,7 @@ #include "treadmill.h" #include "runtime/vm/translator/translator-x64.h" -namespace HPHP { namespace VM { namespace Treadmill { +namespace HPHP { namespace Treadmill { TRACE_SET_MOD(treadmill); @@ -153,4 +153,4 @@ void deferredFree(void* p) { WorkItem::enqueue(new FreeMemoryTrigger(p)); } -}}} +}} diff --git a/hphp/runtime/vm/treadmill.h b/hphp/runtime/vm/treadmill.h index be5975b92..fc6e65e34 100644 --- a/hphp/runtime/vm/treadmill.h +++ b/hphp/runtime/vm/treadmill.h @@ -20,7 +20,6 @@ #include "runtime/vm/unit.h" namespace HPHP { -namespace VM { class Class; class Typedef; @@ -71,6 +70,6 @@ class FreeClassTrigger : public Treadmill::WorkItem { virtual void operator()(); }; -}}} +}} #endif diff --git a/hphp/runtime/vm/type_constraint.cpp b/hphp/runtime/vm/type_constraint.cpp index 7354ff162..a2409f42f 100644 --- a/hphp/runtime/vm/type_constraint.cpp +++ b/hphp/runtime/vm/type_constraint.cpp @@ -26,7 +26,6 @@ #include namespace HPHP { -namespace VM { TRACE_SET_MOD(runtime); @@ -241,5 +240,4 @@ void TypeConstraint::parentToTypeName(const Func* func, } } -} } // HPHP::VM diff --git a/hphp/runtime/vm/type_constraint.h b/hphp/runtime/vm/type_constraint.h index 40140fcb6..873df1b31 100644 --- a/hphp/runtime/vm/type_constraint.h +++ b/hphp/runtime/vm/type_constraint.h @@ -25,7 +25,6 @@ #include namespace HPHP { -namespace VM { class Func; @@ -157,7 +156,6 @@ private: }; } -} diff --git a/hphp/runtime/vm/type_profile.cpp b/hphp/runtime/vm/type_profile.cpp index 5799a7072..a17594f75 100644 --- a/hphp/runtime/vm/type_profile.cpp +++ b/hphp/runtime/vm/type_profile.cpp @@ -27,7 +27,6 @@ #include namespace HPHP { -namespace VM { TRACE_SET_MOD(typeProfile); @@ -300,4 +299,3 @@ bool isProfileOpcode(const PC& pc) { } } -} diff --git a/hphp/runtime/vm/type_profile.h b/hphp/runtime/vm/type_profile.h index 1c401c5e7..d80adffdc 100644 --- a/hphp/runtime/vm/type_profile.h +++ b/hphp/runtime/vm/type_profile.h @@ -23,7 +23,6 @@ namespace HPHP { class StringData; -namespace VM { struct TypeProfileKey { enum KeyType { @@ -54,6 +53,6 @@ static inline bool shouldProfile() { return profileOn; } -} } + } #endif // TYPE_PROFILE_H_ diff --git a/hphp/runtime/vm/unit.cpp b/hphp/runtime/vm/unit.cpp index c7249ce0b..64bb0dd0b 100644 --- a/hphp/runtime/vm/unit.cpp +++ b/hphp/runtime/vm/unit.cpp @@ -44,7 +44,6 @@ #include "runtime/vm/treadmill.h" namespace HPHP { -namespace VM { /////////////////////////////////////////////////////////////////////////////// using Util::getDataRef; @@ -2665,4 +2664,3 @@ Unit* UnitEmitter::create() { /////////////////////////////////////////////////////////////////////////////// } -} diff --git a/hphp/runtime/vm/unit.h b/hphp/runtime/vm/unit.h index 894712020..43b7eab96 100644 --- a/hphp/runtime/vm/unit.h +++ b/hphp/runtime/vm/unit.h @@ -33,7 +33,6 @@ namespace HPHP { // Forward declarations. namespace Compiler { class Peephole; } struct ActRec; -namespace VM { class Func; class FuncEmitter; @@ -489,7 +488,7 @@ struct Unit { static Func *loadFunc(const NamedEntity *ne, const StringData* name); static Func *loadFunc(const StringData* name); - static Class* defClass(const HPHP::VM::PreClass* preClass, + static Class* defClass(const HPHP::PreClass* preClass, bool failIsFatal = true); void defTypedef(Id id); @@ -1092,5 +1091,5 @@ public: Class* popFront(); }; -} } // HPHP::VM + } // HPHP::VM #endif diff --git a/hphp/runtime/vm/verifier/cfg.cpp b/hphp/runtime/vm/verifier/cfg.cpp index ad403ccc7..e75a7d1cc 100644 --- a/hphp/runtime/vm/verifier/cfg.cpp +++ b/hphp/runtime/vm/verifier/cfg.cpp @@ -19,7 +19,6 @@ #include namespace HPHP { -namespace VM { namespace Verifier { /** @@ -303,4 +302,4 @@ void sortRpo(Graph* g) { RpoSort _(g); } -}}} +}} diff --git a/hphp/runtime/vm/verifier/cfg.h b/hphp/runtime/vm/verifier/cfg.h index 1d6739499..baf6debf4 100644 --- a/hphp/runtime/vm/verifier/cfg.h +++ b/hphp/runtime/vm/verifier/cfg.h @@ -22,7 +22,6 @@ #include "util/arena.h" namespace HPHP { -namespace VM { namespace Verifier { /** @@ -265,6 +264,6 @@ inline Offset fpiPast(const FPIEnt& fpi, PC bc) { return fcall + instrLen((Opcode*)fcall) - bc; } -}}} // HPHP::VM::Verifier +}} // HPHP::Verifier #endif // incl_HPHP_VM_VERIFIER_CFG_H_ diff --git a/hphp/runtime/vm/verifier/check.h b/hphp/runtime/vm/verifier/check.h index e08ce9f50..87e80399e 100644 --- a/hphp/runtime/vm/verifier/check.h +++ b/hphp/runtime/vm/verifier/check.h @@ -22,7 +22,6 @@ #define incl_HPHP_VM_VERIFIER_CHECK_H_ namespace HPHP { -namespace VM { class Unit; class Func; @@ -99,6 +98,6 @@ bool checkUnit(const Unit*, bool verbose = false); */ bool checkFunc(const Func*, bool verbose = false); -}}} // HPHP::VM::Verifier +}} // HPHP::Verifier #endif // incl_HPHP_VM_VERIFIER_CHECK_UNIT_H_ diff --git a/hphp/runtime/vm/verifier/check_func.cpp b/hphp/runtime/vm/verifier/check_func.cpp index 0fa399154..6748d5d16 100644 --- a/hphp/runtime/vm/verifier/check_func.cpp +++ b/hphp/runtime/vm/verifier/check_func.cpp @@ -24,7 +24,6 @@ #include namespace HPHP { -namespace VM { namespace Verifier { /** @@ -1075,4 +1074,4 @@ bool FuncChecker::checkRegion(const char* name, Offset b, Offset p, return true; } -}}} // HPHP::VM::Verifier +}} // HPHP::Verifier diff --git a/hphp/runtime/vm/verifier/check_unit.cpp b/hphp/runtime/vm/verifier/check_unit.cpp index 7efd3195a..1c98ea7be 100644 --- a/hphp/runtime/vm/verifier/check_unit.cpp +++ b/hphp/runtime/vm/verifier/check_unit.cpp @@ -22,7 +22,6 @@ #include namespace HPHP { -namespace VM { namespace Verifier { class UnitChecker { @@ -215,4 +214,4 @@ bool UnitChecker::checkFuncs() { return ok; } -}}} // HPHP::VM::Verifier +}} // HPHP::Verifier diff --git a/hphp/runtime/vm/verifier/pretty.cpp b/hphp/runtime/vm/verifier/pretty.cpp index b2a65d941..ecee69eea 100644 --- a/hphp/runtime/vm/verifier/pretty.cpp +++ b/hphp/runtime/vm/verifier/pretty.cpp @@ -24,7 +24,6 @@ #include namespace HPHP { -namespace VM { namespace Verifier { void printInstr(const Unit* unit, PC pc) { @@ -153,4 +152,4 @@ void verify_error(const char* fmt, ...) { printf("Verification: %s", buf); } -}}} // namespace HPHP::VM +}} // namespace HPHP::VM diff --git a/hphp/runtime/vm/verifier/pretty.h b/hphp/runtime/vm/verifier/pretty.h index 69827f686..daa339a10 100644 --- a/hphp/runtime/vm/verifier/pretty.h +++ b/hphp/runtime/vm/verifier/pretty.h @@ -18,7 +18,6 @@ #define incl_HPHP_VM_VERIFIER_PRETTY_H_ namespace HPHP { -namespace VM { class Func; class Unit; @@ -67,6 +66,6 @@ void printGml(const Unit*); */ void verify_error(const char* fmt, ...) __attribute__((format(printf,1,2))); -}}} // HPHP::VM::Verifier +}} // HPHP::Verifier #endif // incl_HPHP_VM_VERIFIER_PRETTY_H diff --git a/hphp/runtime/vm/verifier/util.cpp b/hphp/runtime/vm/verifier/util.cpp index 6b678783f..4211afa0a 100644 --- a/hphp/runtime/vm/verifier/util.cpp +++ b/hphp/runtime/vm/verifier/util.cpp @@ -19,7 +19,7 @@ #include #include -namespace HPHP { namespace VM { namespace Verifier { +namespace HPHP { namespace Verifier { Bits::Bits(Arena& arena, int bit_cap) { int word_cap = (bit_cap + BPW - 1) / BPW; @@ -27,4 +27,4 @@ Bits::Bits(Arena& arena, int bit_cap) { memset(m_words, 0, word_cap * sizeof(*m_words)); } -}}} +}} diff --git a/hphp/runtime/vm/verifier/util.h b/hphp/runtime/vm/verifier/util.h index a87ae858e..6c36272e0 100644 --- a/hphp/runtime/vm/verifier/util.h +++ b/hphp/runtime/vm/verifier/util.h @@ -25,7 +25,6 @@ #include "util/arena.h" namespace HPHP { -namespace VM { namespace Verifier { /** @@ -59,6 +58,6 @@ inline bool contains(const C &c, T e) { return c.find(e) != c.end(); } -}}} // namespace HPHP::VM::Verifier +}} // namespace HPHP::Verifier #endif // incl_HPHP_VM_VERIFIER_UTIL_H diff --git a/hphp/system/lib/systemlib.cpp b/hphp/system/lib/systemlib.cpp index 7d6b9c8dc..f1e00f12d 100644 --- a/hphp/system/lib/systemlib.cpp +++ b/hphp/system/lib/systemlib.cpp @@ -25,7 +25,7 @@ namespace HPHP { /////////////////////////////////////////////////////////////////////////////// #define ALLOC_OBJECT_STUB_RETURN(name) \ - HPHP::VM::Instance::newInstance(SystemLib::s_##name##Class) + HPHP::Instance::newInstance(SystemLib::s_##name##Class) #define ALLOC_OBJECT_STUB(name) \ ObjectData* SystemLib::Alloc##name##Object() { \ @@ -33,26 +33,26 @@ namespace HPHP { } bool SystemLib::s_inited = false; -HPHP::VM::Unit* SystemLib::s_unit = nullptr; -HPHP::VM::Unit* SystemLib::s_nativeFuncUnit = nullptr; -HPHP::VM::Unit* SystemLib::s_nativeClassUnit = nullptr; +HPHP::Unit* SystemLib::s_unit = nullptr; +HPHP::Unit* SystemLib::s_nativeFuncUnit = nullptr; +HPHP::Unit* SystemLib::s_nativeClassUnit = nullptr; #define DEFINE_SYSTEMLIB_CLASS(cls) \ - HPHP::VM::Class* SystemLib::s_ ## cls ## Class = nullptr; + HPHP::Class* SystemLib::s_ ## cls ## Class = nullptr; SYSTEMLIB_CLASSES(DEFINE_SYSTEMLIB_CLASS) #undef DEFINE_SYSTEMLIB_CLASS ObjectData* SystemLib::AllocStdClassObject() { - return HPHP::VM::Instance::newInstance(SystemLib::s_stdclassClass); + return HPHP::Instance::newInstance(SystemLib::s_stdclassClass); } ObjectData* SystemLib::AllocPinitSentinel() { - return HPHP::VM::Instance::newInstance(SystemLib::s_pinitSentinelClass); + return HPHP::Instance::newInstance(SystemLib::s_pinitSentinelClass); } #define CREATE_AND_CONSTRUCT(clsname, params) \ - HPHP::VM::Instance* inst = \ - HPHP::VM::Instance::newInstance(SystemLib::s_##clsname##Class); \ + HPHP::Instance* inst = \ + HPHP::Instance::newInstance(SystemLib::s_##clsname##Class); \ TypedValue ret; \ { \ /* Increment refcount across call to ctor, so the object doesn't */ \ @@ -154,9 +154,9 @@ ObjectData* SystemLib::AllocKeyedIterableViewObject(CVarRef iterable) { #undef CREATE_AND_CONSTRUCT -VM::Func* +Func* SystemLib::GetNullFunction() { - VM::Func* f = s_nativeFuncUnit->firstHoistable(); + Func* f = s_nativeFuncUnit->firstHoistable(); assert(!strcmp(f->name()->data(), "86null")); return f; } diff --git a/hphp/system/lib/systemlib.h b/hphp/system/lib/systemlib.h index cd87ec316..148ce8e0e 100644 --- a/hphp/system/lib/systemlib.h +++ b/hphp/system/lib/systemlib.h @@ -23,11 +23,9 @@ namespace HPHP { /////////////////////////////////////////////////////////////////////////////// class ObjectData; -namespace VM { class Unit; class Class; class Func; -} namespace Eval { class PhpFile; } @@ -71,17 +69,17 @@ namespace Eval { class SystemLib { public: static bool s_inited; - static HPHP::VM::Unit* s_unit; - static HPHP::VM::Unit* s_nativeFuncUnit; - static HPHP::VM::Unit* s_nativeClassUnit; + static HPHP::Unit* s_unit; + static HPHP::Unit* s_nativeFuncUnit; + static HPHP::Unit* s_nativeClassUnit; #define DECLARE_SYSTEMLIB_CLASS(cls) \ - static HPHP::VM::Class* s_ ## cls ## Class; + static HPHP::Class* s_ ## cls ## Class; SYSTEMLIB_CLASSES(DECLARE_SYSTEMLIB_CLASS) #undef DECLARE_SYSTEMLIB_CLASS - static HPHP::VM::Func* GetNullFunction(); + static HPHP::Func* GetNullFunction(); static ObjectData* AllocStdClassObject(); diff --git a/hphp/tools/gen-ext-hhvm/gen-ext-hhvm.cpp b/hphp/tools/gen-ext-hhvm/gen-ext-hhvm.cpp index 8ac12f922..fabc62c9b 100644 --- a/hphp/tools/gen-ext-hhvm/gen-ext-hhvm.cpp +++ b/hphp/tools/gen-ext-hhvm/gen-ext-hhvm.cpp @@ -56,11 +56,11 @@ constexpr char* g_allIncludes = R"( void emitCtorHelper(const fbstring& className, std::ostream& out) { out << folly::format( R"( -HPHP::VM::Instance* new_{0:s}_Instance(HPHP::VM::Class* cls) {{ +HPHP::Instance* new_{0:s}_Instance(HPHP::Class* cls) {{ size_t nProps = cls->numDeclProperties(); size_t builtinPropSize = sizeof(c_{0:s}) - sizeof(ObjectData); - size_t size = HPHP::VM::Instance::sizeForNProps(nProps) + builtinPropSize; - HPHP::VM::Instance *inst = (HPHP::VM::Instance*)ALLOCOBJSZ(size); + size_t size = HPHP::Instance::sizeForNProps(nProps) + builtinPropSize; + HPHP::Instance *inst = (HPHP::Instance*)ALLOCOBJSZ(size); new ((void *)inst) c_{0:s}(cls); return inst; }})", diff --git a/hphp/tools/gen-ext-hhvm/gen-infotabs.cpp b/hphp/tools/gen-ext-hhvm/gen-infotabs.cpp index 25f1353e7..f55ee8673 100644 --- a/hphp/tools/gen-ext-hhvm/gen-infotabs.cpp +++ b/hphp/tools/gen-ext-hhvm/gen-infotabs.cpp @@ -55,10 +55,8 @@ int main(int argc, const char* argv[]) { cpp << "namespace HPHP {\n"; cpp << " struct TypedValue;\n"; cpp << " struct ActRec;\n"; - cpp << " namespace VM { struct Class; }\n"; - cpp << "}\n\n"; - - cpp << "namespace HPHP {\n"; + cpp << " struct Class;\n"; + cpp << "\n\n"; std::unordered_set classesWithCtors; @@ -72,7 +70,7 @@ int main(int argc, const char* argv[]) { for (auto const& klass : classes) { if (std::find(klass.flags.begin(), klass.flags.end(), "IsCppAbstract") == klass.flags.end()) { - cpp << "VM::Instance* new_" << klass.name << "_Instance(VM::Class*);\n"; + cpp << "Instance* new_" << klass.name << "_Instance(Class*);\n"; classesWithCtors.insert(klass.name); } for (auto const& func : klass.methods) { diff --git a/hphp/util/asm-x64.cpp b/hphp/util/asm-x64.cpp index 994511522..8664ed388 100644 --- a/hphp/util/asm-x64.cpp +++ b/hphp/util/asm-x64.cpp @@ -29,7 +29,7 @@ #include "util/maphuge.h" #include "runtime/base/runtime_option.h" -namespace HPHP { namespace VM { namespace Transl { +namespace HPHP { namespace Transl { static void panic(const char *fmt, ...) { va_list ap; @@ -128,4 +128,4 @@ void StoreImmPatcher::patch(uint64_t actual) { } } -}}} +}} diff --git a/hphp/util/asm-x64.h b/hphp/util/asm-x64.h index 5f19f30ad..15929ab9a 100644 --- a/hphp/util/asm-x64.h +++ b/hphp/util/asm-x64.h @@ -48,7 +48,7 @@ */ #define logical_const /* nothing */ -namespace HPHP { namespace VM { namespace Transl { +namespace HPHP { namespace Transl { #define TRACEMOD ::HPHP::Trace::asmx64 @@ -2514,6 +2514,6 @@ X64Assembler& asmChoose(CodeAddress addr, X64Assembler& a, Asm&... as) { #undef logical_const #undef CCS -}}} +}} #endif diff --git a/hphp/util/test/asm.cpp b/hphp/util/test/asm.cpp index cd91009eb..483289624 100644 --- a/hphp/util/test/asm.cpp +++ b/hphp/util/test/asm.cpp @@ -27,7 +27,7 @@ #include #include -namespace HPHP { namespace VM { namespace Transl { +namespace HPHP { namespace Transl { typedef X64Assembler Asm; using namespace reg; @@ -612,4 +612,4 @@ asm_label(a, loop); test_case(127); } -}}} +}} diff --git a/hphp/util/util.cpp b/hphp/util/util.cpp index 5f462c41a..fee92cac0 100644 --- a/hphp/util/util.cpp +++ b/hphp/util/util.cpp @@ -867,7 +867,7 @@ char* Util::getNativeFunctionName(void* codeAddr) { // _ZN4HPHP2VM6Transl17interpOneIterInitEv // // and then pass this to abi::__cxa_demangle to get the demanged name: - // HPHP::VM::Transl::interpOneIterInit() + // HPHP::Transl::interpOneIterInit() // // Sometimes, though, backtrace_symbols can't find the function name // and ends up giving us a blank managled name, like this: