diff --git a/runtime/compiler/ecmascript_runtime_interface.cpp b/runtime/compiler/ecmascript_runtime_interface.cpp index 0bcce53121c64f2064a9ad52437fe229f2e430b6..903f0bbdf08e4a6d640a4b92ad618cc92aec4723 100644 --- a/runtime/compiler/ecmascript_runtime_interface.cpp +++ b/runtime/compiler/ecmascript_runtime_interface.cpp @@ -430,6 +430,10 @@ bool EcmaRuntimeInterface::AddProfileInfo(PandaRuntimeInterface::MethodPtr m, if (handler.IsPrototypeHandler()) { PrototypeHandler *prototype_handler = PrototypeHandler::Cast(handler.GetTaggedObject()); auto cell_value = prototype_handler->GetProtoCell(); + if (cell_value.IsFalse()) { + // For access to undefined property of object without prototype tagged false is stored to proto cell + return false; + } ASSERT(cell_value.IsProtoChangeMarker()); ProtoChangeMarker *cell = ProtoChangeMarker::Cast(cell_value.GetHeapObject()); if (cell->GetHasChanged()) { diff --git a/runtime/ic/ic_runtime_stub-inl.h b/runtime/ic/ic_runtime_stub-inl.h index 9f5b0ab4c0ea4946b940a5286857e5e51482d724..b59f8a53e1c4a83ea5a174a80c9eea9165b14462 100644 --- a/runtime/ic/ic_runtime_stub-inl.h +++ b/runtime/ic/ic_runtime_stub-inl.h @@ -421,6 +421,10 @@ JSTaggedValue ICRuntimeStub::LoadPrototype(JSThread *thread, JSTaggedValue recei ASSERT(handler.IsPrototypeHandler()); PrototypeHandler *prototype_handler = PrototypeHandler::Cast(handler.GetTaggedObject()); auto cell_value = prototype_handler->GetProtoCell(); + if (cell_value.IsFalse()) { + // property was not found and object has no prototype + return JSTaggedValue::Hole(); + } ASSERT(cell_value.IsProtoChangeMarker()); ProtoChangeMarker *cell = ProtoChangeMarker::Cast(cell_value.GetHeapObject()); if (cell->GetHasChanged()) { diff --git a/runtime/js_method.cpp b/runtime/js_method.cpp index 855b67fad320d8c74f6eb3583d1eda6425fc7883..2acf2ac6ff7e183e69a49808369504b6698523da 100644 --- a/runtime/js_method.cpp +++ b/runtime/js_method.cpp @@ -16,6 +16,8 @@ #include "js_method.h" #include "plugins/ecmascript/runtime/js_tagged_value-inl.h" #include "libpandafile/method_data_accessor-inl.h" +#include "compiler/compiler_options.h" +#include "runtime/include/profiling_gen.h" namespace panda::ecmascript { JSMethod::~JSMethod() @@ -60,7 +62,14 @@ void JSMethod::InitProfileVector() panda_file::File::EntityId field_id = GetFileId(); panda_file::MethodDataAccessor mda(*panda_file, field_id); auto prof_size = mda.GetProfileSize(); - if (prof_size) { + bool method_too_big = bytecode_array_size_ > compiler::OPTIONS.GetCompilerMaxBytecodeSize(); +#ifndef NDEBUG + auto max_inst_prof_size = profiling::GetOrderedProfileSizes().back(); + auto max_prof_size = bytecode_array_size_ * max_inst_prof_size; + LOG_IF(!method_too_big && !prof_size && max_prof_size > panda_file::MethodItem::MAX_PROFILE_SIZE, WARNING, RUNTIME) + << "Method may be compiled but not profiled because profiling size exceeds limit"; +#endif + if (prof_size && !method_too_big) { profile_size_ = prof_size.value(); size_t size = RoundUp(prof_size.value(), BITS_PER_INTPTR); // NOLINTNEXTLINE(modernize-avoid-c-arrays)