1.add arraylist and ArkPrivate. 2.add special container in stub. 3.fix Switch

Signed-off-by: xliu <liuxin259@huawei.com>
Change-Id: I4082326fa075bce0c5c7bf8e6873282086fe5d6e
This commit is contained in:
xliu
2022-01-04 19:30:40 +08:00
parent 093f2a3f2f
commit aa2409e00f
40 changed files with 1105 additions and 152 deletions
+21
View File
@@ -34,6 +34,7 @@
#include "ecmascript/js_array.h"
#include "ecmascript/js_array_iterator.h"
#include "ecmascript/js_arraybuffer.h"
#include "ecmascript/js_arraylist.h"
#include "ecmascript/js_async_function.h"
#include "ecmascript/js_collator.h"
#include "ecmascript/js_dataview.h"
@@ -254,6 +255,8 @@ CString JSHClass::DumpJSType(JSType type)
return "EcmaModule";
case JSType::CLASS_INFO_EXTRACTOR:
return "ClassInfoExtractor";
case JSType::JS_ARRAY_LIST:
return "ArrayList";
default: {
CString ret = "unknown type ";
return ret + static_cast<char>(type);
@@ -597,6 +600,9 @@ static void DumpObject(JSThread *thread, TaggedObject *obj, std::ostream &os)
case JSType::CLASS_INFO_EXTRACTOR:
ClassInfoExtractor::Cast(obj)->Dump(thread, os);
break;
case JSType::JS_ARRAY_LIST:
JSArrayList::Cast(obj)->Dump(thread, os);
break;
default:
UNREACHABLE();
break;
@@ -1088,6 +1094,12 @@ void JSArray::Dump(JSThread *thread, std::ostream &os) const
JSObject::Dump(thread, os);
}
void JSArrayList::Dump(JSThread *thread, std::ostream &os) const
{
os << " - length: " << std::dec << GetLength().GetArrayLength() << "\n";
JSObject::Dump(thread, os);
}
void JSArrayIterator::Dump(JSThread *thread, std::ostream &os) const
{
JSArray *array = JSArray::Cast(GetIteratedArray().GetTaggedObject());
@@ -2139,6 +2151,9 @@ static void DumpObject(JSThread *thread, TaggedObject *obj,
case JSType::ECMA_MODULE:
EcmaModule::Cast(obj)->DumpForSnapshot(thread, vec);
return;
case JSType::JS_ARRAY_LIST:
JSArrayList::Cast(obj)->DumpForSnapshot(thread, vec);
return;
default:
break;
}
@@ -2486,6 +2501,12 @@ void JSArray::DumpForSnapshot([[maybe_unused]] JSThread *thread,
JSObject::DumpForSnapshot(thread, vec);
}
void JSArrayList::DumpForSnapshot([[maybe_unused]] JSThread *thread,
std::vector<std::pair<CString, JSTaggedValue>> &vec) const
{
JSObject::DumpForSnapshot(thread, vec);
}
void JSArrayIterator::DumpForSnapshot([[maybe_unused]] JSThread *thread,
std::vector<std::pair<CString, JSTaggedValue>> &vec) const
{