Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index fdb2ddf1663b67cc1df6d84919644f31753c07d6..85b6e8356e178170611a2e591f3537fca1efa6fa 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -8,13 +8,13 @@ |
#include "platform/assert.h" |
#include "vm/assembler.h" |
#include "vm/become.h" |
-#include "vm/cpu.h" |
#include "vm/bit_vector.h" |
#include "vm/bootstrap.h" |
#include "vm/class_finalizer.h" |
#include "vm/code_observers.h" |
#include "vm/compiler.h" |
#include "vm/compiler_stats.h" |
+#include "vm/cpu.h" |
#include "vm/dart.h" |
#include "vm/dart_api_state.h" |
#include "vm/dart_entry.h" |
@@ -92,7 +92,6 @@ static const intptr_t kGetterPrefixLength = strlen(kGetterPrefix); |
static const char* const kSetterPrefix = "set:"; |
static const intptr_t kSetterPrefixLength = strlen(kSetterPrefix); |
- |
// A cache of VM heap allocated preinitialized empty ic data entry arrays. |
RawArray* ICData::cached_icdata_arrays_[kCachedICDataArrayCount]; |
@@ -183,10 +182,8 @@ RawClass* Object::unhandled_exception_class_ = |
reinterpret_cast<RawClass*>(RAW_NULL); |
RawClass* Object::unwind_error_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
- |
const double MegamorphicCache::kLoadFactor = 0.50; |
- |
static void AppendSubString(Zone* zone, |
GrowableArray<const char*>* segments, |
const char* name, |
@@ -198,7 +195,6 @@ static void AppendSubString(Zone* zone, |
segments->Add(segment); |
} |
- |
static const char* MergeSubStrings(Zone* zone, |
const GrowableArray<const char*>& segments, |
intptr_t alloc_len) { |
@@ -215,7 +211,6 @@ static const char* MergeSubStrings(Zone* zone, |
return result; |
} |
- |
// Remove private keys, but retain getter/setter/constructor/mixin manglings. |
RawString* String::RemovePrivateKey(const String& name) { |
ASSERT(name.IsOneByteString()); |
@@ -237,7 +232,6 @@ RawString* String::RemovePrivateKey(const String& name) { |
return String::FromLatin1(without_key.data(), without_key.length()); |
} |
- |
// Takes a vm internal name and makes it suitable for external user. |
// |
// Examples: |
@@ -371,7 +365,6 @@ RawString* String::ScrubName(const String& name) { |
return Symbols::New(thread, unmangled_name); |
} |
- |
RawString* String::ScrubNameRetainPrivate(const String& name) { |
#if !defined(PRODUCT) |
intptr_t len = name.Length(); |
@@ -420,7 +413,6 @@ RawString* String::ScrubNameRetainPrivate(const String& name) { |
return name.raw(); // In PRODUCT, return argument unchanged. |
} |
- |
template <typename type> |
static bool IsSpecialCharacter(type value) { |
return ((value == '"') || (value == '\n') || (value == '\f') || |
@@ -428,17 +420,14 @@ static bool IsSpecialCharacter(type value) { |
(value == '\r') || (value == '\\') || (value == '$')); |
} |
- |
static inline bool IsAsciiNonprintable(int32_t c) { |
return ((0 <= c) && (c < 32)) || (c == 127); |
} |
- |
static inline bool NeedsEscapeSequence(int32_t c) { |
return (c == '"') || (c == '\\') || (c == '$') || IsAsciiNonprintable(c); |
} |
- |
static int32_t EscapeOverhead(int32_t c) { |
if (IsSpecialCharacter(c)) { |
return 1; // 1 additional byte for the backslash. |
@@ -448,7 +437,6 @@ static int32_t EscapeOverhead(int32_t c) { |
return 0; |
} |
- |
template <typename type> |
static type SpecialCharacter(type value) { |
if (value == '"') { |
@@ -474,7 +462,6 @@ static type SpecialCharacter(type value) { |
return '\0'; |
} |
- |
void Object::InitNull(Isolate* isolate) { |
// Should only be run by the vm isolate. |
ASSERT(isolate == Dart::vm_isolate()); |
@@ -495,7 +482,6 @@ void Object::InitNull(Isolate* isolate) { |
} |
} |
- |
void Object::InitOnce(Isolate* isolate) { |
// Should only be run by the vm isolate. |
ASSERT(isolate == Dart::vm_isolate()); |
@@ -990,7 +976,6 @@ void Object::InitOnce(Isolate* isolate) { |
ASSERT(vm_isolate_snapshot_object_table_->IsArray()); |
} |
- |
// An object visitor which will mark all visited objects. This is used to |
// premark all objects in the vm_isolate_ heap. Also precalculates hash |
// codes so that we can get the identity hash code of objects in the read- |
@@ -1043,7 +1028,6 @@ class FinalizeVMIsolateVisitor : public ObjectVisitor { |
#endif |
}; |
- |
#define SET_CLASS_NAME(class_name, name) \ |
cls = class_name##_class(); \ |
cls.set_name(Symbols::name()); |
@@ -1063,7 +1047,6 @@ void Object::FinalizeVMIsolate(Isolate* isolate) { |
ASSERT(!extractor_parameter_names_->IsSmi()); |
ASSERT(extractor_parameter_names_->IsArray()); |
- |
// Set up names for all VM singleton classes. |
Class& cls = Class::Handle(); |
@@ -1128,13 +1111,11 @@ void Object::FinalizeVMIsolate(Isolate* isolate) { |
} |
} |
- |
void Object::set_vm_isolate_snapshot_object_table(const Array& table) { |
ASSERT(Isolate::Current() == Dart::vm_isolate()); |
*vm_isolate_snapshot_object_table_ = table.raw(); |
} |
- |
// Make unused space in an object whose type has been transformed safe |
// for traversing during GC. |
// The unused part of the transformed object is marked as an TypedDataInt8Array |
@@ -1186,7 +1167,6 @@ void Object::MakeUnusedSpaceTraversable(const Object& obj, |
} |
} |
- |
void Object::VerifyBuiltinVtables() { |
#if defined(DEBUG) |
Thread* thread = Thread::Current(); |
@@ -1203,7 +1183,6 @@ void Object::VerifyBuiltinVtables() { |
#endif |
} |
- |
void Object::RegisterClass(const Class& cls, |
const String& name, |
const Library& lib) { |
@@ -1213,7 +1192,6 @@ void Object::RegisterClass(const Class& cls, |
lib.AddClass(cls); |
} |
- |
void Object::RegisterPrivateClass(const Class& cls, |
const String& public_class_name, |
const Library& lib) { |
@@ -1225,7 +1203,6 @@ void Object::RegisterPrivateClass(const Class& cls, |
lib.AddClass(cls); |
} |
- |
// Initialize a new isolate from source or from a snapshot. |
// |
// There are three possibilities: |
@@ -1867,7 +1844,6 @@ RawError* Object::Init(Isolate* isolate, kernel::Program* kernel_program) { |
return Error::null(); |
} |
- |
#if defined(DEBUG) |
bool Object::InVMHeap() const { |
if (FLAG_verify_handles && raw()->IsVMHeapObject()) { |
@@ -1878,17 +1854,14 @@ bool Object::InVMHeap() const { |
} |
#endif // DEBUG |
- |
void Object::Print() const { |
THR_Print("%s\n", ToCString()); |
} |
- |
RawString* Object::DictionaryName() const { |
return String::null(); |
} |
- |
void Object::InitializeObject(uword address, |
intptr_t class_id, |
intptr_t size, |
@@ -1914,7 +1887,6 @@ void Object::InitializeObject(uword address, |
ASSERT(is_vm_object == RawObject::IsVMHeapObject(tags)); |
} |
- |
void Object::CheckHandle() const { |
#if defined(DEBUG) |
if (raw_ != Object::null()) { |
@@ -1938,7 +1910,6 @@ void Object::CheckHandle() const { |
#endif |
} |
- |
RawObject* Object::Allocate(intptr_t cls_id, intptr_t size, Heap::Space space) { |
ASSERT(Utils::IsAligned(size, kObjectAlignment)); |
Thread* thread = Thread::Current(); |
@@ -1976,7 +1947,6 @@ RawObject* Object::Allocate(intptr_t cls_id, intptr_t size, Heap::Space space) { |
return raw_obj; |
} |
- |
class StoreBufferUpdateVisitor : public ObjectPointerVisitor { |
public: |
explicit StoreBufferUpdateVisitor(Thread* thread, RawObject* obj) |
@@ -2005,17 +1975,14 @@ class StoreBufferUpdateVisitor : public ObjectPointerVisitor { |
DISALLOW_COPY_AND_ASSIGN(StoreBufferUpdateVisitor); |
}; |
- |
bool Object::IsReadOnlyHandle() const { |
return Dart::IsReadOnlyHandle(reinterpret_cast<uword>(this)); |
} |
- |
bool Object::IsNotTemporaryScopedHandle() const { |
return (IsZoneHandle() || IsReadOnlyHandle()); |
} |
- |
RawObject* Object::Clone(const Object& orig, Heap::Space space) { |
const Class& cls = Class::Handle(orig.clazz()); |
intptr_t size = orig.raw()->Size(); |
@@ -2044,17 +2011,14 @@ RawObject* Object::Clone(const Object& orig, Heap::Space space) { |
return raw_clone; |
} |
- |
RawString* Class::Name() const { |
return raw_ptr()->name_; |
} |
- |
RawString* Class::ScrubbedName() const { |
return String::ScrubName(String::Handle(Name())); |
} |
- |
RawString* Class::UserVisibleName() const { |
#if !defined(PRODUCT) |
ASSERT(raw_ptr()->user_name_ != String::null()); |
@@ -2063,20 +2027,17 @@ RawString* Class::UserVisibleName() const { |
return GenerateUserVisibleName(); // No caching in PRODUCT, regenerate. |
} |
- |
bool Class::IsInFullSnapshot() const { |
NoSafepointScope no_safepoint; |
return raw_ptr()->library_->ptr()->is_in_fullsnapshot_; |
} |
- |
RawAbstractType* Class::RareType() const { |
const Type& type = Type::Handle(Type::New( |
*this, Object::null_type_arguments(), TokenPosition::kNoSource)); |
return ClassFinalizer::FinalizeType(*this, type); |
} |
- |
RawAbstractType* Class::DeclarationType() const { |
const TypeArguments& args = TypeArguments::Handle(type_parameters()); |
const Type& type = |
@@ -2084,7 +2045,6 @@ RawAbstractType* Class::DeclarationType() const { |
return ClassFinalizer::FinalizeType(*this, type); |
} |
- |
template <class FakeObject> |
RawClass* Class::New() { |
ASSERT(Object::class_class() != Class::null()); |
@@ -2121,7 +2081,6 @@ RawClass* Class::New() { |
return result.raw(); |
} |
- |
static void ReportTooManyTypeArguments(const Class& cls) { |
Report::MessageF(Report::kError, Script::Handle(cls.script()), |
cls.token_pos(), Report::AtLocation, |
@@ -2131,7 +2090,6 @@ static void ReportTooManyTypeArguments(const Class& cls) { |
UNREACHABLE(); |
} |
- |
void Class::set_num_type_arguments(intptr_t value) const { |
if (!Utils::IsInt(16, value)) { |
ReportTooManyTypeArguments(*this); |
@@ -2139,7 +2097,6 @@ void Class::set_num_type_arguments(intptr_t value) const { |
StoreNonPointer(&raw_ptr()->num_type_arguments_, value); |
} |
- |
void Class::set_num_own_type_arguments(intptr_t value) const { |
if (!Utils::IsInt(16, value)) { |
ReportTooManyTypeArguments(*this); |
@@ -2147,7 +2104,6 @@ void Class::set_num_own_type_arguments(intptr_t value) const { |
StoreNonPointer(&raw_ptr()->num_own_type_arguments_, value); |
} |
- |
// Initialize class fields of type Array with empty array. |
void Class::InitEmptyFields() { |
if (Object::empty_array().raw() == Array::null()) { |
@@ -2162,7 +2118,6 @@ void Class::InitEmptyFields() { |
Object::empty_array().raw()); |
} |
- |
RawArray* Class::OffsetToFieldMap(bool original_classes) const { |
Array& array = Array::Handle(raw_ptr()->offset_in_words_to_field_); |
if (array.IsNull()) { |
@@ -2187,7 +2142,6 @@ RawArray* Class::OffsetToFieldMap(bool original_classes) const { |
return array.raw(); |
} |
- |
bool Class::HasInstanceFields() const { |
const Array& field_array = Array::Handle(fields()); |
Field& field = Field::Handle(); |
@@ -2200,7 +2154,6 @@ bool Class::HasInstanceFields() const { |
return false; |
} |
- |
class FunctionName { |
public: |
FunctionName(const String& name, String* tmp_string) |
@@ -2220,7 +2173,6 @@ class FunctionName { |
String* tmp_string_; |
}; |
- |
// Traits for looking up Functions by name. |
class ClassFunctionsTraits { |
public: |
@@ -2243,7 +2195,6 @@ class ClassFunctionsTraits { |
}; |
typedef UnorderedHashSet<ClassFunctionsTraits> ClassFunctionsSet; |
- |
void Class::SetFunctions(const Array& value) const { |
ASSERT(Thread::Current()->IsMutatorThread()); |
ASSERT(!value.IsNull()); |
@@ -2264,7 +2215,6 @@ void Class::SetFunctions(const Array& value) const { |
} |
} |
- |
void Class::AddFunction(const Function& function) const { |
ASSERT(Thread::Current()->IsMutatorThread()); |
const Array& arr = Array::Handle(functions()); |
@@ -2284,7 +2234,6 @@ void Class::AddFunction(const Function& function) const { |
} |
} |
- |
void Class::RemoveFunction(const Function& function) const { |
ASSERT(Thread::Current()->IsMutatorThread()); |
const Array& arr = Array::Handle(functions()); |
@@ -2299,7 +2248,6 @@ void Class::RemoveFunction(const Function& function) const { |
} |
} |
- |
RawFunction* Class::FunctionFromIndex(intptr_t idx) const { |
const Array& funcs = Array::Handle(functions()); |
if ((idx < 0) || (idx >= funcs.Length())) { |
@@ -2311,7 +2259,6 @@ RawFunction* Class::FunctionFromIndex(intptr_t idx) const { |
return func.raw(); |
} |
- |
RawFunction* Class::ImplicitClosureFunctionFromIndex(intptr_t idx) const { |
const Array& funcs = Array::Handle(functions()); |
if ((idx < 0) || (idx >= funcs.Length())) { |
@@ -2329,7 +2276,6 @@ RawFunction* Class::ImplicitClosureFunctionFromIndex(intptr_t idx) const { |
return closure_func.raw(); |
} |
- |
intptr_t Class::FindImplicitClosureFunctionIndex(const Function& needle) const { |
Thread* thread = Thread::Current(); |
if (EnsureIsFinalized(thread) != Error::null()) { |
@@ -2358,7 +2304,6 @@ intptr_t Class::FindImplicitClosureFunctionIndex(const Function& needle) const { |
return -1; |
} |
- |
intptr_t Class::FindInvocationDispatcherFunctionIndex( |
const Function& needle) const { |
Thread* thread = Thread::Current(); |
@@ -2386,7 +2331,6 @@ intptr_t Class::FindInvocationDispatcherFunctionIndex( |
return -1; |
} |
- |
RawFunction* Class::InvocationDispatcherFunctionFromIndex(intptr_t idx) const { |
Thread* thread = Thread::Current(); |
REUSABLE_ARRAY_HANDLESCOPE(thread); |
@@ -2401,28 +2345,23 @@ RawFunction* Class::InvocationDispatcherFunctionFromIndex(intptr_t idx) const { |
return Function::Cast(object).raw(); |
} |
- |
void Class::set_signature_function(const Function& value) const { |
ASSERT(value.IsClosureFunction() || value.IsSignatureFunction()); |
StorePointer(&raw_ptr()->signature_function_, value.raw()); |
} |
- |
void Class::set_state_bits(intptr_t bits) const { |
StoreNonPointer(&raw_ptr()->state_bits_, static_cast<uint16_t>(bits)); |
} |
- |
void Class::set_library(const Library& value) const { |
StorePointer(&raw_ptr()->library_, value.raw()); |
} |
- |
void Class::set_type_parameters(const TypeArguments& value) const { |
StorePointer(&raw_ptr()->type_parameters_, value.raw()); |
} |
- |
intptr_t Class::NumTypeParameters(Thread* thread) const { |
if (IsMixinApplication() && !is_mixin_type_applied()) { |
ClassFinalizer::ApplyMixinType(*this); |
@@ -2441,7 +2380,6 @@ intptr_t Class::NumTypeParameters(Thread* thread) const { |
return type_params.Length(); |
} |
- |
intptr_t Class::NumOwnTypeArguments() const { |
// Return cached value if already calculated. |
if (num_own_type_arguments() != kUnknownNumTypeArguments) { |
@@ -2515,7 +2453,6 @@ intptr_t Class::NumOwnTypeArguments() const { |
return num_type_params; |
} |
- |
intptr_t Class::NumTypeArguments() const { |
// Return cached value if already calculated. |
if (num_type_arguments() != kUnknownNumTypeArguments) { |
@@ -2552,7 +2489,6 @@ intptr_t Class::NumTypeArguments() const { |
return num_type_args; |
} |
- |
RawClass* Class::SuperClass(bool original_classes) const { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -2569,14 +2505,12 @@ RawClass* Class::SuperClass(bool original_classes) const { |
} |
} |
- |
void Class::set_super_type(const AbstractType& value) const { |
ASSERT(value.IsNull() || (value.IsType() && !value.IsDynamicType()) || |
value.IsMixinAppType()); |
StorePointer(&raw_ptr()->super_type_, value.raw()); |
} |
- |
RawTypeParameter* Class::LookupTypeParameter(const String& type_name) const { |
ASSERT(!type_name.IsNull()); |
Thread* thread = Thread::Current(); |
@@ -2601,7 +2535,6 @@ RawTypeParameter* Class::LookupTypeParameter(const String& type_name) const { |
return TypeParameter::null(); |
} |
- |
void Class::CalculateFieldOffsets() const { |
Array& flds = Array::Handle(fields()); |
const Class& super = Class::Handle(SuperClass()); |
@@ -2649,7 +2582,6 @@ void Class::CalculateFieldOffsets() const { |
set_next_field_offset(offset); |
} |
- |
RawFunction* Class::GetInvocationDispatcher(const String& target_name, |
const Array& args_desc, |
RawFunction::Kind kind, |
@@ -2695,7 +2627,6 @@ RawFunction* Class::GetInvocationDispatcher(const String& target_name, |
return dispatcher.raw(); |
} |
- |
RawFunction* Class::CreateInvocationDispatcher(const String& target_name, |
const Array& args_desc, |
RawFunction::Kind kind) const { |
@@ -2754,7 +2685,6 @@ RawFunction* Class::CreateInvocationDispatcher(const String& target_name, |
return invocation.raw(); |
} |
- |
// Method extractors are used to create implicit closures from methods. |
// When an expression obj.M is evaluated for the first time and receiver obj |
// does not have a getter called M but has a method called M then an extractor |
@@ -2797,7 +2727,6 @@ RawFunction* Function::CreateMethodExtractor(const String& getter_name) const { |
return extractor.raw(); |
} |
- |
RawFunction* Function::GetMethodExtractor(const String& getter_name) const { |
ASSERT(Field::IsGetterName(getter_name)); |
const Function& closure_function = |
@@ -2811,17 +2740,14 @@ RawFunction* Function::GetMethodExtractor(const String& getter_name) const { |
return result.raw(); |
} |
- |
RawArray* Class::invocation_dispatcher_cache() const { |
return raw_ptr()->invocation_dispatcher_cache_; |
} |
- |
void Class::set_invocation_dispatcher_cache(const Array& cache) const { |
StorePointer(&raw_ptr()->invocation_dispatcher_cache_, cache.raw()); |
} |
- |
void Class::Finalize() const { |
ASSERT(Thread::Current()->IsMutatorThread()); |
ASSERT(!Isolate::Current()->all_classes_finalized()); |
@@ -2835,7 +2761,6 @@ void Class::Finalize() const { |
set_is_finalized(); |
} |
- |
class CHACodeArray : public WeakCodeReferences { |
public: |
explicit CHACodeArray(const Class& cls) |
@@ -2869,7 +2794,6 @@ class CHACodeArray : public WeakCodeReferences { |
DISALLOW_COPY_AND_ASSIGN(CHACodeArray); |
}; |
- |
#if defined(DEBUG) |
static bool IsMutatorOrAtSafepoint() { |
Thread* thread = Thread::Current(); |
@@ -2877,7 +2801,6 @@ static bool IsMutatorOrAtSafepoint() { |
} |
#endif |
- |
void Class::RegisterCHACode(const Code& code) { |
if (FLAG_trace_cha) { |
THR_Print("RegisterCHACode '%s' depends on class '%s'\n", |
@@ -2890,7 +2813,6 @@ void Class::RegisterCHACode(const Code& code) { |
a.Register(code); |
} |
- |
void Class::DisableCHAOptimizedCode(const Class& subclass) { |
ASSERT(Thread::Current()->IsMutatorThread()); |
CHACodeArray a(*this); |
@@ -2900,12 +2822,10 @@ void Class::DisableCHAOptimizedCode(const Class& subclass) { |
a.DisableCode(); |
} |
- |
void Class::DisableAllCHAOptimizedCode() { |
DisableCHAOptimizedCode(Class::Handle()); |
} |
- |
bool Class::TraceAllocation(Isolate* isolate) const { |
#ifndef PRODUCT |
ClassTable* class_table = isolate->class_table(); |
@@ -2915,7 +2835,6 @@ bool Class::TraceAllocation(Isolate* isolate) const { |
#endif |
} |
- |
void Class::SetTraceAllocation(bool trace_allocation) const { |
#ifndef PRODUCT |
Isolate* isolate = Isolate::Current(); |
@@ -2930,7 +2849,6 @@ void Class::SetTraceAllocation(bool trace_allocation) const { |
#endif |
} |
- |
bool Class::ValidatePostFinalizePatch(const Class& orig_class, |
Error* error) const { |
ASSERT(error != NULL); |
@@ -2992,12 +2910,10 @@ bool Class::ValidatePostFinalizePatch(const Class& orig_class, |
return true; |
} |
- |
void Class::set_dependent_code(const Array& array) const { |
StorePointer(&raw_ptr()->dependent_code_, array.raw()); |
} |
- |
// Apply the members from the patch class to the original class. |
bool Class::ApplyPatch(const Class& patch, Error* error) const { |
ASSERT(error != NULL); |
@@ -3111,7 +3027,6 @@ bool Class::ApplyPatch(const Class& patch, Error* error) const { |
return true; |
} |
- |
static RawString* BuildClosureSource(const Array& formal_params, |
const String& expr) { |
const GrowableObjectArray& src_pieces = |
@@ -3133,7 +3048,6 @@ static RawString* BuildClosureSource(const Array& formal_params, |
return String::ConcatAll(Array::Handle(Array::MakeFixedLength(src_pieces))); |
} |
- |
RawFunction* Function::EvaluateHelper(const Class& cls, |
const String& expr, |
const Array& param_names, |
@@ -3160,7 +3074,6 @@ RawFunction* Function::EvaluateHelper(const Class& cls, |
return func.raw(); |
} |
- |
RawObject* Class::Evaluate(const String& expr, |
const Array& param_names, |
const Array& param_values) const { |
@@ -3179,7 +3092,6 @@ RawObject* Class::Evaluate(const String& expr, |
return result.raw(); |
} |
- |
// Ensure that top level parsing of the class has been done. |
RawError* Class::EnsureIsFinalized(Thread* thread) const { |
// Finalized classes have already been parsed. |
@@ -3204,7 +3116,6 @@ RawError* Class::EnsureIsFinalized(Thread* thread) const { |
return error.raw(); |
} |
- |
void Class::SetFields(const Array& value) const { |
ASSERT(!value.IsNull()); |
#if defined(DEBUG) |
@@ -3221,7 +3132,6 @@ void Class::SetFields(const Array& value) const { |
StorePointer(&raw_ptr()->fields_, value.raw()); |
} |
- |
void Class::AddField(const Field& field) const { |
const Array& arr = Array::Handle(fields()); |
const Array& new_arr = Array::Handle(Array::Grow(arr, arr.Length() + 1)); |
@@ -3229,7 +3139,6 @@ void Class::AddField(const Field& field) const { |
SetFields(new_arr); |
} |
- |
void Class::AddFields(const GrowableArray<const Field*>& new_fields) const { |
const intptr_t num_new_fields = new_fields.length(); |
if (num_new_fields == 0) return; |
@@ -3243,7 +3152,6 @@ void Class::AddFields(const GrowableArray<const Field*>& new_fields) const { |
SetFields(new_arr); |
} |
- |
void Class::InjectCIDFields() const { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -3269,7 +3177,6 @@ void Class::InjectCIDFields() const { |
#undef CLASS_LIST_WITH_NULL |
} |
- |
template <class FakeInstance> |
RawClass* Class::NewCommon(intptr_t index) { |
ASSERT(Object::class_class() != Class::null()); |
@@ -3296,7 +3203,6 @@ RawClass* Class::NewCommon(intptr_t index) { |
return result.raw(); |
} |
- |
template <class FakeInstance> |
RawClass* Class::New(intptr_t index) { |
Class& result = Class::Handle(NewCommon<FakeInstance>(index)); |
@@ -3304,7 +3210,6 @@ RawClass* Class::New(intptr_t index) { |
return result.raw(); |
} |
- |
RawClass* Class::New(const Library& lib, |
const String& name, |
const Script& script, |
@@ -3318,12 +3223,10 @@ RawClass* Class::New(const Library& lib, |
return result.raw(); |
} |
- |
RawClass* Class::NewInstanceClass() { |
return Class::New<Instance>(kIllegalCid); |
} |
- |
RawClass* Class::NewNativeWrapper(const Library& library, |
const String& name, |
int field_count) { |
@@ -3351,7 +3254,6 @@ RawClass* Class::NewNativeWrapper(const Library& library, |
} |
} |
- |
RawClass* Class::NewStringClass(intptr_t class_id) { |
intptr_t instance_size; |
if (class_id == kOneByteStringCid) { |
@@ -3371,7 +3273,6 @@ RawClass* Class::NewStringClass(intptr_t class_id) { |
return result.raw(); |
} |
- |
RawClass* Class::NewTypedDataClass(intptr_t class_id) { |
ASSERT(RawObject::IsTypedDataClassId(class_id)); |
intptr_t instance_size = TypedData::InstanceSize(); |
@@ -3382,7 +3283,6 @@ RawClass* Class::NewTypedDataClass(intptr_t class_id) { |
return result.raw(); |
} |
- |
RawClass* Class::NewTypedDataViewClass(intptr_t class_id) { |
ASSERT(RawObject::IsTypedDataViewClassId(class_id)); |
Class& result = Class::Handle(New<Instance>(class_id)); |
@@ -3391,7 +3291,6 @@ RawClass* Class::NewTypedDataViewClass(intptr_t class_id) { |
return result.raw(); |
} |
- |
RawClass* Class::NewExternalTypedDataClass(intptr_t class_id) { |
ASSERT(RawObject::IsExternalTypedDataClassId(class_id)); |
intptr_t instance_size = ExternalTypedData::InstanceSize(); |
@@ -3402,7 +3301,6 @@ RawClass* Class::NewExternalTypedDataClass(intptr_t class_id) { |
return result.raw(); |
} |
- |
void Class::set_name(const String& value) const { |
ASSERT(raw_ptr()->name_ == String::null()); |
ASSERT(value.IsSymbol()); |
@@ -3418,14 +3316,12 @@ void Class::set_name(const String& value) const { |
#endif // !defined(PRODUCT) |
} |
- |
#if !defined(PRODUCT) |
void Class::set_user_name(const String& value) const { |
StorePointer(&raw_ptr()->user_name_, value.raw()); |
} |
#endif // !defined(PRODUCT) |
- |
RawString* Class::GenerateUserVisibleName() const { |
if (FLAG_show_internal_names) { |
return Name(); |
@@ -3573,18 +3469,15 @@ RawString* Class::GenerateUserVisibleName() const { |
return String::ScrubName(name); |
} |
- |
void Class::set_script(const Script& value) const { |
StorePointer(&raw_ptr()->script_, value.raw()); |
} |
- |
void Class::set_token_pos(TokenPosition token_pos) const { |
ASSERT(!token_pos.IsClassifying()); |
StoreNonPointer(&raw_ptr()->token_pos_, token_pos); |
} |
- |
TokenPosition Class::ComputeEndTokenPos() const { |
// Return the begin token for synthetic classes. |
if (is_synthesized_class() || IsMixinApplication() || IsTopLevel()) { |
@@ -3636,75 +3529,61 @@ TokenPosition Class::ComputeEndTokenPos() const { |
return TokenPosition::kNoSource; |
} |
- |
void Class::set_is_implemented() const { |
set_state_bits(ImplementedBit::update(true, raw_ptr()->state_bits_)); |
} |
- |
void Class::set_is_abstract() const { |
set_state_bits(AbstractBit::update(true, raw_ptr()->state_bits_)); |
} |
- |
void Class::set_is_type_finalized() const { |
set_state_bits(TypeFinalizedBit::update(true, raw_ptr()->state_bits_)); |
} |
- |
void Class::set_is_patch() const { |
set_state_bits(PatchBit::update(true, raw_ptr()->state_bits_)); |
} |
- |
void Class::set_is_synthesized_class() const { |
set_state_bits(SynthesizedClassBit::update(true, raw_ptr()->state_bits_)); |
} |
- |
void Class::set_is_enum_class() const { |
set_state_bits(EnumBit::update(true, raw_ptr()->state_bits_)); |
} |
- |
void Class::set_is_const() const { |
set_state_bits(ConstBit::update(true, raw_ptr()->state_bits_)); |
} |
- |
void Class::set_is_mixin_app_alias() const { |
set_state_bits(MixinAppAliasBit::update(true, raw_ptr()->state_bits_)); |
} |
- |
void Class::set_is_mixin_type_applied() const { |
set_state_bits(MixinTypeAppliedBit::update(true, raw_ptr()->state_bits_)); |
} |
- |
void Class::set_is_fields_marked_nullable() const { |
set_state_bits(FieldsMarkedNullableBit::update(true, raw_ptr()->state_bits_)); |
} |
- |
void Class::set_is_cycle_free() const { |
ASSERT(!is_cycle_free()); |
set_state_bits(CycleFreeBit::update(true, raw_ptr()->state_bits_)); |
} |
- |
void Class::set_is_allocated(bool value) const { |
set_state_bits(IsAllocatedBit::update(value, raw_ptr()->state_bits_)); |
} |
- |
void Class::set_is_finalized() const { |
ASSERT(!is_finalized()); |
set_state_bits( |
ClassFinalizedBits::update(RawClass::kFinalized, raw_ptr()->state_bits_)); |
} |
- |
void Class::SetRefinalizeAfterPatch() const { |
ASSERT(!IsTopLevel()); |
set_state_bits(ClassFinalizedBits::update(RawClass::kRefinalizeAfterPatch, |
@@ -3712,7 +3591,6 @@ void Class::SetRefinalizeAfterPatch() const { |
set_state_bits(TypeFinalizedBit::update(false, raw_ptr()->state_bits_)); |
} |
- |
void Class::ResetFinalization() const { |
ASSERT(IsTopLevel() || IsClosureClass()); |
set_state_bits( |
@@ -3720,47 +3598,39 @@ void Class::ResetFinalization() const { |
set_state_bits(TypeFinalizedBit::update(false, raw_ptr()->state_bits_)); |
} |
- |
void Class::set_is_prefinalized() const { |
ASSERT(!is_finalized()); |
set_state_bits(ClassFinalizedBits::update(RawClass::kPreFinalized, |
raw_ptr()->state_bits_)); |
} |
- |
void Class::set_is_marked_for_parsing() const { |
set_state_bits(MarkedForParsingBit::update(true, raw_ptr()->state_bits_)); |
} |
- |
void Class::reset_is_marked_for_parsing() const { |
set_state_bits(MarkedForParsingBit::update(false, raw_ptr()->state_bits_)); |
} |
- |
void Class::set_interfaces(const Array& value) const { |
ASSERT(!value.IsNull()); |
StorePointer(&raw_ptr()->interfaces_, value.raw()); |
} |
- |
void Class::set_mixin(const Type& value) const { |
ASSERT(!value.IsNull()); |
StorePointer(&raw_ptr()->mixin_, value.raw()); |
} |
- |
bool Class::IsMixinApplication() const { |
return mixin() != Type::null(); |
} |
- |
RawClass* Class::GetPatchClass() const { |
const Library& lib = Library::Handle(library()); |
return lib.GetPatchClass(String::Handle(Name())); |
} |
- |
void Class::AddDirectSubclass(const Class& subclass) const { |
ASSERT(!subclass.IsNull()); |
ASSERT(subclass.SuperClass() == raw()); |
@@ -3781,12 +3651,10 @@ void Class::AddDirectSubclass(const Class& subclass) const { |
direct_subclasses.Add(subclass, Heap::kOld); |
} |
- |
void Class::ClearDirectSubclasses() const { |
StorePointer(&raw_ptr()->direct_subclasses_, GrowableObjectArray::null()); |
} |
- |
RawArray* Class::constants() const { |
return raw_ptr()->constants_; |
} |
@@ -3796,30 +3664,25 @@ void Class::set_constants(const Array& value) const { |
StorePointer(&raw_ptr()->constants_, value.raw()); |
} |
- |
RawType* Class::canonical_type() const { |
return raw_ptr()->canonical_type_; |
} |
- |
void Class::set_canonical_type(const Type& value) const { |
ASSERT(!value.IsNull() && value.IsCanonical() && value.IsOld()); |
StorePointer(&raw_ptr()->canonical_type_, value.raw()); |
} |
- |
RawType* Class::CanonicalType() const { |
return raw_ptr()->canonical_type_; |
} |
- |
void Class::SetCanonicalType(const Type& type) const { |
ASSERT((canonical_type() == Object::null()) || |
(canonical_type() == type.raw())); // Set during own finalization. |
set_canonical_type(type); |
} |
- |
void Class::set_allocation_stub(const Code& value) const { |
// Never clear the stub as it may still be a target, but will be GC-d if |
// not referenced. |
@@ -3828,7 +3691,6 @@ void Class::set_allocation_stub(const Code& value) const { |
StorePointer(&raw_ptr()->allocation_stub_, value.raw()); |
} |
- |
void Class::DisableAllocationStub() const { |
const Code& existing_stub = Code::Handle(allocation_stub()); |
if (existing_stub.IsNull()) { |
@@ -3841,12 +3703,10 @@ void Class::DisableAllocationStub() const { |
StorePointer(&raw_ptr()->allocation_stub_, Code::null()); |
} |
- |
bool Class::IsDartFunctionClass() const { |
return raw() == Type::Handle(Type::DartFunctionType()).type_class(); |
} |
- |
// If test_kind == kIsSubtypeOf, checks if type S is a subtype of type T. |
// If test_kind == kIsMoreSpecificThan, checks if S is more specific than T. |
// Type S is specified by this class parameterized with 'type_arguments', and |
@@ -3994,7 +3854,6 @@ bool Class::TypeTestNonRecursive(const Class& cls, |
return false; |
} |
- |
// If test_kind == kIsSubtypeOf, checks if type S is a subtype of type T. |
// If test_kind == kIsMoreSpecificThan, checks if S is more specific than T. |
// Type S is specified by this class parameterized with 'type_arguments', and |
@@ -4013,74 +3872,60 @@ bool Class::TypeTest(TypeTestKind test_kind, |
space); |
} |
- |
bool Class::IsTopLevel() const { |
return Name() == Symbols::TopLevel().raw(); |
} |
- |
bool Class::IsPrivate() const { |
return Library::IsPrivate(String::Handle(Name())); |
} |
- |
RawFunction* Class::LookupDynamicFunction(const String& name) const { |
return LookupFunction(name, kInstance); |
} |
- |
RawFunction* Class::LookupDynamicFunctionAllowAbstract( |
const String& name) const { |
return LookupFunction(name, kInstanceAllowAbstract); |
} |
- |
RawFunction* Class::LookupDynamicFunctionAllowPrivate( |
const String& name) const { |
return LookupFunctionAllowPrivate(name, kInstance); |
} |
- |
RawFunction* Class::LookupStaticFunction(const String& name) const { |
return LookupFunction(name, kStatic); |
} |
- |
RawFunction* Class::LookupStaticFunctionAllowPrivate(const String& name) const { |
return LookupFunctionAllowPrivate(name, kStatic); |
} |
- |
RawFunction* Class::LookupConstructor(const String& name) const { |
return LookupFunction(name, kConstructor); |
} |
- |
RawFunction* Class::LookupConstructorAllowPrivate(const String& name) const { |
return LookupFunctionAllowPrivate(name, kConstructor); |
} |
- |
RawFunction* Class::LookupFactory(const String& name) const { |
return LookupFunction(name, kFactory); |
} |
- |
RawFunction* Class::LookupFactoryAllowPrivate(const String& name) const { |
return LookupFunctionAllowPrivate(name, kFactory); |
} |
- |
RawFunction* Class::LookupFunction(const String& name) const { |
return LookupFunction(name, kAny); |
} |
- |
RawFunction* Class::LookupFunctionAllowPrivate(const String& name) const { |
return LookupFunctionAllowPrivate(name, kAny); |
} |
- |
RawFunction* Class::LookupCallFunctionForTypeTest() const { |
// If this class is not compiled yet, it is too early to lookup a call |
// function. This case should only occur during bounds checking at compile |
@@ -4106,7 +3951,6 @@ RawFunction* Class::LookupCallFunctionForTypeTest() const { |
return call_function.raw(); |
} |
- |
// Returns true if 'prefix' and 'accessor_name' match 'name'. |
static bool MatchesAccessorName(const String& name, |
const char* prefix, |
@@ -4131,7 +3975,6 @@ static bool MatchesAccessorName(const String& name, |
return true; |
} |
- |
RawFunction* Class::CheckFunctionType(const Function& func, MemberKind kind) { |
if ((kind == kInstance) || (kind == kInstanceAllowAbstract)) { |
if (func.IsDynamicFunction(kind == kInstanceAllowAbstract)) { |
@@ -4157,7 +4000,6 @@ RawFunction* Class::CheckFunctionType(const Function& func, MemberKind kind) { |
return Function::null(); |
} |
- |
RawFunction* Class::LookupFunction(const String& name, MemberKind kind) const { |
Thread* thread = Thread::Current(); |
if (EnsureIsFinalized(thread) != Error::null()) { |
@@ -4208,7 +4050,6 @@ RawFunction* Class::LookupFunction(const String& name, MemberKind kind) const { |
return Function::null(); |
} |
- |
RawFunction* Class::LookupFunctionAllowPrivate(const String& name, |
MemberKind kind) const { |
Thread* thread = Thread::Current(); |
@@ -4235,17 +4076,14 @@ RawFunction* Class::LookupFunctionAllowPrivate(const String& name, |
return Function::null(); |
} |
- |
RawFunction* Class::LookupGetterFunction(const String& name) const { |
return LookupAccessorFunction(kGetterPrefix, kGetterPrefixLength, name); |
} |
- |
RawFunction* Class::LookupSetterFunction(const String& name) const { |
return LookupAccessorFunction(kSetterPrefix, kSetterPrefixLength, name); |
} |
- |
RawFunction* Class::LookupAccessorFunction(const char* prefix, |
intptr_t prefix_length, |
const String& name) const { |
@@ -4273,22 +4111,18 @@ RawFunction* Class::LookupAccessorFunction(const char* prefix, |
return Function::null(); |
} |
- |
RawField* Class::LookupInstanceField(const String& name) const { |
return LookupField(name, kInstance); |
} |
- |
RawField* Class::LookupStaticField(const String& name) const { |
return LookupField(name, kStatic); |
} |
- |
RawField* Class::LookupField(const String& name) const { |
return LookupField(name, kAny); |
} |
- |
RawField* Class::LookupField(const String& name, MemberKind kind) const { |
Thread* thread = Thread::Current(); |
if (EnsureIsFinalized(thread) != Error::null()) { |
@@ -4335,7 +4169,6 @@ RawField* Class::LookupField(const String& name, MemberKind kind) const { |
return Field::null(); |
} |
- |
RawField* Class::LookupFieldAllowPrivate(const String& name, |
bool instance_only) const { |
// Use slow string compare, ignoring privacy name mangling. |
@@ -4366,7 +4199,6 @@ RawField* Class::LookupFieldAllowPrivate(const String& name, |
return Field::null(); |
} |
- |
RawField* Class::LookupInstanceFieldAllowPrivate(const String& name) const { |
Field& field = Field::Handle(LookupFieldAllowPrivate(name, true)); |
if (!field.IsNull() && !field.is_static()) { |
@@ -4375,7 +4207,6 @@ RawField* Class::LookupInstanceFieldAllowPrivate(const String& name) const { |
return Field::null(); |
} |
- |
RawField* Class::LookupStaticFieldAllowPrivate(const String& name) const { |
Field& field = Field::Handle(LookupFieldAllowPrivate(name)); |
if (!field.IsNull() && field.is_static()) { |
@@ -4384,7 +4215,6 @@ RawField* Class::LookupStaticFieldAllowPrivate(const String& name) const { |
return Field::null(); |
} |
- |
RawLibraryPrefix* Class::LookupLibraryPrefix(const String& name) const { |
Zone* zone = Thread::Current()->zone(); |
const Library& lib = Library::Handle(zone, library()); |
@@ -4395,7 +4225,6 @@ RawLibraryPrefix* Class::LookupLibraryPrefix(const String& name) const { |
return LibraryPrefix::null(); |
} |
- |
const char* Class::ToCString() const { |
const Library& lib = Library::Handle(library()); |
const char* library_name = lib.IsNull() ? "" : lib.ToCString(); |
@@ -4405,7 +4234,6 @@ const char* Class::ToCString() const { |
patch_prefix, class_name); |
} |
- |
// Returns an instance of Double or Double::null(). |
// 'index' points to either: |
// - constants_list_ position of found element, or |
@@ -4433,7 +4261,6 @@ RawDouble* Class::LookupCanonicalDouble(Zone* zone, |
return Double::null(); |
} |
- |
RawMint* Class::LookupCanonicalMint(Zone* zone, |
int64_t value, |
intptr_t* index) const { |
@@ -4457,7 +4284,6 @@ RawMint* Class::LookupCanonicalMint(Zone* zone, |
return Mint::null(); |
} |
- |
RawBigint* Class::LookupCanonicalBigint(Zone* zone, |
const Bigint& value, |
intptr_t* index) const { |
@@ -4481,7 +4307,6 @@ RawBigint* Class::LookupCanonicalBigint(Zone* zone, |
return Bigint::null(); |
} |
- |
class CanonicalInstanceKey { |
public: |
explicit CanonicalInstanceKey(const Instance& key) : key_(key) { |
@@ -4502,7 +4327,6 @@ class CanonicalInstanceKey { |
DISALLOW_ALLOCATION(); |
}; |
- |
// Traits for looking up Canonical Instances based on a hash of the fields. |
class CanonicalInstanceTraits { |
public: |
@@ -4530,7 +4354,6 @@ class CanonicalInstanceTraits { |
}; |
typedef UnorderedHashSet<CanonicalInstanceTraits> CanonicalInstancesSet; |
- |
RawInstance* Class::LookupCanonicalInstance(Zone* zone, |
const Instance& value) const { |
ASSERT(this->raw() == value.clazz()); |
@@ -4544,7 +4367,6 @@ RawInstance* Class::LookupCanonicalInstance(Zone* zone, |
return canonical_value.raw(); |
} |
- |
RawInstance* Class::InsertCanonicalConstant(Zone* zone, |
const Instance& constant) const { |
ASSERT(this->raw() == constant.clazz()); |
@@ -4563,7 +4385,6 @@ RawInstance* Class::InsertCanonicalConstant(Zone* zone, |
return canonical_value.raw(); |
} |
- |
void Class::InsertCanonicalNumber(Zone* zone, |
intptr_t index, |
const Number& constant) const { |
@@ -4578,7 +4399,6 @@ void Class::InsertCanonicalNumber(Zone* zone, |
canonical_list.SetAt(index, constant); |
} |
- |
void Class::RehashConstants(Zone* zone) const { |
intptr_t cid = id(); |
if ((cid == kMintCid) || (cid == kBigintCid) || (cid == kDoubleCid)) { |
@@ -4602,7 +4422,6 @@ void Class::RehashConstants(Zone* zone) const { |
set.Release(); |
} |
- |
RawUnresolvedClass* UnresolvedClass::New(const Object& library_prefix, |
const String& ident, |
TokenPosition token_pos) { |
@@ -4613,7 +4432,6 @@ RawUnresolvedClass* UnresolvedClass::New(const Object& library_prefix, |
return type.raw(); |
} |
- |
RawUnresolvedClass* UnresolvedClass::New() { |
ASSERT(Object::unresolved_class_class() != Class::null()); |
RawObject* raw = Object::Allocate( |
@@ -4621,24 +4439,20 @@ RawUnresolvedClass* UnresolvedClass::New() { |
return reinterpret_cast<RawUnresolvedClass*>(raw); |
} |
- |
void UnresolvedClass::set_token_pos(TokenPosition token_pos) const { |
ASSERT(!token_pos.IsClassifying()); |
StoreNonPointer(&raw_ptr()->token_pos_, token_pos); |
} |
- |
void UnresolvedClass::set_ident(const String& ident) const { |
StorePointer(&raw_ptr()->ident_, ident.raw()); |
} |
- |
void UnresolvedClass::set_library_or_library_prefix( |
const Object& library_prefix) const { |
StorePointer(&raw_ptr()->library_or_library_prefix_, library_prefix.raw()); |
} |
- |
RawString* UnresolvedClass::Name() const { |
if (library_or_library_prefix() != Object::null()) { |
Thread* thread = Thread::Current(); |
@@ -4661,13 +4475,11 @@ RawString* UnresolvedClass::Name() const { |
} |
} |
- |
const char* UnresolvedClass::ToCString() const { |
const char* cname = String::Handle(Name()).ToCString(); |
return OS::SCreate(Thread::Current()->zone(), "unresolved class '%s'", cname); |
} |
- |
static uint32_t CombineHashes(uint32_t hash, uint32_t other_hash) { |
hash += other_hash; |
hash += hash << 10; |
@@ -4675,7 +4487,6 @@ static uint32_t CombineHashes(uint32_t hash, uint32_t other_hash) { |
return hash; |
} |
- |
static uint32_t FinalizeHash(uint32_t hash, intptr_t hashbits) { |
hash += hash << 3; |
hash ^= hash >> 11; // Logical shift, unsigned hash. |
@@ -4687,7 +4498,6 @@ static uint32_t FinalizeHash(uint32_t hash, intptr_t hashbits) { |
return (hash == 0) ? 1 : hash; |
} |
- |
intptr_t TypeArguments::ComputeHash() const { |
if (IsNull()) return 0; |
const intptr_t num_types = Length(); |
@@ -4705,7 +4515,6 @@ intptr_t TypeArguments::ComputeHash() const { |
return result; |
} |
- |
RawString* TypeArguments::SubvectorName(intptr_t from_index, |
intptr_t len, |
NameVisibility name_visibility) const { |
@@ -4731,7 +4540,6 @@ RawString* TypeArguments::SubvectorName(intptr_t from_index, |
return Symbols::FromConcatAll(thread, pieces); |
} |
- |
bool TypeArguments::IsSubvectorEquivalent(const TypeArguments& other, |
intptr_t from_index, |
intptr_t len, |
@@ -4758,7 +4566,6 @@ bool TypeArguments::IsSubvectorEquivalent(const TypeArguments& other, |
return true; |
} |
- |
bool TypeArguments::IsRecursive() const { |
if (IsNull()) return false; |
const intptr_t num_types = Length(); |
@@ -4776,7 +4583,6 @@ bool TypeArguments::IsRecursive() const { |
return false; |
} |
- |
bool TypeArguments::IsDynamicTypes(bool raw_instantiated, |
intptr_t from_index, |
intptr_t len) const { |
@@ -4804,7 +4610,6 @@ bool TypeArguments::IsDynamicTypes(bool raw_instantiated, |
return true; |
} |
- |
bool TypeArguments::TypeTest(TypeTestKind test_kind, |
const TypeArguments& other, |
intptr_t from_index, |
@@ -4829,14 +4634,12 @@ bool TypeArguments::TypeTest(TypeTestKind test_kind, |
return true; |
} |
- |
bool TypeArguments::HasInstantiations() const { |
const Array& prior_instantiations = Array::Handle(instantiations()); |
ASSERT(prior_instantiations.Length() > 0); // Always at least a sentinel. |
return prior_instantiations.Length() > 1; |
} |
- |
intptr_t TypeArguments::NumInstantiations() const { |
const Array& prior_instantiations = Array::Handle(instantiations()); |
ASSERT(prior_instantiations.Length() > 0); // Always at least a sentinel. |
@@ -4849,18 +4652,15 @@ intptr_t TypeArguments::NumInstantiations() const { |
return num; |
} |
- |
RawArray* TypeArguments::instantiations() const { |
return raw_ptr()->instantiations_; |
} |
- |
void TypeArguments::set_instantiations(const Array& value) const { |
ASSERT(!value.IsNull()); |
StorePointer(&raw_ptr()->instantiations_, value.raw()); |
} |
- |
intptr_t TypeArguments::Length() const { |
if (IsNull()) { |
return 0; |
@@ -4868,18 +4668,15 @@ intptr_t TypeArguments::Length() const { |
return Smi::Value(raw_ptr()->length_); |
} |
- |
RawAbstractType* TypeArguments::TypeAt(intptr_t index) const { |
return *TypeAddr(index); |
} |
- |
void TypeArguments::SetTypeAt(intptr_t index, const AbstractType& value) const { |
ASSERT(!IsCanonical()); |
StorePointer(TypeAddr(index), value.raw()); |
} |
- |
bool TypeArguments::IsResolved() const { |
if (IsCanonical()) { |
return true; |
@@ -4895,7 +4692,6 @@ bool TypeArguments::IsResolved() const { |
return true; |
} |
- |
bool TypeArguments::IsSubvectorInstantiated(intptr_t from_index, |
intptr_t len, |
Genericity genericity, |
@@ -4919,7 +4715,6 @@ bool TypeArguments::IsSubvectorInstantiated(intptr_t from_index, |
return true; |
} |
- |
bool TypeArguments::IsUninstantiatedIdentity() const { |
AbstractType& type = AbstractType::Handle(); |
const intptr_t num_types = Length(); |
@@ -4955,7 +4750,6 @@ bool TypeArguments::IsUninstantiatedIdentity() const { |
// many different type parameters as it is long. |
} |
- |
// Return true if this uninstantiated type argument vector, once instantiated |
// at runtime, is a prefix of the type argument vector of its instantiator. |
bool TypeArguments::CanShareInstantiatorTypeArguments( |
@@ -5024,7 +4818,6 @@ bool TypeArguments::CanShareInstantiatorTypeArguments( |
return true; |
} |
- |
bool TypeArguments::IsFinalized() const { |
ASSERT(!IsNull()); |
AbstractType& type = AbstractType::Handle(); |
@@ -5038,7 +4831,6 @@ bool TypeArguments::IsFinalized() const { |
return true; |
} |
- |
bool TypeArguments::IsBounded() const { |
AbstractType& type = AbstractType::Handle(); |
const intptr_t num_types = Length(); |
@@ -5064,7 +4856,6 @@ bool TypeArguments::IsBounded() const { |
return false; |
} |
- |
RawTypeArguments* TypeArguments::InstantiateFrom( |
const TypeArguments& instantiator_type_arguments, |
const TypeArguments& function_type_arguments, |
@@ -5099,7 +4890,6 @@ RawTypeArguments* TypeArguments::InstantiateFrom( |
return instantiated_array.raw(); |
} |
- |
RawTypeArguments* TypeArguments::InstantiateAndCanonicalizeFrom( |
const TypeArguments& instantiator_type_arguments, |
const TypeArguments& function_type_arguments, |
@@ -5163,7 +4953,6 @@ RawTypeArguments* TypeArguments::InstantiateAndCanonicalizeFrom( |
return result.raw(); |
} |
- |
RawTypeArguments* TypeArguments::New(intptr_t len, Heap::Space space) { |
if (len < 0 || len > kMaxElements) { |
// This should be caught before we reach here. |
@@ -5186,13 +4975,11 @@ RawTypeArguments* TypeArguments::New(intptr_t len, Heap::Space space) { |
return result.raw(); |
} |
- |
RawAbstractType* const* TypeArguments::TypeAddr(intptr_t index) const { |
ASSERT((index >= 0) && (index < Length())); |
return &raw_ptr()->types()[index]; |
} |
- |
void TypeArguments::SetLength(intptr_t value) const { |
ASSERT(!IsCanonical()); |
// This is only safe because we create a new Smi, which does not cause |
@@ -5200,7 +4987,6 @@ void TypeArguments::SetLength(intptr_t value) const { |
StoreSmi(&raw_ptr()->length_, Smi::New(value)); |
} |
- |
RawTypeArguments* TypeArguments::CloneUnfinalized() const { |
if (IsNull() || IsFinalized()) { |
return raw(); |
@@ -5219,7 +5005,6 @@ RawTypeArguments* TypeArguments::CloneUnfinalized() const { |
return clone.raw(); |
} |
- |
RawTypeArguments* TypeArguments::CloneUninstantiated(const Class& new_owner, |
TrailPtr trail) const { |
ASSERT(!IsNull()); |
@@ -5240,7 +5025,6 @@ RawTypeArguments* TypeArguments::CloneUninstantiated(const Class& new_owner, |
return clone.raw(); |
} |
- |
RawTypeArguments* TypeArguments::Canonicalize(TrailPtr trail) const { |
if (IsNull() || IsCanonical()) { |
ASSERT(IsOld()); |
@@ -5309,7 +5093,6 @@ RawTypeArguments* TypeArguments::Canonicalize(TrailPtr trail) const { |
return result.raw(); |
} |
- |
RawString* TypeArguments::EnumerateURIs() const { |
if (IsNull()) { |
return Symbols::Empty().raw(); |
@@ -5326,7 +5109,6 @@ RawString* TypeArguments::EnumerateURIs() const { |
return String::ConcatAll(pieces); |
} |
- |
const char* TypeArguments::ToCString() const { |
if (IsNull()) { |
return "TypeArguments: null"; |
@@ -5343,14 +5125,12 @@ const char* TypeArguments::ToCString() const { |
return prev_cstr; |
} |
- |
const char* PatchClass::ToCString() const { |
const Class& cls = Class::Handle(patched_class()); |
const char* cls_name = cls.ToCString(); |
return OS::SCreate(Thread::Current()->zone(), "PatchClass for %s", cls_name); |
} |
- |
RawPatchClass* PatchClass::New(const Class& patched_class, |
const Class& origin_class) { |
const PatchClass& result = PatchClass::Handle(PatchClass::New()); |
@@ -5360,7 +5140,6 @@ RawPatchClass* PatchClass::New(const Class& patched_class, |
return result.raw(); |
} |
- |
RawPatchClass* PatchClass::New(const Class& patched_class, |
const Script& script) { |
const PatchClass& result = PatchClass::Handle(PatchClass::New()); |
@@ -5370,7 +5149,6 @@ RawPatchClass* PatchClass::New(const Class& patched_class, |
return result.raw(); |
} |
- |
RawPatchClass* PatchClass::New() { |
ASSERT(Object::patch_class_class() != Class::null()); |
RawObject* raw = Object::Allocate(PatchClass::kClassId, |
@@ -5378,27 +5156,22 @@ RawPatchClass* PatchClass::New() { |
return reinterpret_cast<RawPatchClass*>(raw); |
} |
- |
void PatchClass::set_patched_class(const Class& value) const { |
StorePointer(&raw_ptr()->patched_class_, value.raw()); |
} |
- |
void PatchClass::set_origin_class(const Class& value) const { |
StorePointer(&raw_ptr()->origin_class_, value.raw()); |
} |
- |
void PatchClass::set_script(const Script& value) const { |
StorePointer(&raw_ptr()->script_, value.raw()); |
} |
- |
intptr_t Function::Hash() const { |
return String::HashRawSymbol(name()); |
} |
- |
bool Function::HasBreakpoint() const { |
if (!FLAG_support_debugger) { |
return false; |
@@ -5407,7 +5180,6 @@ bool Function::HasBreakpoint() const { |
return thread->isolate()->debugger()->HasBreakpoint(*this, thread->zone()); |
} |
- |
void Function::InstallOptimizedCode(const Code& code) const { |
DEBUG_ASSERT(IsMutatorOrAtSafepoint()); |
// We may not have previous code if FLAG_precompile is set. |
@@ -5418,19 +5190,16 @@ void Function::InstallOptimizedCode(const Code& code) const { |
AttachCode(code); |
} |
- |
void Function::SetInstructions(const Code& value) const { |
DEBUG_ASSERT(IsMutatorOrAtSafepoint()); |
SetInstructionsSafe(value); |
} |
- |
void Function::SetInstructionsSafe(const Code& value) const { |
StorePointer(&raw_ptr()->code_, value.raw()); |
StoreNonPointer(&raw_ptr()->entry_point_, value.UncheckedEntryPoint()); |
} |
- |
void Function::AttachCode(const Code& value) const { |
DEBUG_ASSERT(IsMutatorOrAtSafepoint()); |
// Finish setting up code before activating it. |
@@ -5440,13 +5209,11 @@ void Function::AttachCode(const Code& value) const { |
(value.function() == this->raw())); |
} |
- |
bool Function::HasCode() const { |
ASSERT(raw_ptr()->code_ != Code::null()); |
return raw_ptr()->code_ != StubCode::LazyCompile_entry()->code(); |
} |
- |
void Function::ClearCode() const { |
#if defined(DART_PRECOMPILED_RUNTIME) |
UNREACHABLE(); |
@@ -5457,7 +5224,6 @@ void Function::ClearCode() const { |
#endif |
} |
- |
void Function::EnsureHasCompiledUnoptimizedCode() const { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -5470,7 +5236,6 @@ void Function::EnsureHasCompiledUnoptimizedCode() const { |
} |
} |
- |
void Function::SwitchToUnoptimizedCode() const { |
ASSERT(HasOptimizedCode()); |
Thread* thread = Thread::Current(); |
@@ -5495,7 +5260,6 @@ void Function::SwitchToUnoptimizedCode() const { |
isolate->TrackDeoptimizedCode(current_code); |
} |
- |
void Function::SwitchToLazyCompiledUnoptimizedCode() const { |
if (!HasOptimizedCode()) { |
return; |
@@ -5523,7 +5287,6 @@ void Function::SwitchToLazyCompiledUnoptimizedCode() const { |
unopt_code.Enable(); |
} |
- |
void Function::set_unoptimized_code(const Code& value) const { |
#if defined(DART_PRECOMPILED_RUNTIME) |
UNREACHABLE(); |
@@ -5534,7 +5297,6 @@ void Function::set_unoptimized_code(const Code& value) const { |
#endif |
} |
- |
RawContextScope* Function::context_scope() const { |
if (IsClosureFunction()) { |
const Object& obj = Object::Handle(raw_ptr()->data_); |
@@ -5544,7 +5306,6 @@ RawContextScope* Function::context_scope() const { |
return ContextScope::null(); |
} |
- |
void Function::set_context_scope(const ContextScope& value) const { |
if (IsClosureFunction()) { |
const Object& obj = Object::Handle(raw_ptr()->data_); |
@@ -5555,7 +5316,6 @@ void Function::set_context_scope(const ContextScope& value) const { |
UNREACHABLE(); |
} |
- |
RawInstance* Function::implicit_static_closure() const { |
if (IsImplicitStaticClosureFunction()) { |
const Object& obj = Object::Handle(raw_ptr()->data_); |
@@ -5565,7 +5325,6 @@ RawInstance* Function::implicit_static_closure() const { |
return Instance::null(); |
} |
- |
void Function::set_implicit_static_closure(const Instance& closure) const { |
if (IsImplicitStaticClosureFunction()) { |
const Object& obj = Object::Handle(raw_ptr()->data_); |
@@ -5576,7 +5335,6 @@ void Function::set_implicit_static_closure(const Instance& closure) const { |
UNREACHABLE(); |
} |
- |
RawScript* Function::eval_script() const { |
const Object& obj = Object::Handle(raw_ptr()->data_); |
if (obj.IsScript()) { |
@@ -5585,14 +5343,12 @@ RawScript* Function::eval_script() const { |
return Script::null(); |
} |
- |
void Function::set_eval_script(const Script& script) const { |
ASSERT(token_pos() == TokenPosition::kMinSource); |
ASSERT(raw_ptr()->data_ == Object::null()); |
set_data(script); |
} |
- |
RawFunction* Function::extracted_method_closure() const { |
ASSERT(kind() == RawFunction::kMethodExtractor); |
const Object& obj = Object::Handle(raw_ptr()->data_); |
@@ -5600,14 +5356,12 @@ RawFunction* Function::extracted_method_closure() const { |
return Function::Cast(obj).raw(); |
} |
- |
void Function::set_extracted_method_closure(const Function& value) const { |
ASSERT(kind() == RawFunction::kMethodExtractor); |
ASSERT(raw_ptr()->data_ == Object::null()); |
set_data(value); |
} |
- |
RawArray* Function::saved_args_desc() const { |
ASSERT(kind() == RawFunction::kNoSuchMethodDispatcher || |
kind() == RawFunction::kInvokeFieldDispatcher); |
@@ -5616,7 +5370,6 @@ RawArray* Function::saved_args_desc() const { |
return Array::Cast(obj).raw(); |
} |
- |
void Function::set_saved_args_desc(const Array& value) const { |
ASSERT(kind() == RawFunction::kNoSuchMethodDispatcher || |
kind() == RawFunction::kInvokeFieldDispatcher); |
@@ -5624,7 +5377,6 @@ void Function::set_saved_args_desc(const Array& value) const { |
set_data(value); |
} |
- |
RawField* Function::LookupImplicitGetterSetterField() const { |
ASSERT((kind() == RawFunction::kImplicitGetter) || |
(kind() == RawFunction::kImplicitSetter) || |
@@ -5644,7 +5396,6 @@ RawField* Function::LookupImplicitGetterSetterField() const { |
return Field::null(); |
} |
- |
RawFunction* Function::parent_function() const { |
if (IsClosureFunction() || IsSignatureFunction()) { |
const Object& obj = Object::Handle(raw_ptr()->data_); |
@@ -5658,7 +5409,6 @@ RawFunction* Function::parent_function() const { |
return Function::null(); |
} |
- |
void Function::set_parent_function(const Function& value) const { |
const Object& obj = Object::Handle(raw_ptr()->data_); |
ASSERT(!obj.IsNull()); |
@@ -5670,7 +5420,6 @@ void Function::set_parent_function(const Function& value) const { |
} |
} |
- |
bool Function::HasGenericParent() const { |
if (IsImplicitClosureFunction()) { |
// The parent function of an implicit closure function is not the enclosing |
@@ -5687,7 +5436,6 @@ bool Function::HasGenericParent() const { |
return false; |
} |
- |
RawFunction* Function::implicit_closure_function() const { |
if (IsClosureFunction() || IsSignatureFunction() || IsFactory()) { |
return Function::null(); |
@@ -5706,7 +5454,6 @@ RawFunction* Function::implicit_closure_function() const { |
return res.IsNull() ? Function::null() : Function::Cast(res).raw(); |
} |
- |
void Function::set_implicit_closure_function(const Function& value) const { |
ASSERT(!IsClosureFunction() && !IsSignatureFunction()); |
if (is_native()) { |
@@ -5720,7 +5467,6 @@ void Function::set_implicit_closure_function(const Function& value) const { |
} |
} |
- |
RawType* Function::ExistingSignatureType() const { |
const Object& obj = Object::Handle(raw_ptr()->data_); |
ASSERT(!obj.IsNull()); |
@@ -5732,7 +5478,6 @@ RawType* Function::ExistingSignatureType() const { |
} |
} |
- |
RawFunction* Function::CanonicalSignatureFunction(TrailPtr trail) const { |
ASSERT(!IsSignatureFunction()); |
Zone* zone = Thread::Current()->zone(); |
@@ -5770,7 +5515,6 @@ RawFunction* Function::CanonicalSignatureFunction(TrailPtr trail) const { |
return sig_fun.raw(); |
} |
- |
RawType* Function::SignatureType() const { |
Type& type = Type::Handle(ExistingSignatureType()); |
if (type.IsNull()) { |
@@ -5812,7 +5556,6 @@ RawType* Function::SignatureType() const { |
return type.raw(); |
} |
- |
void Function::SetSignatureType(const Type& value) const { |
const Object& obj = Object::Handle(raw_ptr()->data_); |
ASSERT(!obj.IsNull()); |
@@ -5825,7 +5568,6 @@ void Function::SetSignatureType(const Type& value) const { |
} |
} |
- |
bool Function::IsRedirectingFactory() const { |
if (!IsFactory() || !is_redirecting()) { |
return false; |
@@ -5834,7 +5576,6 @@ bool Function::IsRedirectingFactory() const { |
return true; |
} |
- |
RawType* Function::RedirectionType() const { |
ASSERT(IsRedirectingFactory()); |
ASSERT(!is_native()); |
@@ -5843,7 +5584,6 @@ RawType* Function::RedirectionType() const { |
return RedirectionData::Cast(obj).type(); |
} |
- |
const char* Function::KindToCString(RawFunction::Kind kind) { |
switch (kind) { |
case RawFunction::kRegularFunction: |
@@ -5891,7 +5631,6 @@ const char* Function::KindToCString(RawFunction::Kind kind) { |
} |
} |
- |
void Function::SetRedirectionType(const Type& type) const { |
ASSERT(IsFactory()); |
Object& obj = Object::Handle(raw_ptr()->data_); |
@@ -5902,7 +5641,6 @@ void Function::SetRedirectionType(const Type& type) const { |
RedirectionData::Cast(obj).set_type(type); |
} |
- |
RawString* Function::RedirectionIdentifier() const { |
ASSERT(IsRedirectingFactory()); |
const Object& obj = Object::Handle(raw_ptr()->data_); |
@@ -5910,7 +5648,6 @@ RawString* Function::RedirectionIdentifier() const { |
return RedirectionData::Cast(obj).identifier(); |
} |
- |
void Function::SetRedirectionIdentifier(const String& identifier) const { |
ASSERT(IsFactory()); |
Object& obj = Object::Handle(raw_ptr()->data_); |
@@ -5921,7 +5658,6 @@ void Function::SetRedirectionIdentifier(const String& identifier) const { |
RedirectionData::Cast(obj).set_identifier(identifier); |
} |
- |
RawFunction* Function::RedirectionTarget() const { |
ASSERT(IsRedirectingFactory()); |
const Object& obj = Object::Handle(raw_ptr()->data_); |
@@ -5929,7 +5665,6 @@ RawFunction* Function::RedirectionTarget() const { |
return RedirectionData::Cast(obj).target(); |
} |
- |
void Function::SetRedirectionTarget(const Function& target) const { |
ASSERT(IsFactory()); |
Object& obj = Object::Handle(raw_ptr()->data_); |
@@ -5940,7 +5675,6 @@ void Function::SetRedirectionTarget(const Function& target) const { |
RedirectionData::Cast(obj).set_target(target); |
} |
- |
// This field is heavily overloaded: |
// eval function: Script expression source |
// signature function: SignatureData |
@@ -5958,7 +5692,6 @@ void Function::set_data(const Object& value) const { |
StorePointer(&raw_ptr()->data_, value.raw()); |
} |
- |
bool Function::IsInFactoryScope() const { |
if (!IsLocalFunction()) { |
return IsFactory(); |
@@ -5970,45 +5703,38 @@ bool Function::IsInFactoryScope() const { |
return outer_function.IsFactory(); |
} |
- |
void Function::set_name(const String& value) const { |
ASSERT(value.IsSymbol()); |
StorePointer(&raw_ptr()->name_, value.raw()); |
} |
- |
void Function::set_owner(const Object& value) const { |
ASSERT(!value.IsNull() || IsSignatureFunction()); |
StorePointer(&raw_ptr()->owner_, value.raw()); |
} |
- |
RawRegExp* Function::regexp() const { |
ASSERT(kind() == RawFunction::kIrregexpFunction); |
const Array& pair = Array::Cast(Object::Handle(raw_ptr()->data_)); |
return RegExp::RawCast(pair.At(0)); |
} |
- |
class StickySpecialization : public BitField<intptr_t, bool, 0, 1> {}; |
class StringSpecializationCid |
: public BitField<intptr_t, intptr_t, 1, RawObject::kClassIdTagSize> {}; |
- |
intptr_t Function::string_specialization_cid() const { |
ASSERT(kind() == RawFunction::kIrregexpFunction); |
const Array& pair = Array::Cast(Object::Handle(raw_ptr()->data_)); |
return StringSpecializationCid::decode(Smi::Value(Smi::RawCast(pair.At(1)))); |
} |
- |
bool Function::is_sticky_specialization() const { |
ASSERT(kind() == RawFunction::kIrregexpFunction); |
const Array& pair = Array::Cast(Object::Handle(raw_ptr()->data_)); |
return StickySpecialization::decode(Smi::Value(Smi::RawCast(pair.At(1)))); |
} |
- |
void Function::SetRegExpData(const RegExp& regexp, |
intptr_t string_specialization_cid, |
bool sticky) const { |
@@ -6023,7 +5749,6 @@ void Function::SetRegExpData(const RegExp& regexp, |
set_data(pair); |
} |
- |
RawString* Function::native_name() const { |
ASSERT(is_native()); |
const Object& obj = Object::Handle(raw_ptr()->data_); |
@@ -6031,7 +5756,6 @@ RawString* Function::native_name() const { |
return String::RawCast(Array::Cast(obj).At(0)); |
} |
- |
void Function::set_native_name(const String& value) const { |
ASSERT(is_native()); |
ASSERT(raw_ptr()->data_ == Object::null()); |
@@ -6041,7 +5765,6 @@ void Function::set_native_name(const String& value) const { |
set_data(pair); |
} |
- |
void Function::set_result_type(const AbstractType& value) const { |
ASSERT(!value.IsNull()); |
StorePointer(&raw_ptr()->result_type_, value.raw()); |
@@ -6054,13 +5777,11 @@ void Function::set_result_type(const AbstractType& value) const { |
} |
} |
- |
RawAbstractType* Function::ParameterTypeAt(intptr_t index) const { |
const Array& parameter_types = Array::Handle(raw_ptr()->parameter_types_); |
return AbstractType::RawCast(parameter_types.At(index)); |
} |
- |
void Function::SetParameterTypeAt(intptr_t index, |
const AbstractType& value) const { |
ASSERT(!value.IsNull()); |
@@ -6070,35 +5791,29 @@ void Function::SetParameterTypeAt(intptr_t index, |
parameter_types.SetAt(index, value); |
} |
- |
void Function::set_parameter_types(const Array& value) const { |
StorePointer(&raw_ptr()->parameter_types_, value.raw()); |
} |
- |
RawString* Function::ParameterNameAt(intptr_t index) const { |
const Array& parameter_names = Array::Handle(raw_ptr()->parameter_names_); |
return String::RawCast(parameter_names.At(index)); |
} |
- |
void Function::SetParameterNameAt(intptr_t index, const String& value) const { |
ASSERT(!value.IsNull() && value.IsSymbol()); |
const Array& parameter_names = Array::Handle(raw_ptr()->parameter_names_); |
parameter_names.SetAt(index, value); |
} |
- |
void Function::set_parameter_names(const Array& value) const { |
StorePointer(&raw_ptr()->parameter_names_, value.raw()); |
} |
- |
void Function::set_type_parameters(const TypeArguments& value) const { |
StorePointer(&raw_ptr()->type_parameters_, value.raw()); |
} |
- |
intptr_t Function::NumTypeParameters(Thread* thread) const { |
if (type_parameters() == TypeArguments::null()) { |
return 0; |
@@ -6111,7 +5826,6 @@ intptr_t Function::NumTypeParameters(Thread* thread) const { |
return type_params.Length(); |
} |
- |
intptr_t Function::NumParentTypeParameters() const { |
if (IsImplicitClosureFunction()) { |
return 0; |
@@ -6126,7 +5840,6 @@ intptr_t Function::NumParentTypeParameters() const { |
return num_parent_type_params; |
} |
- |
RawTypeParameter* Function::LookupTypeParameter( |
const String& type_name, |
intptr_t* function_level) const { |
@@ -6167,24 +5880,20 @@ RawTypeParameter* Function::LookupTypeParameter( |
return TypeParameter::null(); |
} |
- |
void Function::set_kind(RawFunction::Kind value) const { |
set_kind_tag(KindBits::update(value, raw_ptr()->kind_tag_)); |
} |
- |
void Function::set_modifier(RawFunction::AsyncModifier value) const { |
set_kind_tag(ModifierBits::update(value, raw_ptr()->kind_tag_)); |
} |
- |
void Function::set_recognized_kind(MethodRecognizer::Kind value) const { |
// Prevent multiple settings of kind. |
ASSERT((value == MethodRecognizer::kUnknown) || !IsRecognized()); |
set_kind_tag(RecognizedBits::update(value, raw_ptr()->kind_tag_)); |
} |
- |
void Function::set_token_pos(TokenPosition token_pos) const { |
#if defined(DART_PRECOMPILED_RUNTIME) |
UNREACHABLE(); |
@@ -6194,12 +5903,10 @@ void Function::set_token_pos(TokenPosition token_pos) const { |
#endif |
} |
- |
void Function::set_kind_tag(uint32_t value) const { |
StoreNonPointer(&raw_ptr()->kind_tag_, static_cast<uint32_t>(value)); |
} |
- |
void Function::set_num_fixed_parameters(intptr_t value) const { |
ASSERT(value >= 0); |
ASSERT(Utils::IsInt(16, value)); |
@@ -6207,7 +5914,6 @@ void Function::set_num_fixed_parameters(intptr_t value) const { |
static_cast<int16_t>(value)); |
} |
- |
void Function::set_num_optional_parameters(intptr_t value) const { |
// A positive value indicates positional params, a negative one named params. |
ASSERT(Utils::IsInt(16, value)); |
@@ -6215,7 +5921,6 @@ void Function::set_num_optional_parameters(intptr_t value) const { |
static_cast<int16_t>(value)); |
} |
- |
void Function::SetNumOptionalParameters(intptr_t num_optional_parameters, |
bool are_optional_positional) const { |
ASSERT(num_optional_parameters >= 0); |
@@ -6224,7 +5929,6 @@ void Function::SetNumOptionalParameters(intptr_t num_optional_parameters, |
: -num_optional_parameters); |
} |
- |
bool Function::IsOptimizable() const { |
if (FLAG_precompiled_mode) { |
return true; |
@@ -6244,7 +5948,6 @@ bool Function::IsOptimizable() const { |
return false; |
} |
- |
void Function::SetIsOptimizable(bool value) const { |
ASSERT(!is_native()); |
set_is_optimizable(value); |
@@ -6254,7 +5957,6 @@ void Function::SetIsOptimizable(bool value) const { |
} |
} |
- |
bool Function::CanBeInlined() const { |
Thread* thread = Thread::Current(); |
return is_inlinable() && !is_external() && !is_generated_body() && |
@@ -6262,12 +5964,10 @@ bool Function::CanBeInlined() const { |
!thread->isolate()->debugger()->HasBreakpoint(*this, thread->zone())); |
} |
- |
intptr_t Function::NumParameters() const { |
return num_fixed_parameters() + NumOptionalParameters(); |
} |
- |
intptr_t Function::NumImplicitParameters() const { |
if (kind() == RawFunction::kConstructor) { |
// Type arguments for factory; instance for generative constructor. |
@@ -6288,7 +5988,6 @@ intptr_t Function::NumImplicitParameters() const { |
return 0; // No implicit parameters. |
} |
- |
bool Function::AreValidArgumentCounts(intptr_t num_type_arguments, |
intptr_t num_arguments, |
intptr_t num_named_arguments, |
@@ -6362,7 +6061,6 @@ bool Function::AreValidArgumentCounts(intptr_t num_type_arguments, |
return true; |
} |
- |
bool Function::AreValidArguments(intptr_t num_type_arguments, |
intptr_t num_arguments, |
const Array& argument_names, |
@@ -6408,7 +6106,6 @@ bool Function::AreValidArguments(intptr_t num_type_arguments, |
return true; |
} |
- |
bool Function::AreValidArguments(const ArgumentsDescriptor& args_desc, |
String* error_message) const { |
const intptr_t num_type_arguments = args_desc.TypeArgsLen(); |
@@ -6454,7 +6151,6 @@ bool Function::AreValidArguments(const ArgumentsDescriptor& args_desc, |
return true; |
} |
- |
// Helper allocating a C string buffer in the zone, printing the fully qualified |
// name of a function in it, and replacing ':' by '_' to make sure the |
// constructed name is a valid C++ identifier for debugging purpose. |
@@ -6465,7 +6161,6 @@ enum QualifiedFunctionLibKind { |
kQualifiedFunctionLibKindLibName |
}; |
- |
static intptr_t ConstructFunctionFullyQualifiedCString( |
const Function& function, |
char** chars, |
@@ -6525,7 +6220,6 @@ static intptr_t ConstructFunctionFullyQualifiedCString( |
return written; |
} |
- |
const char* Function::ToFullyQualifiedCString() const { |
char* chars = NULL; |
ConstructFunctionFullyQualifiedCString(*this, &chars, 0, true, |
@@ -6533,7 +6227,6 @@ const char* Function::ToFullyQualifiedCString() const { |
return chars; |
} |
- |
const char* Function::ToLibNamePrefixedQualifiedCString() const { |
char* chars = NULL; |
ConstructFunctionFullyQualifiedCString(*this, &chars, 0, true, |
@@ -6541,7 +6234,6 @@ const char* Function::ToLibNamePrefixedQualifiedCString() const { |
return chars; |
} |
- |
const char* Function::ToQualifiedCString() const { |
char* chars = NULL; |
ConstructFunctionFullyQualifiedCString(*this, &chars, 0, false, |
@@ -6549,7 +6241,6 @@ const char* Function::ToQualifiedCString() const { |
return chars; |
} |
- |
bool Function::HasCompatibleParametersWith(const Function& other, |
Error* bound_error) const { |
ASSERT(Isolate::Current()->error_on_bad_override()); |
@@ -6596,7 +6287,6 @@ bool Function::HasCompatibleParametersWith(const Function& other, |
return true; |
} |
- |
RawFunction* Function::InstantiateSignatureFrom( |
const TypeArguments& instantiator_type_arguments, |
const TypeArguments& function_type_arguments, |
@@ -6634,7 +6324,6 @@ RawFunction* Function::InstantiateSignatureFrom( |
return sig.raw(); |
} |
- |
// If test_kind == kIsSubtypeOf, checks if the type of the specified parameter |
// of this function is a subtype or a supertype of the type of the specified |
// parameter of the other function. |
@@ -6677,7 +6366,6 @@ bool Function::TestParameterType(TypeTestKind test_kind, |
return true; |
} |
- |
bool Function::HasSameTypeParametersAndBounds(const Function& other) const { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -6711,7 +6399,6 @@ bool Function::HasSameTypeParametersAndBounds(const Function& other) const { |
return true; |
} |
- |
bool Function::TypeTest(TypeTestKind test_kind, |
const Function& other, |
Error* bound_error, |
@@ -6816,7 +6503,6 @@ bool Function::TypeTest(TypeTestKind test_kind, |
return true; |
} |
- |
// The compiler generates an implicit constructor if a class definition |
// does not contain an explicit constructor or factory. The implicit |
// constructor has the same token position as the owner class. |
@@ -6824,7 +6510,6 @@ bool Function::IsImplicitConstructor() const { |
return IsGenerativeConstructor() && (token_pos() == end_token_pos()); |
} |
- |
bool Function::IsImplicitClosureFunction() const { |
if (!IsClosureFunction()) { |
return false; |
@@ -6833,7 +6518,6 @@ bool Function::IsImplicitClosureFunction() const { |
return (parent.implicit_closure_function() == raw()); |
} |
- |
bool Function::IsImplicitStaticClosureFunction(RawFunction* func) { |
NoSafepointScope no_safepoint; |
uint32_t kind_tag = func->ptr()->kind_tag_; |
@@ -6848,13 +6532,11 @@ bool Function::IsImplicitStaticClosureFunction(RawFunction* func) { |
return (parent_function->ptr()->data_ == reinterpret_cast<RawObject*>(func)); |
} |
- |
bool Function::IsConstructorClosureFunction() const { |
return IsClosureFunction() && |
String::Handle(name()).StartsWith(Symbols::ConstructorClosurePrefix()); |
} |
- |
RawFunction* Function::New(Heap::Space space) { |
ASSERT(Object::function_class() != Class::null()); |
RawObject* raw = |
@@ -6862,7 +6544,6 @@ RawFunction* Function::New(Heap::Space space) { |
return reinterpret_cast<RawFunction*>(raw); |
} |
- |
RawFunction* Function::New(const String& name, |
RawFunction::Kind kind, |
bool is_static, |
@@ -6927,7 +6608,6 @@ RawFunction* Function::New(const String& name, |
return result.raw(); |
} |
- |
RawFunction* Function::Clone(const Class& new_owner) const { |
ASSERT(!IsGenerativeConstructor()); |
Thread* thread = Thread::Current(); |
@@ -6977,7 +6657,6 @@ RawFunction* Function::Clone(const Class& new_owner) const { |
return clone.raw(); |
} |
- |
RawFunction* Function::NewClosureFunction(const String& name, |
const Function& parent, |
TokenPosition token_pos) { |
@@ -6996,7 +6675,6 @@ RawFunction* Function::NewClosureFunction(const String& name, |
return result.raw(); |
} |
- |
RawFunction* Function::NewSignatureFunction(const Object& owner, |
const Function& parent, |
TokenPosition token_pos, |
@@ -7017,7 +6695,6 @@ RawFunction* Function::NewSignatureFunction(const Object& owner, |
return result.raw(); |
} |
- |
RawFunction* Function::NewEvalFunction(const Class& owner, |
const Script& script, |
bool is_static) { |
@@ -7114,7 +6791,6 @@ RawFunction* Function::ImplicitClosureFunction() const { |
return closure_function.raw(); |
} |
- |
void Function::DropUncompiledImplicitClosureFunction() const { |
if (implicit_closure_function() != Function::null()) { |
const Function& func = Function::Handle(implicit_closure_function()); |
@@ -7124,7 +6800,6 @@ void Function::DropUncompiledImplicitClosureFunction() const { |
} |
} |
- |
RawString* Function::UserVisibleFormalParameters() const { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -7135,7 +6810,6 @@ RawString* Function::UserVisibleFormalParameters() const { |
return Symbols::FromConcatAll(thread, pieces); |
} |
- |
void Function::BuildSignatureParameters( |
Thread* thread, |
Zone* zone, |
@@ -7194,7 +6868,6 @@ void Function::BuildSignatureParameters( |
} |
} |
- |
RawInstance* Function::ImplicitStaticClosure() const { |
if (implicit_static_closure() == Instance::null()) { |
Zone* zone = Thread::Current()->zone(); |
@@ -7212,7 +6885,6 @@ RawInstance* Function::ImplicitStaticClosure() const { |
return implicit_static_closure(); |
} |
- |
RawInstance* Function::ImplicitInstanceClosure(const Instance& receiver) const { |
ASSERT(IsImplicitClosureFunction()); |
Zone* zone = Thread::Current()->zone(); |
@@ -7230,7 +6902,6 @@ RawInstance* Function::ImplicitInstanceClosure(const Instance& receiver) const { |
*this, context); |
} |
- |
RawSmi* Function::GetClosureHashCode() const { |
ASSERT(IsClosureFunction()); |
const Object& obj = Object::Handle(raw_ptr()->data_); |
@@ -7252,7 +6923,6 @@ RawSmi* Function::GetClosureHashCode() const { |
return Smi::New(result); |
} |
- |
RawString* Function::BuildSignature(NameVisibility name_visibility) const { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -7293,7 +6963,6 @@ RawString* Function::BuildSignature(NameVisibility name_visibility) const { |
return Symbols::FromConcatAll(thread, pieces); |
} |
- |
bool Function::HasInstantiatedSignature(Genericity genericity, |
intptr_t num_free_fun_type_params, |
TrailPtr trail) const { |
@@ -7319,7 +6988,6 @@ bool Function::HasInstantiatedSignature(Genericity genericity, |
return true; |
} |
- |
RawClass* Function::Owner() const { |
if (raw_ptr()->owner_ == Object::null()) { |
ASSERT(IsSignatureFunction()); |
@@ -7333,7 +7001,6 @@ RawClass* Function::Owner() const { |
return PatchClass::Cast(obj).patched_class(); |
} |
- |
RawClass* Function::origin() const { |
if (raw_ptr()->owner_ == Object::null()) { |
ASSERT(IsSignatureFunction()); |
@@ -7347,7 +7014,6 @@ RawClass* Function::origin() const { |
return PatchClass::Cast(obj).origin_class(); |
} |
- |
RawScript* Function::script() const { |
// NOTE(turnidge): If you update this function, you probably want to |
// update Class::PatchFieldsAndFunctions() at the same time. |
@@ -7374,12 +7040,10 @@ RawScript* Function::script() const { |
return PatchClass::Cast(obj).script(); |
} |
- |
bool Function::HasOptimizedCode() const { |
return HasCode() && Code::Handle(CurrentCode()).is_optimized(); |
} |
- |
RawString* Function::UserVisibleName() const { |
if (FLAG_show_internal_names) { |
return name(); |
@@ -7387,7 +7051,6 @@ RawString* Function::UserVisibleName() const { |
return String::ScrubName(String::Handle(name())); |
} |
- |
RawString* Function::QualifiedName(NameVisibility name_visibility) const { |
ASSERT(name_visibility != kInternalName); // We never request it. |
// If |this| is the generated asynchronous body closure, use the |
@@ -7436,7 +7099,6 @@ RawString* Function::QualifiedName(NameVisibility name_visibility) const { |
return result.raw(); |
} |
- |
RawString* Function::GetSource() const { |
if (IsImplicitConstructor() || IsSignatureFunction()) { |
// We may need to handle more cases when the restrictions on mixins are |
@@ -7481,7 +7143,6 @@ RawString* Function::GetSource() const { |
return result.raw(); |
} |
- |
// Construct fingerprint from token stream. The token stream contains also |
// arguments. |
int32_t Function::SourceFingerprint() const { |
@@ -7489,7 +7150,6 @@ int32_t Function::SourceFingerprint() const { |
end_token_pos()); |
} |
- |
void Function::SaveICDataMap( |
const ZoneGrowableArray<const ICData*>& deopt_id_to_ic_data, |
const Array& edge_counters_array) const { |
@@ -7513,7 +7173,6 @@ void Function::SaveICDataMap( |
set_ic_data_array(array); |
} |
- |
void Function::RestoreICDataMap( |
ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data, |
bool clone_ic_data) const { |
@@ -7551,22 +7210,18 @@ void Function::RestoreICDataMap( |
} |
} |
- |
void Function::set_ic_data_array(const Array& value) const { |
StorePointer(&raw_ptr()->ic_data_array_, value.raw()); |
} |
- |
RawArray* Function::ic_data_array() const { |
return raw_ptr()->ic_data_array_; |
} |
- |
void Function::ClearICDataArray() const { |
set_ic_data_array(Array::null_array()); |
} |
- |
void Function::SetDeoptReasonForAll(intptr_t deopt_id, |
ICData::DeoptReasonId reason) { |
const Array& array = Array::Handle(ic_data_array()); |
@@ -7579,7 +7234,6 @@ void Function::SetDeoptReasonForAll(intptr_t deopt_id, |
} |
} |
- |
bool Function::CheckSourceFingerprint(const char* prefix, int32_t fp) const { |
if ((kernel_offset() <= 0) && (SourceFingerprint() != fp)) { |
const bool recalculatingFingerprints = false; |
@@ -7599,7 +7253,6 @@ bool Function::CheckSourceFingerprint(const char* prefix, int32_t fp) const { |
return true; |
} |
- |
RawCode* Function::EnsureHasCode() const { |
if (HasCode()) return CurrentCode(); |
Thread* thread = Thread::Current(); |
@@ -7616,7 +7269,6 @@ RawCode* Function::EnsureHasCode() const { |
return CurrentCode(); |
} |
- |
const char* Function::ToCString() const { |
if (IsNull()) { |
return "Function: null"; |
@@ -7668,34 +7320,28 @@ const char* Function::ToCString() const { |
const_str); |
} |
- |
void ClosureData::set_context_scope(const ContextScope& value) const { |
StorePointer(&raw_ptr()->context_scope_, value.raw()); |
} |
- |
void ClosureData::set_implicit_static_closure(const Instance& closure) const { |
ASSERT(!closure.IsNull()); |
ASSERT(raw_ptr()->closure_ == Instance::null()); |
StorePointer(&raw_ptr()->closure_, closure.raw()); |
} |
- |
void ClosureData::set_hash(intptr_t value) const { |
StorePointer(&raw_ptr()->hash_, static_cast<RawObject*>(Smi::New(value))); |
} |
- |
void ClosureData::set_parent_function(const Function& value) const { |
StorePointer(&raw_ptr()->parent_function_, value.raw()); |
} |
- |
void ClosureData::set_signature_type(const Type& value) const { |
StorePointer(&raw_ptr()->signature_type_, value.raw()); |
} |
- |
RawClosureData* ClosureData::New() { |
ASSERT(Object::closure_data_class() != Class::null()); |
RawObject* raw = Object::Allocate(ClosureData::kClassId, |
@@ -7703,7 +7349,6 @@ RawClosureData* ClosureData::New() { |
return reinterpret_cast<RawClosureData*>(raw); |
} |
- |
const char* ClosureData::ToCString() const { |
if (IsNull()) { |
return "ClosureData: null"; |
@@ -7720,17 +7365,14 @@ const char* ClosureData::ToCString() const { |
reinterpret_cast<uword>(implicit_static_closure())); |
} |
- |
void SignatureData::set_parent_function(const Function& value) const { |
StorePointer(&raw_ptr()->parent_function_, value.raw()); |
} |
- |
void SignatureData::set_signature_type(const Type& value) const { |
StorePointer(&raw_ptr()->signature_type_, value.raw()); |
} |
- |
RawSignatureData* SignatureData::New(Heap::Space space) { |
ASSERT(Object::signature_data_class() != Class::null()); |
RawObject* raw = Object::Allocate(SignatureData::kClassId, |
@@ -7738,7 +7380,6 @@ RawSignatureData* SignatureData::New(Heap::Space space) { |
return reinterpret_cast<RawSignatureData*>(raw); |
} |
- |
const char* SignatureData::ToCString() const { |
if (IsNull()) { |
return "SignatureData: null"; |
@@ -7751,23 +7392,19 @@ const char* SignatureData::ToCString() const { |
type.IsNull() ? "null" : type.ToCString()); |
} |
- |
void RedirectionData::set_type(const Type& value) const { |
ASSERT(!value.IsNull()); |
StorePointer(&raw_ptr()->type_, value.raw()); |
} |
- |
void RedirectionData::set_identifier(const String& value) const { |
StorePointer(&raw_ptr()->identifier_, value.raw()); |
} |
- |
void RedirectionData::set_target(const Function& value) const { |
StorePointer(&raw_ptr()->target_, value.raw()); |
} |
- |
RawRedirectionData* RedirectionData::New() { |
ASSERT(Object::redirection_data_class() != Class::null()); |
RawObject* raw = Object::Allocate( |
@@ -7775,7 +7412,6 @@ RawRedirectionData* RedirectionData::New() { |
return reinterpret_cast<RawRedirectionData*>(raw); |
} |
- |
const char* RedirectionData::ToCString() const { |
if (IsNull()) { |
return "RedirectionData: null"; |
@@ -7790,12 +7426,10 @@ const char* RedirectionData::ToCString() const { |
target_fun.IsNull() ? "null" : target_fun.ToCString()); |
} |
- |
RawField* Field::CloneFromOriginal() const { |
return this->Clone(*this); |
} |
- |
RawField* Field::Original() const { |
if (IsNull()) { |
return Field::null(); |
@@ -7808,73 +7442,60 @@ RawField* Field::Original() const { |
} |
} |
- |
void Field::SetOriginal(const Field& value) const { |
ASSERT(value.IsOriginal()); |
ASSERT(!value.IsNull()); |
StorePointer(&raw_ptr()->owner_, reinterpret_cast<RawObject*>(value.raw())); |
} |
- |
RawString* Field::GetterName(const String& field_name) { |
return String::Concat(Symbols::GetterPrefix(), field_name); |
} |
- |
RawString* Field::GetterSymbol(const String& field_name) { |
return Symbols::FromGet(Thread::Current(), field_name); |
} |
- |
RawString* Field::LookupGetterSymbol(const String& field_name) { |
return Symbols::LookupFromGet(Thread::Current(), field_name); |
} |
- |
RawString* Field::SetterName(const String& field_name) { |
return String::Concat(Symbols::SetterPrefix(), field_name); |
} |
- |
RawString* Field::SetterSymbol(const String& field_name) { |
return Symbols::FromSet(Thread::Current(), field_name); |
} |
- |
RawString* Field::LookupSetterSymbol(const String& field_name) { |
return Symbols::LookupFromSet(Thread::Current(), field_name); |
} |
- |
RawString* Field::NameFromGetter(const String& getter_name) { |
return Symbols::New(Thread::Current(), getter_name, kGetterPrefixLength, |
getter_name.Length() - kGetterPrefixLength); |
} |
- |
RawString* Field::NameFromSetter(const String& setter_name) { |
return Symbols::New(Thread::Current(), setter_name, kSetterPrefixLength, |
setter_name.Length() - kSetterPrefixLength); |
} |
- |
bool Field::IsGetterName(const String& function_name) { |
return function_name.StartsWith(Symbols::GetterPrefix()); |
} |
- |
bool Field::IsSetterName(const String& function_name) { |
return function_name.StartsWith(Symbols::SetterPrefix()); |
} |
- |
void Field::set_name(const String& value) const { |
ASSERT(value.IsSymbol()); |
ASSERT(IsOriginal()); |
StorePointer(&raw_ptr()->name_, value.raw()); |
} |
- |
RawObject* Field::RawOwner() const { |
if (IsOriginal()) { |
return raw_ptr()->owner_; |
@@ -7886,7 +7507,6 @@ RawObject* Field::RawOwner() const { |
} |
} |
- |
RawClass* Field::Owner() const { |
const Field& field = Field::Handle(Original()); |
ASSERT(field.IsOriginal()); |
@@ -7898,7 +7518,6 @@ RawClass* Field::Owner() const { |
return PatchClass::Cast(obj).patched_class(); |
} |
- |
RawClass* Field::Origin() const { |
const Field& field = Field::Handle(Original()); |
ASSERT(field.IsOriginal()); |
@@ -7910,7 +7529,6 @@ RawClass* Field::Origin() const { |
return PatchClass::Cast(obj).origin_class(); |
} |
- |
RawScript* Field::Script() const { |
// NOTE(turnidge): If you update this function, you probably want to |
// update Class::PatchFieldsAndFunctions() at the same time. |
@@ -7924,7 +7542,6 @@ RawScript* Field::Script() const { |
return PatchClass::Cast(obj).script(); |
} |
- |
// Called at finalization time |
void Field::SetFieldType(const AbstractType& value) const { |
ASSERT(Thread::Current()->IsMutatorThread()); |
@@ -7935,7 +7552,6 @@ void Field::SetFieldType(const AbstractType& value) const { |
} |
} |
- |
RawField* Field::New() { |
ASSERT(Object::field_class() != Class::null()); |
RawObject* raw = |
@@ -7943,7 +7559,6 @@ RawField* Field::New() { |
return reinterpret_cast<RawField*>(raw); |
} |
- |
void Field::InitializeNew(const Field& result, |
const String& name, |
bool is_static, |
@@ -7985,7 +7600,6 @@ void Field::InitializeNew(const Field& result, |
} |
} |
- |
RawField* Field::New(const String& name, |
bool is_static, |
bool is_final, |
@@ -8002,7 +7616,6 @@ RawField* Field::New(const String& name, |
return result.raw(); |
} |
- |
RawField* Field::NewTopLevel(const String& name, |
bool is_final, |
bool is_const, |
@@ -8016,7 +7629,6 @@ RawField* Field::NewTopLevel(const String& name, |
return result.raw(); |
} |
- |
RawField* Field::Clone(const Class& new_owner) const { |
Field& clone = Field::Handle(); |
clone ^= Object::Clone(*this, Heap::kOld); |
@@ -8036,7 +7648,6 @@ RawField* Field::Clone(const Class& new_owner) const { |
return clone.raw(); |
} |
- |
RawField* Field::Clone(const Field& original) const { |
if (original.IsNull()) { |
return Field::null(); |
@@ -8049,7 +7660,6 @@ RawField* Field::Clone(const Field& original) const { |
return clone.raw(); |
} |
- |
RawString* Field::InitializingExpression() const { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -8079,7 +7689,6 @@ RawString* Field::InitializingExpression() const { |
return scr.GetSnippet(start_of_expression, end_of_expression); |
} |
- |
RawString* Field::UserVisibleName() const { |
if (FLAG_show_internal_names) { |
return name(); |
@@ -8087,24 +7696,20 @@ RawString* Field::UserVisibleName() const { |
return String::ScrubName(String::Handle(name())); |
} |
- |
intptr_t Field::guarded_list_length() const { |
return Smi::Value(raw_ptr()->guarded_list_length_); |
} |
- |
void Field::set_guarded_list_length(intptr_t list_length) const { |
ASSERT(Thread::Current()->IsMutatorThread()); |
ASSERT(IsOriginal()); |
StoreSmi(&raw_ptr()->guarded_list_length_, Smi::New(list_length)); |
} |
- |
intptr_t Field::guarded_list_length_in_object_offset() const { |
return raw_ptr()->guarded_list_length_in_object_offset_ + kHeapObjectTag; |
} |
- |
void Field::set_guarded_list_length_in_object_offset( |
intptr_t list_length_offset) const { |
ASSERT(Thread::Current()->IsMutatorThread()); |
@@ -8114,7 +7719,6 @@ void Field::set_guarded_list_length_in_object_offset( |
ASSERT(guarded_list_length_in_object_offset() == list_length_offset); |
} |
- |
const char* Field::ToCString() const { |
if (IsNull()) { |
return "Field: null"; |
@@ -8129,7 +7733,6 @@ const char* Field::ToCString() const { |
cls_name, field_name, kF0, kF1, kF2); |
} |
- |
// Build a closure object that gets (or sets) the contents of a static |
// field f and cache the closure in a newly created static field |
// named #f (or #f= in case of a setter). |
@@ -8188,28 +7791,23 @@ RawInstance* Field::AccessorClosure(bool make_setter) const { |
return Instance::RawCast(result.raw()); |
} |
- |
RawInstance* Field::GetterClosure() const { |
return AccessorClosure(false); |
} |
- |
RawInstance* Field::SetterClosure() const { |
return AccessorClosure(true); |
} |
- |
RawArray* Field::dependent_code() const { |
return raw_ptr()->dependent_code_; |
} |
- |
void Field::set_dependent_code(const Array& array) const { |
ASSERT(IsOriginal()); |
StorePointer(&raw_ptr()->dependent_code_, array.raw()); |
} |
- |
class FieldDependentArray : public WeakCodeReferences { |
public: |
explicit FieldDependentArray(const Field& field) |
@@ -8243,7 +7841,6 @@ class FieldDependentArray : public WeakCodeReferences { |
DISALLOW_COPY_AND_ASSIGN(FieldDependentArray); |
}; |
- |
void Field::RegisterDependentCode(const Code& code) const { |
ASSERT(IsOriginal()); |
DEBUG_ASSERT(IsMutatorOrAtSafepoint()); |
@@ -8252,7 +7849,6 @@ void Field::RegisterDependentCode(const Code& code) const { |
a.Register(code); |
} |
- |
void Field::DeoptimizeDependentCode() const { |
ASSERT(Thread::Current()->IsMutatorThread()); |
ASSERT(IsOriginal()); |
@@ -8260,7 +7856,6 @@ void Field::DeoptimizeDependentCode() const { |
a.DisableCode(); |
} |
- |
bool Field::IsConsistentWith(const Field& other) const { |
return (raw_ptr()->guarded_cid_ == other.raw_ptr()->guarded_cid_) && |
(raw_ptr()->is_nullable_ == other.raw_ptr()->is_nullable_) && |
@@ -8269,33 +7864,28 @@ bool Field::IsConsistentWith(const Field& other) const { |
(is_unboxing_candidate() == other.is_unboxing_candidate()); |
} |
- |
bool Field::IsUninitialized() const { |
const Instance& value = Instance::Handle(raw_ptr()->value_.static_value_); |
ASSERT(value.raw() != Object::transition_sentinel().raw()); |
return value.raw() == Object::sentinel().raw(); |
} |
- |
void Field::SetPrecompiledInitializer(const Function& initializer) const { |
ASSERT(IsOriginal()); |
StorePointer(&raw_ptr()->initializer_.precompiled_, initializer.raw()); |
} |
- |
bool Field::HasPrecompiledInitializer() const { |
return raw_ptr()->initializer_.precompiled_->IsHeapObject() && |
raw_ptr()->initializer_.precompiled_->IsFunction(); |
} |
- |
void Field::SetSavedInitialStaticValue(const Instance& value) const { |
ASSERT(IsOriginal()); |
ASSERT(!HasPrecompiledInitializer()); |
StorePointer(&raw_ptr()->initializer_.saved_value_, value.raw()); |
} |
- |
void Field::EvaluateInitializer() const { |
ASSERT(IsOriginal()); |
ASSERT(is_static()); |
@@ -8323,7 +7913,6 @@ void Field::EvaluateInitializer() const { |
UNREACHABLE(); |
} |
- |
static intptr_t GetListLength(const Object& value) { |
if (value.IsTypedData()) { |
const TypedData& list = TypedData::Cast(value); |
@@ -8344,7 +7933,6 @@ static intptr_t GetListLength(const Object& value) { |
return Field::kNoFixedLength; |
} |
- |
static intptr_t GetListLengthOffset(intptr_t cid) { |
if (RawObject::IsTypedDataClassId(cid)) { |
return TypedData::length_offset(); |
@@ -8363,7 +7951,6 @@ static intptr_t GetListLengthOffset(intptr_t cid) { |
return Field::kUnknownLengthOffset; |
} |
- |
const char* Field::GuardedPropertiesAsCString() const { |
if (guarded_cid() == kIllegalCid) { |
return "<?>"; |
@@ -8391,7 +7978,6 @@ const char* Field::GuardedPropertiesAsCString() const { |
"<%s %s>", is_nullable() ? "nullable" : "not-nullable", class_name); |
} |
- |
bool Field::IsExternalizableCid(intptr_t cid) { |
if (FLAG_support_externalizable_strings) { |
return (cid == kOneByteStringCid) || (cid == kTwoByteStringCid); |
@@ -8400,7 +7986,6 @@ bool Field::IsExternalizableCid(intptr_t cid) { |
} |
} |
- |
void Field::InitializeGuardedListLengthInObjectOffset() const { |
ASSERT(IsOriginal()); |
if (needs_length_check() && |
@@ -8413,7 +7998,6 @@ void Field::InitializeGuardedListLengthInObjectOffset() const { |
} |
} |
- |
bool Field::UpdateGuardedCidAndLength(const Object& value) const { |
ASSERT(IsOriginal()); |
const intptr_t cid = value.GetClassId(); |
@@ -8481,7 +8065,6 @@ bool Field::UpdateGuardedCidAndLength(const Object& value) const { |
return true; |
} |
- |
void Field::RecordStore(const Object& value) const { |
ASSERT(IsOriginal()); |
if (!Isolate::Current()->use_field_guards()) { |
@@ -8502,7 +8085,6 @@ void Field::RecordStore(const Object& value) const { |
} |
} |
- |
void Field::ForceDynamicGuardedCidAndLength() const { |
// Assume nothing about this field. |
set_is_unboxing_candidate(false); |
@@ -8514,17 +8096,14 @@ void Field::ForceDynamicGuardedCidAndLength() const { |
DeoptimizeDependentCode(); |
} |
- |
void LiteralToken::set_literal(const String& literal) const { |
StorePointer(&raw_ptr()->literal_, literal.raw()); |
} |
- |
void LiteralToken::set_value(const Object& value) const { |
StorePointer(&raw_ptr()->value_, value.raw()); |
} |
- |
RawLiteralToken* LiteralToken::New() { |
ASSERT(Object::literal_token_class() != Class::null()); |
RawObject* raw = Object::Allocate(LiteralToken::kClassId, |
@@ -8532,7 +8111,6 @@ RawLiteralToken* LiteralToken::New() { |
return reinterpret_cast<RawLiteralToken*>(raw); |
} |
- |
RawLiteralToken* LiteralToken::New(Token::Kind kind, const String& literal) { |
const LiteralToken& result = LiteralToken::Handle(LiteralToken::New()); |
result.set_kind(kind); |
@@ -8551,33 +8129,27 @@ RawLiteralToken* LiteralToken::New(Token::Kind kind, const String& literal) { |
return result.raw(); |
} |
- |
const char* LiteralToken::ToCString() const { |
const String& token = String::Handle(literal()); |
return token.ToCString(); |
} |
- |
RawGrowableObjectArray* TokenStream::TokenObjects() const { |
return raw_ptr()->token_objects_; |
} |
- |
void TokenStream::SetTokenObjects(const GrowableObjectArray& value) const { |
StorePointer(&raw_ptr()->token_objects_, value.raw()); |
} |
- |
RawExternalTypedData* TokenStream::GetStream() const { |
return raw_ptr()->stream_; |
} |
- |
void TokenStream::SetStream(const ExternalTypedData& value) const { |
StorePointer(&raw_ptr()->stream_, value.raw()); |
} |
- |
void TokenStream::DataFinalizer(void* isolate_callback_data, |
Dart_WeakPersistentHandle handle, |
void* peer) { |
@@ -8585,12 +8157,10 @@ void TokenStream::DataFinalizer(void* isolate_callback_data, |
::free(peer); |
} |
- |
RawString* TokenStream::PrivateKey() const { |
return raw_ptr()->private_key_; |
} |
- |
void TokenStream::SetPrivateKey(const String& value) const { |
StorePointer(&raw_ptr()->private_key_, value.raw()); |
} |
@@ -8784,7 +8354,6 @@ RawString* TokenStream::GenerateSource(TokenPosition start_pos, |
return String::ConcatAll(source); |
} |
- |
intptr_t TokenStream::ComputeSourcePosition(TokenPosition tok_pos) const { |
Zone* zone = Thread::Current()->zone(); |
Iterator iterator(zone, *this, TokenPosition::kMinSource, |
@@ -8799,7 +8368,6 @@ intptr_t TokenStream::ComputeSourcePosition(TokenPosition tok_pos) const { |
return src_pos; |
} |
- |
RawTokenStream* TokenStream::New() { |
ASSERT(Object::token_stream_class() != Class::null()); |
RawObject* raw = Object::Allocate(TokenStream::kClassId, |
@@ -8807,7 +8375,6 @@ RawTokenStream* TokenStream::New() { |
return reinterpret_cast<RawTokenStream*>(raw); |
} |
- |
RawTokenStream* TokenStream::New(intptr_t len) { |
if (len < 0 || len > kMaxElements) { |
// This should be caught before we reach here. |
@@ -8825,7 +8392,6 @@ RawTokenStream* TokenStream::New(intptr_t len) { |
return result.raw(); |
} |
- |
// CompressedTokenMap maps String and LiteralToken keys to Smi values. |
// It also supports lookup by TokenDescriptor. |
class CompressedTokenTraits { |
@@ -8862,7 +8428,6 @@ class CompressedTokenTraits { |
}; |
typedef UnorderedHashMap<CompressedTokenTraits> CompressedTokenMap; |
- |
// Helper class for creation of compressed token stream data. |
class CompressedTokenStreamData : public Scanner::TokenCollector { |
public: |
@@ -8971,7 +8536,6 @@ class CompressedTokenStreamData : public Scanner::TokenCollector { |
DISALLOW_COPY_AND_ASSIGN(CompressedTokenStreamData); |
}; |
- |
RawTokenStream* TokenStream::New(const String& source, |
const String& private_key, |
bool use_shared_tokens) { |
@@ -9025,7 +8589,6 @@ RawTokenStream* TokenStream::New(const String& source, |
return result.raw(); |
} |
- |
void TokenStream::OpenSharedTokenList(Isolate* isolate) { |
const int kInitialSharedCapacity = 5 * 1024; |
ObjectStore* store = isolate->object_store(); |
@@ -9038,18 +8601,15 @@ void TokenStream::OpenSharedTokenList(Isolate* isolate) { |
store->set_token_objects_map(token_objects_map); |
} |
- |
void TokenStream::CloseSharedTokenList(Isolate* isolate) { |
isolate->object_store()->set_token_objects(GrowableObjectArray::Handle()); |
isolate->object_store()->set_token_objects_map(Array::null_array()); |
} |
- |
const char* TokenStream::ToCString() const { |
return "TokenStream"; |
} |
- |
TokenStream::Iterator::Iterator(Zone* zone, |
const TokenStream& tokens, |
TokenPosition token_pos, |
@@ -9071,7 +8631,6 @@ TokenStream::Iterator::Iterator(Zone* zone, |
} |
} |
- |
void TokenStream::Iterator::SetStream(const TokenStream& tokens, |
TokenPosition token_pos) { |
tokens_ = tokens.raw(); |
@@ -9086,12 +8645,10 @@ void TokenStream::Iterator::SetStream(const TokenStream& tokens, |
SetCurrentPosition(token_pos); |
} |
- |
bool TokenStream::Iterator::IsValid() const { |
return !tokens_.IsNull(); |
} |
- |
Token::Kind TokenStream::Iterator::LookaheadTokenKind(intptr_t num_tokens) { |
intptr_t saved_position = stream_.Position(); |
Token::Kind kind = Token::kILLEGAL; |
@@ -9121,18 +8678,15 @@ Token::Kind TokenStream::Iterator::LookaheadTokenKind(intptr_t num_tokens) { |
return kind; |
} |
- |
TokenPosition TokenStream::Iterator::CurrentPosition() const { |
return TokenPosition(cur_token_pos_); |
} |
- |
void TokenStream::Iterator::SetCurrentPosition(TokenPosition token_pos) { |
stream_.SetPosition(token_pos.value()); |
Advance(); |
} |
- |
void TokenStream::Iterator::Advance() { |
intptr_t value; |
do { |
@@ -9156,7 +8710,6 @@ void TokenStream::Iterator::Advance() { |
cur_token_kind_ = Token::kIDENT; |
} |
- |
RawObject* TokenStream::Iterator::CurrentToken() const { |
if (cur_token_obj_index_ != -1) { |
return token_objects_.At(cur_token_obj_index_); |
@@ -9165,13 +8718,11 @@ RawObject* TokenStream::Iterator::CurrentToken() const { |
} |
} |
- |
RawString* TokenStream::Iterator::CurrentLiteral() const { |
obj_ = CurrentToken(); |
return MakeLiteralToken(obj_); |
} |
- |
RawString* TokenStream::Iterator::MakeLiteralToken(const Object& obj) const { |
if (obj.IsString()) { |
return reinterpret_cast<RawString*>(obj.raw()); |
@@ -9187,7 +8738,6 @@ RawString* TokenStream::Iterator::MakeLiteralToken(const Object& obj) const { |
} |
} |
- |
bool Script::HasSource() const { |
#if !defined(DART_PRECOMPILED_RUNTIME) |
return kind() == RawScript::kKernelTag || |
@@ -9197,7 +8747,6 @@ bool Script::HasSource() const { |
#endif // !defined(DART_PRECOMPILED_RUNTIME) |
} |
- |
RawString* Script::Source() const { |
String& source = String::Handle(raw_ptr()->source_); |
if (source.IsNull()) { |
@@ -9206,7 +8755,6 @@ RawString* Script::Source() const { |
return raw_ptr()->source_; |
} |
- |
RawString* Script::GenerateSource() const { |
#if !defined(DART_PRECOMPILED_RUNTIME) |
if (kind() == RawScript::kKernelTag) { |
@@ -9227,42 +8775,34 @@ RawString* Script::GenerateSource() const { |
return token_stream.GenerateSource(); |
} |
- |
void Script::set_compile_time_constants(const Array& value) const { |
StorePointer(&raw_ptr()->compile_time_constants_, value.raw()); |
} |
- |
void Script::set_kernel_data(const uint8_t* kernel_data) const { |
StoreNonPointer(&raw_ptr()->kernel_data_, kernel_data); |
} |
- |
void Script::set_kernel_data_size(const intptr_t kernel_data_size) const { |
StoreNonPointer(&raw_ptr()->kernel_data_size_, kernel_data_size); |
} |
- |
void Script::set_kernel_script_index(const intptr_t kernel_script_index) const { |
StoreNonPointer(&raw_ptr()->kernel_script_index_, kernel_script_index); |
} |
- |
void Script::set_kernel_string_offsets(const TypedData& offsets) const { |
StorePointer(&raw_ptr()->kernel_string_offsets_, offsets.raw()); |
} |
- |
void Script::set_kernel_string_data(const TypedData& data) const { |
StorePointer(&raw_ptr()->kernel_string_data_, data.raw()); |
} |
- |
void Script::set_kernel_canonical_names(const TypedData& names) const { |
StorePointer(&raw_ptr()->kernel_canonical_names_, names.raw()); |
} |
- |
RawGrowableObjectArray* Script::GenerateLineNumberArray() const { |
Zone* zone = Thread::Current()->zone(); |
const GrowableObjectArray& info = |
@@ -9392,7 +8932,6 @@ RawGrowableObjectArray* Script::GenerateLineNumberArray() const { |
return info.raw(); |
} |
- |
const char* Script::GetKindAsCString() const { |
switch (kind()) { |
case RawScript::kScriptTag: |
@@ -9414,17 +8953,14 @@ const char* Script::GetKindAsCString() const { |
return NULL; |
} |
- |
void Script::set_url(const String& value) const { |
StorePointer(&raw_ptr()->url_, value.raw()); |
} |
- |
void Script::set_resolved_url(const String& value) const { |
StorePointer(&raw_ptr()->resolved_url_, value.raw()); |
} |
- |
void Script::set_source(const String& value) const { |
StorePointer(&raw_ptr()->source_, value.raw()); |
} |
@@ -9433,7 +8969,6 @@ void Script::set_line_starts(const Array& value) const { |
StorePointer(&raw_ptr()->line_starts_, value.raw()); |
} |
- |
void Script::set_debug_positions(const Array& value) const { |
StorePointer(&raw_ptr()->debug_positions_, value.raw()); |
} |
@@ -9453,7 +8988,6 @@ RawArray* Script::yield_positions() const { |
return raw_ptr()->yield_positions_; |
} |
- |
RawArray* Script::line_starts() const { |
#if !defined(DART_PRECOMPILED_RUNTIME) |
const Array& line_starts_array = Array::Handle(raw_ptr()->line_starts_); |
@@ -9465,7 +8999,6 @@ RawArray* Script::line_starts() const { |
return raw_ptr()->line_starts_; |
} |
- |
RawArray* Script::debug_positions() const { |
#if !defined(DART_PRECOMPILED_RUNTIME) |
Array& debug_positions_array = Array::Handle(raw_ptr()->debug_positions_); |
@@ -9481,17 +9014,14 @@ void Script::set_kind(RawScript::Kind value) const { |
StoreNonPointer(&raw_ptr()->kind_, value); |
} |
- |
void Script::set_load_timestamp(int64_t value) const { |
StoreNonPointer(&raw_ptr()->load_timestamp_, value); |
} |
- |
void Script::set_tokens(const TokenStream& value) const { |
StorePointer(&raw_ptr()->tokens_, value.raw()); |
} |
- |
void Script::Tokenize(const String& private_key, bool use_shared_tokens) const { |
if (kind() == RawScript::kKernelTag) { |
return; |
@@ -9514,7 +9044,6 @@ void Script::Tokenize(const String& private_key, bool use_shared_tokens) const { |
INC_STAT(thread, src_length, src.Length()); |
} |
- |
void Script::SetLocationOffset(intptr_t line_offset, |
intptr_t col_offset) const { |
ASSERT(line_offset >= 0); |
@@ -9523,7 +9052,6 @@ void Script::SetLocationOffset(intptr_t line_offset, |
StoreNonPointer(&raw_ptr()->col_offset_, col_offset); |
} |
- |
// Specialized for AOT compilation, which does this lookup for every token |
// position that could be part of a stack trace. |
intptr_t Script::GetTokenLineUsingLineStarts( |
@@ -9574,7 +9102,6 @@ intptr_t Script::GetTokenLineUsingLineStarts( |
return min + 1; // Line numbers start at 1. |
} |
- |
void Script::GetTokenLocation(TokenPosition token_pos, |
intptr_t* line, |
intptr_t* column, |
@@ -9680,7 +9207,6 @@ void Script::GetTokenLocation(TokenPosition token_pos, |
} |
} |
- |
void Script::TokenRangeAtLine(intptr_t line_number, |
TokenPosition* first_token_index, |
TokenPosition* last_token_index) const { |
@@ -9753,13 +9279,11 @@ void Script::TokenRangeAtLine(intptr_t line_number, |
*last_token_index = end_pos; |
} |
- |
int32_t Script::SourceFingerprint() const { |
return SourceFingerprint(TokenPosition(TokenPosition::kMinSourcePos), |
TokenPosition(TokenPosition::kMaxSourcePos)); |
} |
- |
int32_t Script::SourceFingerprint(TokenPosition start, |
TokenPosition end) const { |
uint32_t result = 0; |
@@ -9790,7 +9314,6 @@ int32_t Script::SourceFingerprint(TokenPosition start, |
return result; |
} |
- |
RawString* Script::GetLine(intptr_t line_number, Heap::Space space) const { |
const String& src = String::Handle(Source()); |
if (src.IsNull()) { |
@@ -9826,7 +9349,6 @@ RawString* Script::GetLine(intptr_t line_number, Heap::Space space) const { |
} |
} |
- |
RawString* Script::GetSnippet(TokenPosition from, TokenPosition to) const { |
intptr_t from_line; |
intptr_t from_column; |
@@ -9837,7 +9359,6 @@ RawString* Script::GetSnippet(TokenPosition from, TokenPosition to) const { |
return GetSnippet(from_line, from_column, to_line, to_column); |
} |
- |
RawString* Script::GetSnippet(intptr_t from_line, |
intptr_t from_column, |
intptr_t to_line, |
@@ -9892,7 +9413,6 @@ RawString* Script::GetSnippet(intptr_t from_line, |
return snippet.raw(); |
} |
- |
RawScript* Script::New() { |
ASSERT(Object::script_class() != Class::null()); |
RawObject* raw = |
@@ -9900,14 +9420,12 @@ RawScript* Script::New() { |
return reinterpret_cast<RawScript*>(raw); |
} |
- |
RawScript* Script::New(const String& url, |
const String& source, |
RawScript::Kind kind) { |
return Script::New(url, url, source, kind); |
} |
- |
RawScript* Script::New(const String& url, |
const String& resolved_url, |
const String& source, |
@@ -9926,13 +9444,11 @@ RawScript* Script::New(const String& url, |
return result.raw(); |
} |
- |
const char* Script::ToCString() const { |
const String& name = String::Handle(url()); |
return OS::SCreate(Thread::Current()->zone(), "Script(%s)", name.ToCString()); |
} |
- |
RawLibrary* Script::FindLibrary() const { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -9953,7 +9469,6 @@ RawLibrary* Script::FindLibrary() const { |
return Library::null(); |
} |
- |
DictionaryIterator::DictionaryIterator(const Library& library) |
: array_(Array::Handle(library.dictionary())), |
// Last element in array is a Smi indicating the number of entries used. |
@@ -9962,7 +9477,6 @@ DictionaryIterator::DictionaryIterator(const Library& library) |
MoveToNextObject(); |
} |
- |
RawObject* DictionaryIterator::GetNext() { |
ASSERT(HasNext()); |
int ix = next_ix_++; |
@@ -9971,7 +9485,6 @@ RawObject* DictionaryIterator::GetNext() { |
return array_.At(ix); |
} |
- |
void DictionaryIterator::MoveToNextObject() { |
Object& obj = Object::Handle(array_.At(next_ix_)); |
while (obj.IsNull() && HasNext()) { |
@@ -9980,7 +9493,6 @@ void DictionaryIterator::MoveToNextObject() { |
} |
} |
- |
ClassDictionaryIterator::ClassDictionaryIterator(const Library& library, |
IterationKind kind) |
: DictionaryIterator(library), |
@@ -9990,7 +9502,6 @@ ClassDictionaryIterator::ClassDictionaryIterator(const Library& library, |
MoveToNextClass(); |
} |
- |
RawClass* ClassDictionaryIterator::GetNextClass() { |
ASSERT(HasNext()); |
Class& cls = Class::Handle(); |
@@ -10006,7 +9517,6 @@ RawClass* ClassDictionaryIterator::GetNextClass() { |
return cls.raw(); |
} |
- |
void ClassDictionaryIterator::MoveToNextClass() { |
Object& obj = Object::Handle(); |
while (next_ix_ < size_) { |
@@ -10018,13 +9528,11 @@ void ClassDictionaryIterator::MoveToNextClass() { |
} |
} |
- |
LibraryPrefixIterator::LibraryPrefixIterator(const Library& library) |
: DictionaryIterator(library) { |
Advance(); |
} |
- |
RawLibraryPrefix* LibraryPrefixIterator::GetNext() { |
ASSERT(HasNext()); |
int ix = next_ix_++; |
@@ -10033,7 +9541,6 @@ RawLibraryPrefix* LibraryPrefixIterator::GetNext() { |
return LibraryPrefix::Cast(obj).raw(); |
} |
- |
void LibraryPrefixIterator::Advance() { |
Object& obj = Object::Handle(array_.At(next_ix_)); |
while (!obj.IsLibraryPrefix() && HasNext()) { |
@@ -10042,7 +9549,6 @@ void LibraryPrefixIterator::Advance() { |
} |
} |
- |
static void ReportTooManyImports(const Library& lib) { |
const String& url = String::Handle(lib.url()); |
Report::MessageF(Report::kError, Script::Handle(lib.LookupScript(url)), |
@@ -10051,7 +9557,6 @@ static void ReportTooManyImports(const Library& lib) { |
UNREACHABLE(); |
} |
- |
void Library::set_num_imports(intptr_t value) const { |
if (!Utils::IsUint(16, value)) { |
ReportTooManyImports(*this); |
@@ -10059,7 +9564,6 @@ void Library::set_num_imports(intptr_t value) const { |
StoreNonPointer(&raw_ptr()->num_imports_, value); |
} |
- |
void Library::SetName(const String& name) const { |
// Only set name once. |
ASSERT(!Loaded()); |
@@ -10067,28 +9571,24 @@ void Library::SetName(const String& name) const { |
StorePointer(&raw_ptr()->name_, name.raw()); |
} |
- |
void Library::SetLoadInProgress() const { |
// Must not already be in the process of being loaded. |
ASSERT(raw_ptr()->load_state_ <= RawLibrary::kLoadRequested); |
StoreNonPointer(&raw_ptr()->load_state_, RawLibrary::kLoadInProgress); |
} |
- |
void Library::SetLoadRequested() const { |
// Must not be already loaded. |
ASSERT(raw_ptr()->load_state_ == RawLibrary::kAllocated); |
StoreNonPointer(&raw_ptr()->load_state_, RawLibrary::kLoadRequested); |
} |
- |
void Library::SetLoaded() const { |
// Should not be already loaded or just allocated. |
ASSERT(LoadInProgress() || LoadRequested()); |
StoreNonPointer(&raw_ptr()->load_state_, RawLibrary::kLoaded); |
} |
- |
void Library::SetLoadError(const Instance& error) const { |
// Should not be already successfully loaded or just allocated. |
ASSERT(LoadInProgress() || LoadRequested() || LoadFailed()); |
@@ -10096,7 +9596,6 @@ void Library::SetLoadError(const Instance& error) const { |
StorePointer(&raw_ptr()->load_error_, error.raw()); |
} |
- |
// Traits for looking up Libraries by url in a hash set. |
class LibraryUrlTraits { |
public: |
@@ -10113,7 +9612,6 @@ class LibraryUrlTraits { |
}; |
typedef UnorderedHashSet<LibraryUrlTraits> LibraryLoadErrorSet; |
- |
RawInstance* Library::TransitiveLoadError() const { |
if (LoadError() != Instance::null()) { |
return LoadError(); |
@@ -10145,7 +9643,6 @@ RawInstance* Library::TransitiveLoadError() const { |
return error.raw(); |
} |
- |
void Library::AddPatchClass(const Class& cls) const { |
ASSERT(Thread::Current()->IsMutatorThread()); |
ASSERT(cls.is_patch()); |
@@ -10155,7 +9652,6 @@ void Library::AddPatchClass(const Class& cls) const { |
patch_classes.Add(cls); |
} |
- |
RawClass* Library::GetPatchClass(const String& name) const { |
ASSERT(Thread::Current()->IsMutatorThread()); |
const GrowableObjectArray& patch_classes = |
@@ -10171,7 +9667,6 @@ RawClass* Library::GetPatchClass(const String& name) const { |
return Class::null(); |
} |
- |
void Library::RemovePatchClass(const Class& cls) const { |
ASSERT(Thread::Current()->IsMutatorThread()); |
ASSERT(cls.is_patch()); |
@@ -10192,7 +9687,6 @@ void Library::RemovePatchClass(const Class& cls) const { |
patch_classes.SetAt(i, patch_script); |
} |
- |
static RawString* MakeClassMetaName(Thread* thread, |
Zone* zone, |
const Class& cls) { |
@@ -10200,7 +9694,6 @@ static RawString* MakeClassMetaName(Thread* thread, |
String::Handle(zone, cls.Name())); |
} |
- |
static RawString* MakeFieldMetaName(Thread* thread, |
Zone* zone, |
const Field& field) { |
@@ -10214,7 +9707,6 @@ static RawString* MakeFieldMetaName(Thread* thread, |
return Symbols::FromConcatAll(thread, pieces); |
} |
- |
static RawString* MakeFunctionMetaName(Thread* thread, |
Zone* zone, |
const Function& func) { |
@@ -10228,7 +9720,6 @@ static RawString* MakeFunctionMetaName(Thread* thread, |
return Symbols::FromConcatAll(thread, pieces); |
} |
- |
static RawString* MakeTypeParameterMetaName(Thread* thread, |
Zone* zone, |
const TypeParameter& param) { |
@@ -10243,7 +9734,6 @@ static RawString* MakeTypeParameterMetaName(Thread* thread, |
return Symbols::FromConcatAll(thread, pieces); |
} |
- |
void Library::AddMetadata(const Object& owner, |
const String& name, |
TokenPosition token_pos, |
@@ -10266,7 +9756,6 @@ void Library::AddMetadata(const Object& owner, |
metadata.Add(field, Heap::kOld); |
} |
- |
void Library::AddClassMetadata(const Class& cls, |
const Object& tl_owner, |
TokenPosition token_pos, |
@@ -10280,7 +9769,6 @@ void Library::AddClassMetadata(const Class& cls, |
token_pos, kernel_offset); |
} |
- |
void Library::AddFieldMetadata(const Field& field, |
TokenPosition token_pos, |
intptr_t kernel_offset) const { |
@@ -10291,7 +9779,6 @@ void Library::AddFieldMetadata(const Field& field, |
token_pos, kernel_offset); |
} |
- |
void Library::AddFunctionMetadata(const Function& func, |
TokenPosition token_pos, |
intptr_t kernel_offset) const { |
@@ -10302,7 +9789,6 @@ void Library::AddFunctionMetadata(const Function& func, |
token_pos, kernel_offset); |
} |
- |
void Library::AddTypeParameterMetadata(const TypeParameter& param, |
TokenPosition token_pos) const { |
Thread* thread = Thread::Current(); |
@@ -10313,13 +9799,11 @@ void Library::AddTypeParameterMetadata(const TypeParameter& param, |
token_pos); |
} |
- |
void Library::AddLibraryMetadata(const Object& tl_owner, |
TokenPosition token_pos) const { |
AddMetadata(tl_owner, Symbols::TopLevel(), token_pos); |
} |
- |
RawString* Library::MakeMetadataName(const Object& obj) const { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -10338,7 +9822,6 @@ RawString* Library::MakeMetadataName(const Object& obj) const { |
return String::null(); |
} |
- |
RawField* Library::GetMetadataField(const String& metaname) const { |
ASSERT(Thread::Current()->IsMutatorThread()); |
const GrowableObjectArray& metadata = |
@@ -10356,7 +9839,6 @@ RawField* Library::GetMetadataField(const String& metaname) const { |
return Field::null(); |
} |
- |
RawObject* Library::GetMetadata(const Object& obj) const { |
#if defined(DART_PRECOMPILED_RUNTIME) |
COMPILE_ASSERT(!FLAG_enable_mirrors); |
@@ -10389,7 +9871,6 @@ RawObject* Library::GetMetadata(const Object& obj) const { |
#endif // defined(DART_PRECOMPILED_RUNTIME) |
} |
- |
static bool ShouldBePrivate(const String& name) { |
return (name.Length() >= 1 && name.CharAt(0) == '_') || |
(name.Length() >= 5 && |
@@ -10399,7 +9880,6 @@ static bool ShouldBePrivate(const String& name) { |
name.CharAt(3) == ':')); |
} |
- |
RawObject* Library::ResolveName(const String& name) const { |
Object& obj = Object::Handle(); |
if (FLAG_use_lib_cache && LookupResolvedNamesCache(name, &obj)) { |
@@ -10428,7 +9908,6 @@ RawObject* Library::ResolveName(const String& name) const { |
return obj.raw(); |
} |
- |
class StringEqualsTraits { |
public: |
static const char* Name() { return "StringEqualsTraits"; } |
@@ -10441,7 +9920,6 @@ class StringEqualsTraits { |
}; |
typedef UnorderedHashMap<StringEqualsTraits> ResolvedNamesMap; |
- |
// Returns true if the name is found in the cache, false no cache hit. |
// obj is set to the cached entry. It may be null, indicating that the |
// name does not resolve to anything in this library. |
@@ -10466,7 +9944,6 @@ bool Library::LookupResolvedNamesCache(const String& name, Object* obj) const { |
return present; |
} |
- |
// Add a name to the resolved name cache. This name resolves to the |
// given object in this library scope. obj may be null, which means |
// the name does not resolve to anything in this library scope. |
@@ -10483,7 +9960,6 @@ void Library::AddToResolvedNamesCache(const String& name, |
StorePointer(&raw_ptr()->resolved_names_, cache.Release().raw()); |
} |
- |
bool Library::LookupExportedNamesCache(const String& name, Object* obj) const { |
ASSERT(FLAG_use_exp_cache); |
if (exported_names() == Array::null()) { |
@@ -10519,7 +9995,6 @@ void Library::AddToExportedNamesCache(const String& name, |
StorePointer(&raw_ptr()->exported_names_, cache.Release().raw()); |
} |
- |
void Library::InvalidateResolvedName(const String& name) const { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -10543,7 +10018,6 @@ void Library::InvalidateResolvedName(const String& name) const { |
} |
} |
- |
// Invalidate all exported names caches in the isolate. |
void Library::InvalidateExportedNamesCaches() { |
GrowableObjectArray& libs = GrowableObjectArray::Handle( |
@@ -10556,7 +10030,6 @@ void Library::InvalidateExportedNamesCaches() { |
} |
} |
- |
void Library::RehashDictionary(const Array& old_dict, |
intptr_t new_dict_size) const { |
intptr_t old_dict_size = old_dict.Length() - 1; |
@@ -10592,7 +10065,6 @@ void Library::RehashDictionary(const Array& old_dict, |
StorePointer(&raw_ptr()->dictionary_, new_dict.raw()); |
} |
- |
void Library::AddObject(const Object& obj, const String& name) const { |
ASSERT(Thread::Current()->IsMutatorThread()); |
ASSERT(obj.IsClass() || obj.IsFunction() || obj.IsField() || |
@@ -10630,7 +10102,6 @@ void Library::AddObject(const Object& obj, const String& name) const { |
} |
} |
- |
// Lookup a name in the library's re-export namespace. |
// This lookup can occur from two different threads: background compiler and |
// mutator thread. |
@@ -10673,7 +10144,6 @@ RawObject* Library::LookupReExport(const String& name, |
return obj.raw(); |
} |
- |
RawObject* Library::LookupEntry(const String& name, intptr_t* index) const { |
Thread* thread = Thread::Current(); |
REUSABLE_ARRAY_HANDLESCOPE(thread); |
@@ -10699,7 +10169,6 @@ RawObject* Library::LookupEntry(const String& name, intptr_t* index) const { |
return Object::null(); |
} |
- |
void Library::ReplaceObject(const Object& obj, const String& name) const { |
ASSERT(!Compiler::IsBackgroundCompilation()); |
ASSERT(obj.IsClass() || obj.IsFunction() || obj.IsField()); |
@@ -10712,7 +10181,6 @@ void Library::ReplaceObject(const Object& obj, const String& name) const { |
dict.SetAt(index, obj); |
} |
- |
void Library::AddClass(const Class& cls) const { |
ASSERT(!Compiler::IsBackgroundCompilation()); |
const String& class_name = String::Handle(cls.Name()); |
@@ -10722,7 +10190,6 @@ void Library::AddClass(const Class& cls) const { |
InvalidateResolvedName(class_name); |
} |
- |
static void AddScriptIfUnique(const GrowableObjectArray& scripts, |
const Script& candidate) { |
if (candidate.IsNull()) { |
@@ -10741,7 +10208,6 @@ static void AddScriptIfUnique(const GrowableObjectArray& scripts, |
scripts.Add(candidate); |
} |
- |
RawArray* Library::LoadedScripts() const { |
ASSERT(Thread::Current()->IsMutatorThread()); |
// We compute the list of loaded scripts lazily. The result is |
@@ -10806,7 +10272,6 @@ RawArray* Library::LoadedScripts() const { |
return loaded_scripts(); |
} |
- |
// TODO(hausner): we might want to add a script dictionary to the |
// library class to make this lookup faster. |
RawScript* Library::LookupScript(const String& url) const { |
@@ -10837,13 +10302,11 @@ RawScript* Library::LookupScript(const String& url) const { |
return Script::null(); |
} |
- |
RawObject* Library::LookupLocalObject(const String& name) const { |
intptr_t index; |
return LookupEntry(name, &index); |
} |
- |
RawField* Library::LookupFieldAllowPrivate(const String& name) const { |
Object& obj = Object::Handle(LookupObjectAllowPrivate(name)); |
if (obj.IsField()) { |
@@ -10852,7 +10315,6 @@ RawField* Library::LookupFieldAllowPrivate(const String& name) const { |
return Field::null(); |
} |
- |
RawField* Library::LookupLocalField(const String& name) const { |
Object& obj = Object::Handle(LookupLocalObjectAllowPrivate(name)); |
if (obj.IsField()) { |
@@ -10861,7 +10323,6 @@ RawField* Library::LookupLocalField(const String& name) const { |
return Field::null(); |
} |
- |
RawFunction* Library::LookupFunctionAllowPrivate(const String& name) const { |
Object& obj = Object::Handle(LookupObjectAllowPrivate(name)); |
if (obj.IsFunction()) { |
@@ -10870,7 +10331,6 @@ RawFunction* Library::LookupFunctionAllowPrivate(const String& name) const { |
return Function::null(); |
} |
- |
RawFunction* Library::LookupLocalFunction(const String& name) const { |
Object& obj = Object::Handle(LookupLocalObjectAllowPrivate(name)); |
if (obj.IsFunction()) { |
@@ -10879,7 +10339,6 @@ RawFunction* Library::LookupLocalFunction(const String& name) const { |
return Function::null(); |
} |
- |
RawObject* Library::LookupLocalObjectAllowPrivate(const String& name) const { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -10892,7 +10351,6 @@ RawObject* Library::LookupLocalObjectAllowPrivate(const String& name) const { |
return obj.raw(); |
} |
- |
RawObject* Library::LookupObjectAllowPrivate(const String& name) const { |
// First check if name is found in the local scope of the library. |
Object& obj = Object::Handle(LookupLocalObjectAllowPrivate(name)); |
@@ -10909,7 +10367,6 @@ RawObject* Library::LookupObjectAllowPrivate(const String& name) const { |
return LookupImportedObject(name); |
} |
- |
RawObject* Library::LookupImportedObject(const String& name) const { |
Object& obj = Object::Handle(); |
Namespace& import = Namespace::Handle(); |
@@ -10971,7 +10428,6 @@ RawObject* Library::LookupImportedObject(const String& name) const { |
return found_obj.raw(); |
} |
- |
RawClass* Library::LookupClass(const String& name) const { |
Object& obj = Object::Handle(ResolveName(name)); |
if (obj.IsClass()) { |
@@ -10980,7 +10436,6 @@ RawClass* Library::LookupClass(const String& name) const { |
return Class::null(); |
} |
- |
RawClass* Library::LookupLocalClass(const String& name) const { |
Object& obj = Object::Handle(LookupLocalObject(name)); |
if (obj.IsClass()) { |
@@ -10989,7 +10444,6 @@ RawClass* Library::LookupLocalClass(const String& name) const { |
return Class::null(); |
} |
- |
RawClass* Library::LookupClassAllowPrivate(const String& name) const { |
// See if the class is available in this library or in the top level |
// scope of any imported library. |
@@ -11011,7 +10465,6 @@ RawClass* Library::LookupClassAllowPrivate(const String& name) const { |
return Class::null(); |
} |
- |
// Mixin applications can have multiple private keys from different libraries. |
RawClass* Library::SlowLookupClassAllowMultiPartPrivate( |
const String& name) const { |
@@ -11031,7 +10484,6 @@ RawClass* Library::SlowLookupClassAllowMultiPartPrivate( |
return Class::null(); |
} |
- |
RawLibraryPrefix* Library::LookupLocalLibraryPrefix(const String& name) const { |
const Object& obj = Object::Handle(LookupLocalObject(name)); |
if (obj.IsLibraryPrefix()) { |
@@ -11040,13 +10492,11 @@ RawLibraryPrefix* Library::LookupLocalLibraryPrefix(const String& name) const { |
return LibraryPrefix::null(); |
} |
- |
void Library::set_toplevel_class(const Class& value) const { |
ASSERT(raw_ptr()->toplevel_class_ == Class::null()); |
StorePointer(&raw_ptr()->toplevel_class_, value.raw()); |
} |
- |
RawLibrary* Library::ImportLibraryAt(intptr_t index) const { |
Namespace& import = Namespace::Handle(ImportAt(index)); |
if (import.IsNull()) { |
@@ -11055,7 +10505,6 @@ RawLibrary* Library::ImportLibraryAt(intptr_t index) const { |
return import.library(); |
} |
- |
RawNamespace* Library::ImportAt(intptr_t index) const { |
if ((index < 0) || index >= num_imports()) { |
return Namespace::null(); |
@@ -11064,7 +10513,6 @@ RawNamespace* Library::ImportAt(intptr_t index) const { |
return Namespace::RawCast(import_list.At(index)); |
} |
- |
bool Library::ImportsCorelib() const { |
Zone* zone = Thread::Current()->zone(); |
Library& imported = Library::Handle(zone); |
@@ -11090,7 +10538,6 @@ bool Library::ImportsCorelib() const { |
return false; |
} |
- |
void Library::DropDependenciesAndCaches() const { |
StorePointer(&raw_ptr()->imports_, Object::empty_array().raw()); |
StorePointer(&raw_ptr()->exports_, Object::empty_array().raw()); |
@@ -11100,7 +10547,6 @@ void Library::DropDependenciesAndCaches() const { |
StorePointer(&raw_ptr()->loaded_scripts_, Array::null()); |
} |
- |
void Library::AddImport(const Namespace& ns) const { |
Array& imports = Array::Handle(this->imports()); |
intptr_t capacity = imports.Length(); |
@@ -11114,14 +10560,12 @@ void Library::AddImport(const Namespace& ns) const { |
set_num_imports(index + 1); |
} |
- |
// Convenience function to determine whether the export list is |
// non-empty. |
bool Library::HasExports() const { |
return exports() != Object::empty_array().raw(); |
} |
- |
// We add one namespace at a time to the exports array and don't |
// pre-allocate any unused capacity. The assumption is that |
// re-exports are quite rare. |
@@ -11133,7 +10577,6 @@ void Library::AddExport(const Namespace& ns) const { |
exports.SetAt(num_exports, ns); |
} |
- |
static RawArray* NewDictionary(intptr_t initial_size) { |
const Array& dict = Array::Handle(Array::New(initial_size + 1, Heap::kOld)); |
// The last element of the dictionary specifies the number of in use slots. |
@@ -11141,38 +10584,32 @@ static RawArray* NewDictionary(intptr_t initial_size) { |
return dict.raw(); |
} |
- |
void Library::InitResolvedNamesCache() const { |
ASSERT(Thread::Current()->IsMutatorThread()); |
StorePointer(&raw_ptr()->resolved_names_, |
HashTables::New<ResolvedNamesMap>(64)); |
} |
- |
void Library::ClearResolvedNamesCache() const { |
ASSERT(Thread::Current()->IsMutatorThread()); |
StorePointer(&raw_ptr()->resolved_names_, Array::null()); |
} |
- |
void Library::InitExportedNamesCache() const { |
StorePointer(&raw_ptr()->exported_names_, |
HashTables::New<ResolvedNamesMap>(16)); |
} |
- |
void Library::ClearExportedNamesCache() const { |
StorePointer(&raw_ptr()->exported_names_, Array::null()); |
} |
- |
void Library::InitClassDictionary() const { |
// TODO(iposva): Find reasonable initial size. |
const int kInitialElementCount = 16; |
StorePointer(&raw_ptr()->dictionary_, NewDictionary(kInitialElementCount)); |
} |
- |
void Library::InitImportList() const { |
const Array& imports = |
Array::Handle(Array::New(kInitialImportsCapacity, Heap::kOld)); |
@@ -11180,7 +10617,6 @@ void Library::InitImportList() const { |
StoreNonPointer(&raw_ptr()->num_imports_, 0); |
} |
- |
RawLibrary* Library::New() { |
ASSERT(Object::library_class() != Class::null()); |
RawObject* raw = |
@@ -11188,7 +10624,6 @@ RawLibrary* Library::New() { |
return reinterpret_cast<RawLibrary*>(raw); |
} |
- |
RawLibrary* Library::NewLibraryHelper(const String& url, bool import_core_lib) { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -11248,12 +10683,10 @@ RawLibrary* Library::NewLibraryHelper(const String& url, bool import_core_lib) { |
return result.raw(); |
} |
- |
RawLibrary* Library::New(const String& url) { |
return NewLibraryHelper(url, false); |
} |
- |
void Library::InitCoreLibrary(Isolate* isolate) { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -11272,7 +10705,6 @@ void Library::InitCoreLibrary(Isolate* isolate) { |
core_lib.AddObject(cls, String::Handle(zone, cls.Name())); |
} |
- |
RawObject* Library::Evaluate(const String& expr, |
const Array& param_names, |
const Array& param_values) const { |
@@ -11282,7 +10714,6 @@ RawObject* Library::Evaluate(const String& expr, |
return top_level_class.Evaluate(expr, param_names, param_values); |
} |
- |
void Library::InitNativeWrappersLibrary(Isolate* isolate, bool is_kernel) { |
static const int kNumNativeWrappersClasses = 4; |
COMPILE_ASSERT((kNumNativeWrappersClasses > 0) && |
@@ -11317,7 +10748,6 @@ void Library::InitNativeWrappersLibrary(Isolate* isolate, bool is_kernel) { |
} |
} |
- |
// LibraryLookupSet maps URIs to libraries. |
class LibraryLookupTraits { |
public: |
@@ -11338,7 +10768,6 @@ class LibraryLookupTraits { |
}; |
typedef UnorderedHashMap<LibraryLookupTraits> LibraryLookupMap; |
- |
// Returns library with given url in current isolate, or NULL. |
RawLibrary* Library::LookupLibrary(Thread* thread, const String& url) { |
Zone* zone = thread->zone(); |
@@ -11361,13 +10790,11 @@ RawLibrary* Library::LookupLibrary(Thread* thread, const String& url) { |
return lib.raw(); |
} |
- |
RawError* Library::Patch(const Script& script) const { |
ASSERT(script.kind() == RawScript::kPatchTag); |
return Compiler::Compile(*this, script); |
} |
- |
bool Library::IsPrivate(const String& name) { |
if (ShouldBePrivate(name)) return true; |
// Factory names: List._fromLiteral. |
@@ -11381,7 +10808,6 @@ bool Library::IsPrivate(const String& name) { |
return false; |
} |
- |
// Create a private key for this library. It is based on the hash of the |
// library URI and the sequence number of the library to guarantee unique |
// private keys without having to verify. |
@@ -11421,14 +10847,12 @@ void Library::AllocatePrivateKey() const { |
StorePointer(&raw_ptr()->private_key_, key.raw()); |
} |
- |
const String& Library::PrivateCoreLibName(const String& member) { |
const Library& core_lib = Library::Handle(Library::CoreLibrary()); |
const String& private_name = String::ZoneHandle(core_lib.PrivateName(member)); |
return private_name; |
} |
- |
RawClass* Library::LookupCoreClass(const String& class_name) { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -11442,7 +10866,6 @@ RawClass* Library::LookupCoreClass(const String& class_name) { |
return core_lib.LookupClass(name); |
} |
- |
// Cannot handle qualified names properly as it only appends private key to |
// the end (e.g. _Alfa.foo -> _Alfa.foo@...). |
RawString* Library::PrivateName(const String& name) const { |
@@ -11457,7 +10880,6 @@ RawString* Library::PrivateName(const String& name) const { |
return str.raw(); |
} |
- |
RawLibrary* Library::GetLibrary(intptr_t index) { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -11473,7 +10895,6 @@ RawLibrary* Library::GetLibrary(intptr_t index) { |
return Library::null(); |
} |
- |
void Library::Register(Thread* thread) const { |
Zone* zone = thread->zone(); |
Isolate* isolate = thread->isolate(); |
@@ -11502,7 +10923,6 @@ void Library::Register(Thread* thread) const { |
object_store->set_libraries_map(map.Release()); |
} |
- |
void Library::RegisterLibraries(Thread* thread, |
const GrowableObjectArray& libs) { |
Zone* zone = thread->zone(); |
@@ -11523,81 +10943,66 @@ void Library::RegisterLibraries(Thread* thread, |
isolate->object_store()->set_libraries_map(map.Release()); |
} |
- |
RawLibrary* Library::AsyncLibrary() { |
return Isolate::Current()->object_store()->async_library(); |
} |
- |
RawLibrary* Library::ConvertLibrary() { |
return Isolate::Current()->object_store()->convert_library(); |
} |
- |
RawLibrary* Library::CoreLibrary() { |
return Isolate::Current()->object_store()->core_library(); |
} |
- |
RawLibrary* Library::CollectionLibrary() { |
return Isolate::Current()->object_store()->collection_library(); |
} |
- |
RawLibrary* Library::DeveloperLibrary() { |
return Isolate::Current()->object_store()->developer_library(); |
} |
- |
RawLibrary* Library::InternalLibrary() { |
return Isolate::Current()->object_store()->_internal_library(); |
} |
- |
RawLibrary* Library::IsolateLibrary() { |
return Isolate::Current()->object_store()->isolate_library(); |
} |
- |
RawLibrary* Library::MathLibrary() { |
return Isolate::Current()->object_store()->math_library(); |
} |
- |
#if !defined(PRODUCT) |
RawLibrary* Library::MirrorsLibrary() { |
return Isolate::Current()->object_store()->mirrors_library(); |
} |
#endif |
- |
RawLibrary* Library::NativeWrappersLibrary() { |
return Isolate::Current()->object_store()->native_wrappers_library(); |
} |
- |
RawLibrary* Library::ProfilerLibrary() { |
return Isolate::Current()->object_store()->profiler_library(); |
} |
- |
RawLibrary* Library::TypedDataLibrary() { |
return Isolate::Current()->object_store()->typed_data_library(); |
} |
- |
RawLibrary* Library::VMServiceLibrary() { |
return Isolate::Current()->object_store()->_vmservice_library(); |
} |
- |
const char* Library::ToCString() const { |
const String& name = String::Handle(url()); |
return OS::SCreate(Thread::Current()->zone(), "Library:'%s'", |
name.ToCString()); |
} |
- |
RawLibrary* LibraryPrefix::GetLibrary(int index) const { |
if ((index >= 0) || (index < num_imports())) { |
const Array& imports = Array::Handle(this->imports()); |
@@ -11608,7 +11013,6 @@ RawLibrary* LibraryPrefix::GetLibrary(int index) const { |
return Library::null(); |
} |
- |
RawInstance* LibraryPrefix::LoadError() const { |
Thread* thread = Thread::Current(); |
Isolate* isolate = thread->isolate(); |
@@ -11634,7 +11038,6 @@ RawInstance* LibraryPrefix::LoadError() const { |
return error.raw(); |
} |
- |
bool LibraryPrefix::ContainsLibrary(const Library& library) const { |
int32_t num_current_imports = num_imports(); |
if (num_current_imports > 0) { |
@@ -11653,7 +11056,6 @@ bool LibraryPrefix::ContainsLibrary(const Library& library) const { |
return false; |
} |
- |
void LibraryPrefix::AddImport(const Namespace& import) const { |
intptr_t num_current_imports = num_imports(); |
@@ -11673,7 +11075,6 @@ void LibraryPrefix::AddImport(const Namespace& import) const { |
set_num_imports(num_current_imports + 1); |
} |
- |
RawObject* LibraryPrefix::LookupObject(const String& name) const { |
if (!is_loaded() && !FLAG_load_deferred_eagerly) { |
return Object::null(); |
@@ -11738,7 +11139,6 @@ RawObject* LibraryPrefix::LookupObject(const String& name) const { |
return found_obj.raw(); |
} |
- |
RawClass* LibraryPrefix::LookupClass(const String& class_name) const { |
const Object& obj = Object::Handle(LookupObject(class_name)); |
if (obj.IsClass()) { |
@@ -11747,12 +11147,10 @@ RawClass* LibraryPrefix::LookupClass(const String& class_name) const { |
return Class::null(); |
} |
- |
void LibraryPrefix::set_is_loaded() const { |
StoreNonPointer(&raw_ptr()->is_loaded_, true); |
} |
- |
bool LibraryPrefix::LoadLibrary() const { |
// Non-deferred prefixes are loaded. |
ASSERT(is_deferred_load() || is_loaded()); |
@@ -11806,17 +11204,14 @@ bool LibraryPrefix::LoadLibrary() const { |
return false; // Load request not yet completed. |
} |
- |
RawArray* LibraryPrefix::dependent_code() const { |
return raw_ptr()->dependent_code_; |
} |
- |
void LibraryPrefix::set_dependent_code(const Array& array) const { |
StorePointer(&raw_ptr()->dependent_code_, array.raw()); |
} |
- |
class PrefixDependentArray : public WeakCodeReferences { |
public: |
explicit PrefixDependentArray(const LibraryPrefix& prefix) |
@@ -11850,7 +11245,6 @@ class PrefixDependentArray : public WeakCodeReferences { |
DISALLOW_COPY_AND_ASSIGN(PrefixDependentArray); |
}; |
- |
void LibraryPrefix::RegisterDependentCode(const Code& code) const { |
ASSERT(is_deferred_load()); |
// In background compilation, a library can be loaded while we are compiling. |
@@ -11860,21 +11254,18 @@ void LibraryPrefix::RegisterDependentCode(const Code& code) const { |
a.Register(code); |
} |
- |
void LibraryPrefix::InvalidateDependentCode() const { |
PrefixDependentArray a(*this); |
a.DisableCode(); |
set_is_loaded(); |
} |
- |
RawLibraryPrefix* LibraryPrefix::New() { |
RawObject* raw = Object::Allocate(LibraryPrefix::kClassId, |
LibraryPrefix::InstanceSize(), Heap::kOld); |
return reinterpret_cast<RawLibraryPrefix*>(raw); |
} |
- |
RawLibraryPrefix* LibraryPrefix::New(const String& name, |
const Namespace& import, |
bool deferred_load, |
@@ -11890,18 +11281,15 @@ RawLibraryPrefix* LibraryPrefix::New(const String& name, |
return result.raw(); |
} |
- |
void LibraryPrefix::set_name(const String& value) const { |
ASSERT(value.IsSymbol()); |
StorePointer(&raw_ptr()->name_, value.raw()); |
} |
- |
void LibraryPrefix::set_imports(const Array& value) const { |
StorePointer(&raw_ptr()->imports_, value.raw()); |
} |
- |
void LibraryPrefix::set_num_imports(intptr_t value) const { |
if (!Utils::IsUint(16, value)) { |
ReportTooManyImports(Library::Handle(importer())); |
@@ -11909,24 +11297,20 @@ void LibraryPrefix::set_num_imports(intptr_t value) const { |
StoreNonPointer(&raw_ptr()->num_imports_, value); |
} |
- |
void LibraryPrefix::set_importer(const Library& value) const { |
StorePointer(&raw_ptr()->importer_, value.raw()); |
} |
- |
const char* LibraryPrefix::ToCString() const { |
const String& prefix = String::Handle(name()); |
return OS::SCreate(Thread::Current()->zone(), "LibraryPrefix:'%s'", |
prefix.ToCString()); |
} |
- |
void Namespace::set_metadata_field(const Field& value) const { |
StorePointer(&raw_ptr()->metadata_field_, value.raw()); |
} |
- |
void Namespace::AddMetadata(const Object& owner, TokenPosition token_pos) { |
ASSERT(Field::Handle(metadata_field()).IsNull()); |
Field& field = Field::Handle(Field::NewTopLevel(Symbols::TopLevel(), |
@@ -11939,7 +11323,6 @@ void Namespace::AddMetadata(const Object& owner, TokenPosition token_pos) { |
set_metadata_field(field); |
} |
- |
RawObject* Namespace::GetMetadata() const { |
#if defined(DART_PRECOMPILED_RUNTIME) |
COMPILE_ASSERT(!FLAG_enable_mirrors); |
@@ -11963,14 +11346,12 @@ RawObject* Namespace::GetMetadata() const { |
#endif // defined(DART_PRECOMPILED_RUNTIME) |
} |
- |
const char* Namespace::ToCString() const { |
const Library& lib = Library::Handle(library()); |
return OS::SCreate(Thread::Current()->zone(), "Namespace for library '%s'", |
lib.ToCString()); |
} |
- |
bool Namespace::HidesName(const String& name) const { |
// Quick check for common case with no combinators. |
if (hide_names() == show_names()) { |
@@ -12015,7 +11396,6 @@ bool Namespace::HidesName(const String& name) const { |
return false; |
} |
- |
// Look up object with given name in library and filter out hidden |
// names. Also look up getters and setters. |
RawObject* Namespace::Lookup(const String& name, |
@@ -12073,7 +11453,6 @@ RawObject* Namespace::Lookup(const String& name, |
return obj.raw(); |
} |
- |
RawNamespace* Namespace::New() { |
ASSERT(Object::namespace_class() != Class::null()); |
RawObject* raw = Object::Allocate(Namespace::kClassId, |
@@ -12081,7 +11460,6 @@ RawNamespace* Namespace::New() { |
return reinterpret_cast<RawNamespace*>(raw); |
} |
- |
RawNamespace* Namespace::New(const Library& library, |
const Array& show_names, |
const Array& hide_names) { |
@@ -12094,7 +11472,6 @@ RawNamespace* Namespace::New(const Library& library, |
return result.raw(); |
} |
- |
RawError* Library::CompileAll() { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -12140,7 +11517,6 @@ RawError* Library::CompileAll() { |
return Error::null(); |
} |
- |
RawError* Library::ParseAll(Thread* thread) { |
Zone* zone = thread->zone(); |
Error& error = Error::Handle(zone); |
@@ -12185,7 +11561,6 @@ RawError* Library::ParseAll(Thread* thread) { |
return error.raw(); |
} |
- |
// Return Function::null() if function does not exist in libs. |
RawFunction* Library::GetFunction(const GrowableArray<Library*>& libs, |
const char* class_name, |
@@ -12219,7 +11594,6 @@ RawFunction* Library::GetFunction(const GrowableArray<Library*>& libs, |
return Function::null(); |
} |
- |
RawObject* Library::GetFunctionClosure(const String& name) const { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -12245,7 +11619,6 @@ RawObject* Library::GetFunctionClosure(const String& name) const { |
return func.ImplicitStaticClosure(); |
} |
- |
#if defined(DART_NO_SNAPSHOT) && !defined(PRODUCT) |
void Library::CheckFunctionFingerprints() { |
GrowableArray<Library*> all_libs; |
@@ -12292,7 +11665,6 @@ void Library::CheckFunctionFingerprints() { |
#undef CHECK_FINGERPRINTS |
#undef CHECK_FINGERPRINTS2 |
- |
#define CHECK_FACTORY_FINGERPRINTS(symbol, class_name, factory_name, cid, fp) \ |
func = GetFunction(all_libs, #class_name, #factory_name); \ |
if (func.IsNull()) { \ |
@@ -12313,7 +11685,6 @@ void Library::CheckFunctionFingerprints() { |
} |
#endif // defined(DART_NO_SNAPSHOT) && !defined(PRODUCT). |
- |
RawInstructions* Instructions::New(intptr_t size, bool has_single_entry_point) { |
ASSERT(size >= 0); |
ASSERT(Object::instructions_class() != Class::null()); |
@@ -12334,12 +11705,10 @@ RawInstructions* Instructions::New(intptr_t size, bool has_single_entry_point) { |
return result.raw(); |
} |
- |
const char* Instructions::ToCString() const { |
return "Instructions"; |
} |
- |
// Encode integer |value| in SLEB128 format and store into |data|. |
static void EncodeSLEB128(GrowableArray<uint8_t>* data, intptr_t value) { |
bool is_last_part = false; |
@@ -12356,7 +11725,6 @@ static void EncodeSLEB128(GrowableArray<uint8_t>* data, intptr_t value) { |
} |
} |
- |
// Decode integer in SLEB128 format from |data| and update |byte_index|. |
static intptr_t DecodeSLEB128(const uint8_t* data, |
const intptr_t data_length, |
@@ -12377,14 +11745,12 @@ static intptr_t DecodeSLEB128(const uint8_t* data, |
return value; |
} |
- |
// Encode integer in SLEB128 format. |
void PcDescriptors::EncodeInteger(GrowableArray<uint8_t>* data, |
intptr_t value) { |
return EncodeSLEB128(data, value); |
} |
- |
// Decode SLEB128 encoded integer. Update byte_index to the next integer. |
intptr_t PcDescriptors::DecodeInteger(intptr_t* byte_index) const { |
NoSafepointScope no_safepoint; |
@@ -12392,7 +11758,6 @@ intptr_t PcDescriptors::DecodeInteger(intptr_t* byte_index) const { |
return DecodeSLEB128(data, Length(), byte_index); |
} |
- |
RawObjectPool* ObjectPool::New(intptr_t len) { |
ASSERT(Object::object_pool_class() != Class::null()); |
if (len < 0 || len > kMaxElements) { |
@@ -12416,24 +11781,20 @@ RawObjectPool* ObjectPool::New(intptr_t len) { |
return result.raw(); |
} |
- |
void ObjectPool::set_info_array(const TypedData& info_array) const { |
StorePointer(&raw_ptr()->info_array_, info_array.raw()); |
} |
- |
ObjectPool::EntryType ObjectPool::InfoAt(intptr_t index) const { |
ObjectPoolInfo pool_info(*this); |
return pool_info.InfoAt(index); |
} |
- |
const char* ObjectPool::ToCString() const { |
Zone* zone = Thread::Current()->zone(); |
return zone->PrintToString("ObjectPool len:%" Pd, Length()); |
} |
- |
void ObjectPool::DebugPrint() const { |
THR_Print("Object Pool: 0x%" Px "{\n", reinterpret_cast<uword>(raw())); |
for (intptr_t i = 0; i < Length(); i++) { |
@@ -12452,17 +11813,14 @@ void ObjectPool::DebugPrint() const { |
THR_Print("}\n"); |
} |
- |
intptr_t PcDescriptors::Length() const { |
return raw_ptr()->length_; |
} |
- |
void PcDescriptors::SetLength(intptr_t value) const { |
StoreNonPointer(&raw_ptr()->length_, value); |
} |
- |
void PcDescriptors::CopyData(GrowableArray<uint8_t>* delta_encoded_data) { |
NoSafepointScope no_safepoint; |
uint8_t* data = UnsafeMutableNonPointer(&raw_ptr()->data()[0]); |
@@ -12471,7 +11829,6 @@ void PcDescriptors::CopyData(GrowableArray<uint8_t>* delta_encoded_data) { |
} |
} |
- |
RawPcDescriptors* PcDescriptors::New(GrowableArray<uint8_t>* data) { |
ASSERT(Object::pc_descriptors_class() != Class::null()); |
Thread* thread = Thread::Current(); |
@@ -12490,7 +11847,6 @@ RawPcDescriptors* PcDescriptors::New(GrowableArray<uint8_t>* data) { |
return result.raw(); |
} |
- |
RawPcDescriptors* PcDescriptors::New(intptr_t length) { |
ASSERT(Object::pc_descriptors_class() != Class::null()); |
Thread* thread = Thread::Current(); |
@@ -12508,7 +11864,6 @@ RawPcDescriptors* PcDescriptors::New(intptr_t length) { |
return result.raw(); |
} |
- |
const char* PcDescriptors::KindAsStr(RawPcDescriptors::Kind kind) { |
switch (kind) { |
case RawPcDescriptors::kDeopt: |
@@ -12533,7 +11888,6 @@ const char* PcDescriptors::KindAsStr(RawPcDescriptors::Kind kind) { |
return ""; |
} |
- |
void PcDescriptors::PrintHeaderString() { |
// 4 bits per hex digit + 2 for "0x". |
const int addr_width = (kBitsPerWord / 4) + 2; |
@@ -12542,7 +11896,6 @@ void PcDescriptors::PrintHeaderString() { |
THR_Print("%-*s\tkind \tdeopt-id\ttok-ix\ttry-ix\n", addr_width, "pc"); |
} |
- |
const char* PcDescriptors::ToCString() const { |
// "*" in a printf format specifier tells it to read the field width from |
// the printf argument list. |
@@ -12577,7 +11930,6 @@ const char* PcDescriptors::ToCString() const { |
#undef FORMAT |
} |
- |
// Verify assumptions (in debug mode only). |
// - No two deopt descriptors have the same deoptimization id. |
// - No two ic-call descriptors have the same deoptimization id (type feedback). |
@@ -12621,12 +11973,10 @@ void PcDescriptors::Verify(const Function& function) const { |
#endif // DEBUG |
} |
- |
void CodeSourceMap::SetLength(intptr_t value) const { |
StoreNonPointer(&raw_ptr()->length_, value); |
} |
- |
RawCodeSourceMap* CodeSourceMap::New(intptr_t length) { |
ASSERT(Object::code_source_map_class() != Class::null()); |
Thread* thread = Thread::Current(); |
@@ -12642,12 +11992,10 @@ RawCodeSourceMap* CodeSourceMap::New(intptr_t length) { |
return result.raw(); |
} |
- |
const char* CodeSourceMap::ToCString() const { |
return "CodeSourceMap"; |
} |
- |
bool StackMap::GetBit(intptr_t bit_index) const { |
ASSERT(InRange(bit_index)); |
int byte_index = bit_index >> kBitsPerByteLog2; |
@@ -12657,7 +12005,6 @@ bool StackMap::GetBit(intptr_t bit_index) const { |
return (byte & byte_mask); |
} |
- |
void StackMap::SetBit(intptr_t bit_index, bool value) const { |
ASSERT(InRange(bit_index)); |
int byte_index = bit_index >> kBitsPerByteLog2; |
@@ -12672,7 +12019,6 @@ void StackMap::SetBit(intptr_t bit_index, bool value) const { |
} |
} |
- |
RawStackMap* StackMap::New(intptr_t pc_offset, |
BitmapBuilder* bmap, |
intptr_t slow_path_bit_count) { |
@@ -12707,7 +12053,6 @@ RawStackMap* StackMap::New(intptr_t pc_offset, |
return result.raw(); |
} |
- |
RawStackMap* StackMap::New(intptr_t length, |
intptr_t slow_path_bit_count, |
intptr_t pc_offset) { |
@@ -12737,7 +12082,6 @@ RawStackMap* StackMap::New(intptr_t length, |
return result.raw(); |
} |
- |
const char* StackMap::ToCString() const { |
#define FORMAT "%#05x: " |
if (IsNull()) { |
@@ -12764,14 +12108,12 @@ const char* StackMap::ToCString() const { |
#undef FORMAT |
} |
- |
RawString* LocalVarDescriptors::GetName(intptr_t var_index) const { |
ASSERT(var_index < Length()); |
ASSERT(Object::Handle(*raw()->nameAddrAt(var_index)).IsString()); |
return *raw()->nameAddrAt(var_index); |
} |
- |
void LocalVarDescriptors::SetVar(intptr_t var_index, |
const String& name, |
RawLocalVarDescriptors::VarInfo* info) const { |
@@ -12781,14 +12123,12 @@ void LocalVarDescriptors::SetVar(intptr_t var_index, |
raw()->data()[var_index] = *info; |
} |
- |
void LocalVarDescriptors::GetInfo(intptr_t var_index, |
RawLocalVarDescriptors::VarInfo* info) const { |
ASSERT(var_index < Length()); |
*info = raw()->data()[var_index]; |
} |
- |
static int PrintVarInfo(char* buffer, |
int len, |
intptr_t i, |
@@ -12806,24 +12146,25 @@ static int PrintVarInfo(char* buffer, |
static_cast<int>(info.end_pos.value())); |
} else if (kind == RawLocalVarDescriptors::kContextVar) { |
return OS::SNPrint( |
- buffer, len, "%2" Pd |
- " %-13s level=%-3d index=%-3d" |
- " begin=%-3d end=%-3d name=%s\n", |
+ buffer, len, |
+ "%2" Pd |
+ " %-13s level=%-3d index=%-3d" |
+ " begin=%-3d end=%-3d name=%s\n", |
i, LocalVarDescriptors::KindToCString(kind), info.scope_id, index, |
static_cast<int>(info.begin_pos.Pos()), |
static_cast<int>(info.end_pos.Pos()), var_name.ToCString()); |
} else { |
return OS::SNPrint( |
- buffer, len, "%2" Pd |
- " %-13s scope=%-3d index=%-3d" |
- " begin=%-3d end=%-3d name=%s\n", |
+ buffer, len, |
+ "%2" Pd |
+ " %-13s scope=%-3d index=%-3d" |
+ " begin=%-3d end=%-3d name=%s\n", |
i, LocalVarDescriptors::KindToCString(kind), info.scope_id, index, |
static_cast<int>(info.begin_pos.Pos()), |
static_cast<int>(info.end_pos.Pos()), var_name.ToCString()); |
} |
} |
- |
const char* LocalVarDescriptors::ToCString() const { |
if (IsNull()) { |
return "LocalVarDescriptors: null"; |
@@ -12852,7 +12193,6 @@ const char* LocalVarDescriptors::ToCString() const { |
return buffer; |
} |
- |
const char* LocalVarDescriptors::KindToCString( |
RawLocalVarDescriptors::VarInfoKind kind) { |
switch (kind) { |
@@ -12893,17 +12233,14 @@ RawLocalVarDescriptors* LocalVarDescriptors::New(intptr_t num_variables) { |
return result.raw(); |
} |
- |
intptr_t LocalVarDescriptors::Length() const { |
return raw_ptr()->num_entries_; |
} |
- |
intptr_t ExceptionHandlers::num_entries() const { |
return raw_ptr()->num_entries_; |
} |
- |
void ExceptionHandlers::SetHandlerInfo(intptr_t try_index, |
intptr_t outer_try_index, |
uword handler_pc_offset, |
@@ -12933,37 +12270,31 @@ void ExceptionHandlers::GetHandlerInfo(intptr_t try_index, |
*info = raw_ptr()->data()[try_index]; |
} |
- |
uword ExceptionHandlers::HandlerPCOffset(intptr_t try_index) const { |
ASSERT((try_index >= 0) && (try_index < num_entries())); |
return raw_ptr()->data()[try_index].handler_pc_offset; |
} |
- |
intptr_t ExceptionHandlers::OuterTryIndex(intptr_t try_index) const { |
ASSERT((try_index >= 0) && (try_index < num_entries())); |
return raw_ptr()->data()[try_index].outer_try_index; |
} |
- |
bool ExceptionHandlers::NeedsStackTrace(intptr_t try_index) const { |
ASSERT((try_index >= 0) && (try_index < num_entries())); |
return raw_ptr()->data()[try_index].needs_stacktrace; |
} |
- |
bool ExceptionHandlers::IsGenerated(intptr_t try_index) const { |
ASSERT((try_index >= 0) && (try_index < num_entries())); |
return raw_ptr()->data()[try_index].is_generated; |
} |
- |
bool ExceptionHandlers::HasCatchAll(intptr_t try_index) const { |
ASSERT((try_index >= 0) && (try_index < num_entries())); |
return raw_ptr()->data()[try_index].has_catch_all; |
} |
- |
void ExceptionHandlers::SetHandledTypes(intptr_t try_index, |
const Array& handled_types) const { |
ASSERT((try_index >= 0) && (try_index < num_entries())); |
@@ -12973,7 +12304,6 @@ void ExceptionHandlers::SetHandledTypes(intptr_t try_index, |
handled_types_data.SetAt(try_index, handled_types); |
} |
- |
RawArray* ExceptionHandlers::GetHandledTypes(intptr_t try_index) const { |
ASSERT((try_index >= 0) && (try_index < num_entries())); |
Array& array = Array::Handle(raw_ptr()->handled_types_data_); |
@@ -12981,12 +12311,10 @@ RawArray* ExceptionHandlers::GetHandledTypes(intptr_t try_index) const { |
return array.raw(); |
} |
- |
void ExceptionHandlers::set_handled_types_data(const Array& value) const { |
StorePointer(&raw_ptr()->handled_types_data_, value.raw()); |
} |
- |
RawExceptionHandlers* ExceptionHandlers::New(intptr_t num_handlers) { |
ASSERT(Object::exception_handlers_class() != Class::null()); |
if ((num_handlers < 0) || (num_handlers >= kMaxHandlers)) { |
@@ -13011,7 +12339,6 @@ RawExceptionHandlers* ExceptionHandlers::New(intptr_t num_handlers) { |
return result.raw(); |
} |
- |
RawExceptionHandlers* ExceptionHandlers::New(const Array& handled_types_data) { |
ASSERT(Object::exception_handlers_class() != Class::null()); |
const intptr_t num_handlers = handled_types_data.Length(); |
@@ -13034,7 +12361,6 @@ RawExceptionHandlers* ExceptionHandlers::New(const Array& handled_types_data) { |
return result.raw(); |
} |
- |
const char* ExceptionHandlers::ToCString() const { |
#define FORMAT1 "%" Pd " => %#x (%" Pd " types) (outer %d) %s\n" |
#define FORMAT2 " %d. %s\n" |
@@ -13084,17 +12410,14 @@ const char* ExceptionHandlers::ToCString() const { |
#undef FORMAT2 |
} |
- |
void SingleTargetCache::set_target(const Code& value) const { |
StorePointer(&raw_ptr()->target_, value.raw()); |
} |
- |
const char* SingleTargetCache::ToCString() const { |
return "SingleTargetCache"; |
} |
- |
RawSingleTargetCache* SingleTargetCache::New() { |
SingleTargetCache& result = SingleTargetCache::Handle(); |
{ |
@@ -13112,35 +12435,29 @@ RawSingleTargetCache* SingleTargetCache::New() { |
return result.raw(); |
} |
- |
void UnlinkedCall::set_target_name(const String& value) const { |
StorePointer(&raw_ptr()->target_name_, value.raw()); |
} |
- |
void UnlinkedCall::set_args_descriptor(const Array& value) const { |
StorePointer(&raw_ptr()->args_descriptor_, value.raw()); |
} |
- |
const char* UnlinkedCall::ToCString() const { |
return "UnlinkedCall"; |
} |
- |
RawUnlinkedCall* UnlinkedCall::New() { |
RawObject* raw = Object::Allocate(UnlinkedCall::kClassId, |
UnlinkedCall::InstanceSize(), Heap::kOld); |
return reinterpret_cast<RawUnlinkedCall*>(raw); |
} |
- |
void ICData::ResetSwitchable(Zone* zone) const { |
ASSERT(NumArgsTested() == 1); |
set_ic_data_array(Array::Handle(zone, CachedEmptyICDataArray(1))); |
} |
- |
const char* ICData::ToCString() const { |
const String& name = String::Handle(target_name()); |
const intptr_t num_args = NumArgsTested(); |
@@ -13152,7 +12469,6 @@ const char* ICData::ToCString() const { |
name.ToCString(), num_args, num_checks, type_args_len); |
} |
- |
RawFunction* ICData::Owner() const { |
Object& obj = Object::Handle(raw_ptr()->owner_); |
if (obj.IsNull()) { |
@@ -13167,7 +12483,6 @@ RawFunction* ICData::Owner() const { |
} |
} |
- |
RawICData* ICData::Original() const { |
if (IsNull()) { |
return ICData::null(); |
@@ -13180,31 +12495,26 @@ RawICData* ICData::Original() const { |
} |
} |
- |
void ICData::SetOriginal(const ICData& value) const { |
ASSERT(value.IsOriginal()); |
ASSERT(!value.IsNull()); |
StorePointer(&raw_ptr()->owner_, reinterpret_cast<RawObject*>(value.raw())); |
} |
- |
void ICData::set_owner(const Function& value) const { |
StorePointer(&raw_ptr()->owner_, reinterpret_cast<RawObject*>(value.raw())); |
} |
- |
void ICData::set_target_name(const String& value) const { |
ASSERT(!value.IsNull()); |
StorePointer(&raw_ptr()->target_name_, value.raw()); |
} |
- |
void ICData::set_arguments_descriptor(const Array& value) const { |
ASSERT(!value.IsNull()); |
StorePointer(&raw_ptr()->args_descriptor_, value.raw()); |
} |
- |
void ICData::set_deopt_id(intptr_t value) const { |
#if defined(DART_PRECOMPILED_RUNTIME) |
UNREACHABLE(); |
@@ -13214,13 +12524,11 @@ void ICData::set_deopt_id(intptr_t value) const { |
#endif |
} |
- |
void ICData::set_ic_data_array(const Array& value) const { |
ASSERT(!value.IsNull()); |
StorePointer(&raw_ptr()->ic_data_, value.raw()); |
} |
- |
#if defined(TAG_IC_DATA) |
void ICData::set_tag(intptr_t value) const { |
StoreNonPointer(&raw_ptr()->tag_, value); |
@@ -13231,75 +12539,62 @@ intptr_t ICData::NumArgsTested() const { |
return NumArgsTestedBits::decode(raw_ptr()->state_bits_); |
} |
- |
intptr_t ICData::TypeArgsLen() const { |
ArgumentsDescriptor args_desc(Array::Handle(arguments_descriptor())); |
return args_desc.TypeArgsLen(); |
} |
- |
void ICData::SetNumArgsTested(intptr_t value) const { |
ASSERT(Utils::IsUint(2, value)); |
StoreNonPointer(&raw_ptr()->state_bits_, |
NumArgsTestedBits::update(value, raw_ptr()->state_bits_)); |
} |
- |
uint32_t ICData::DeoptReasons() const { |
return DeoptReasonBits::decode(raw_ptr()->state_bits_); |
} |
- |
void ICData::SetDeoptReasons(uint32_t reasons) const { |
StoreNonPointer(&raw_ptr()->state_bits_, |
DeoptReasonBits::update(reasons, raw_ptr()->state_bits_)); |
} |
- |
bool ICData::HasDeoptReason(DeoptReasonId reason) const { |
ASSERT(reason <= kLastRecordedDeoptReason); |
return (DeoptReasons() & (1 << reason)) != 0; |
} |
- |
void ICData::AddDeoptReason(DeoptReasonId reason) const { |
if (reason <= kLastRecordedDeoptReason) { |
SetDeoptReasons(DeoptReasons() | (1 << reason)); |
} |
} |
- |
void ICData::SetIsStaticCall(bool static_call) const { |
StoreNonPointer(&raw_ptr()->state_bits_, |
StaticCallBit::update(static_call, raw_ptr()->state_bits_)); |
} |
- |
bool ICData::is_static_call() const { |
return StaticCallBit::decode(raw_ptr()->state_bits_); |
} |
- |
void ICData::set_state_bits(uint32_t bits) const { |
StoreNonPointer(&raw_ptr()->state_bits_, bits); |
} |
- |
intptr_t ICData::TestEntryLengthFor(intptr_t num_args) { |
return num_args + 1 /* target function*/ + 1 /* frequency */; |
} |
- |
intptr_t ICData::TestEntryLength() const { |
return TestEntryLengthFor(NumArgsTested()); |
} |
- |
intptr_t ICData::Length() const { |
return (Smi::Value(ic_data()->ptr()->length_) / TestEntryLength()); |
} |
- |
intptr_t ICData::NumberOfChecks() const { |
const intptr_t length = Length(); |
for (intptr_t i = 0; i < length; i++) { |
@@ -13311,7 +12606,6 @@ intptr_t ICData::NumberOfChecks() const { |
return -1; |
} |
- |
bool ICData::NumberOfChecksIs(intptr_t n) const { |
const intptr_t length = Length(); |
for (intptr_t i = 0; i < length; i++) { |
@@ -13324,7 +12618,6 @@ bool ICData::NumberOfChecksIs(intptr_t n) const { |
return n == length; |
} |
- |
// Discounts any checks with usage of zero. |
intptr_t ICData::NumberOfUsedChecks() const { |
intptr_t n = NumberOfChecks(); |
@@ -13340,7 +12633,6 @@ intptr_t ICData::NumberOfUsedChecks() const { |
return count; |
} |
- |
void ICData::WriteSentinel(const Array& data, intptr_t test_entry_length) { |
ASSERT(!data.IsNull()); |
for (intptr_t i = 1; i <= test_entry_length; i++) { |
@@ -13348,7 +12640,6 @@ void ICData::WriteSentinel(const Array& data, intptr_t test_entry_length) { |
} |
} |
- |
#if defined(DEBUG) |
// Used in asserts to verify that a check is not added twice. |
bool ICData::HasCheck(const GrowableArray<intptr_t>& cids) const { |
@@ -13372,7 +12663,6 @@ bool ICData::HasCheck(const GrowableArray<intptr_t>& cids) const { |
} |
#endif // DEBUG |
- |
void ICData::WriteSentinelAt(intptr_t index) const { |
const intptr_t len = Length(); |
ASSERT(index >= 0); |
@@ -13385,14 +12675,12 @@ void ICData::WriteSentinelAt(intptr_t index) const { |
} |
} |
- |
void ICData::ClearCountAt(intptr_t index) const { |
ASSERT(index >= 0); |
ASSERT(index < NumberOfChecks()); |
SetCountAt(index, 0); |
} |
- |
void ICData::ClearWithSentinel() const { |
if (IsImmutable()) { |
return; |
@@ -13432,7 +12720,6 @@ void ICData::ClearWithSentinel() const { |
WriteSentinelAt(0); |
} |
- |
void ICData::ClearAndSetStaticTarget(const Function& func) const { |
if (IsImmutable()) { |
return; |
@@ -13476,7 +12763,6 @@ void ICData::ClearAndSetStaticTarget(const Function& func) const { |
} |
} |
- |
// Add an initial Smi/Smi check with count 0. |
bool ICData::AddSmiSmiCheckForFastSmiStubs() const { |
bool is_smi_two_args_op = false; |
@@ -13507,7 +12793,6 @@ bool ICData::AddSmiSmiCheckForFastSmiStubs() const { |
return is_smi_two_args_op; |
} |
- |
// Used for unoptimized static calls when no class-ids are checked. |
void ICData::AddTarget(const Function& target) const { |
ASSERT(!target.IsNull()); |
@@ -13544,7 +12829,6 @@ void ICData::AddTarget(const Function& target) const { |
set_ic_data_array(data); |
} |
- |
bool ICData::ValidateInterceptor(const Function& target) const { |
ObjectStore* store = Isolate::Current()->object_store(); |
ASSERT((target.raw() == store->simple_instance_of_true_function()) || |
@@ -13608,7 +12892,6 @@ void ICData::AddCheck(const GrowableArray<intptr_t>& class_ids, |
set_ic_data_array(data); |
} |
- |
RawArray* ICData::FindFreeIndex(intptr_t* index) const { |
// The final entry is always the sentinel value, don't consider it |
// when searching. |
@@ -13635,7 +12918,6 @@ RawArray* ICData::FindFreeIndex(intptr_t* index) const { |
return data.raw(); |
} |
- |
void ICData::DebugDump() const { |
const Function& owner = Function::Handle(Owner()); |
THR_Print("ICData::DebugDump\n"); |
@@ -13655,7 +12937,6 @@ void ICData::DebugDump() const { |
} |
} |
- |
void ICData::AddReceiverCheck(intptr_t receiver_class_id, |
const Function& target, |
intptr_t count) const { |
@@ -13698,7 +12979,6 @@ void ICData::AddReceiverCheck(intptr_t receiver_class_id, |
set_ic_data_array(data); |
} |
- |
void ICData::GetCheckAt(intptr_t index, |
GrowableArray<intptr_t>* class_ids, |
Function* target) const { |
@@ -13714,7 +12994,6 @@ void ICData::GetCheckAt(intptr_t index, |
(*target) ^= data.At(data_pos++); |
} |
- |
bool ICData::IsSentinelAt(intptr_t index) const { |
ASSERT(index < Length()); |
const Array& data = Array::Handle(ic_data()); |
@@ -13729,7 +13008,6 @@ bool ICData::IsSentinelAt(intptr_t index) const { |
return true; |
} |
- |
void ICData::GetClassIdsAt(intptr_t index, |
GrowableArray<intptr_t>* class_ids) const { |
ASSERT(index < Length()); |
@@ -13743,7 +13021,6 @@ void ICData::GetClassIdsAt(intptr_t index, |
} |
} |
- |
void ICData::GetOneClassCheckAt(intptr_t index, |
intptr_t* class_id, |
Function* target) const { |
@@ -13756,7 +13033,6 @@ void ICData::GetOneClassCheckAt(intptr_t index, |
*target ^= data.At(data_pos + 1); |
} |
- |
intptr_t ICData::GetCidAt(intptr_t index) const { |
ASSERT(NumArgsTested() == 1); |
const Array& data = Array::Handle(ic_data()); |
@@ -13764,14 +13040,12 @@ intptr_t ICData::GetCidAt(intptr_t index) const { |
return Smi::Value(Smi::RawCast(data.At(data_pos))); |
} |
- |
intptr_t ICData::GetClassIdAt(intptr_t index, intptr_t arg_nr) const { |
GrowableArray<intptr_t> class_ids; |
GetClassIdsAt(index, &class_ids); |
return class_ids[arg_nr]; |
} |
- |
intptr_t ICData::GetReceiverClassIdAt(intptr_t index) const { |
ASSERT(index < Length()); |
ASSERT(!IsSentinelAt(index)); |
@@ -13781,7 +13055,6 @@ intptr_t ICData::GetReceiverClassIdAt(intptr_t index) const { |
return Smi::Value(Smi::RawCast(raw_data->ptr()->data()[data_pos])); |
} |
- |
RawFunction* ICData::GetTargetAt(intptr_t index) const { |
ASSERT(Isolate::Current()->compilation_allowed()); |
const intptr_t data_pos = index * TestEntryLength() + NumArgsTested(); |
@@ -13792,7 +13065,6 @@ RawFunction* ICData::GetTargetAt(intptr_t index) const { |
return reinterpret_cast<RawFunction*>(raw_data->ptr()->data()[data_pos]); |
} |
- |
RawObject* ICData::GetTargetOrCodeAt(intptr_t index) const { |
const intptr_t data_pos = index * TestEntryLength() + NumArgsTested(); |
@@ -13801,14 +13073,12 @@ RawObject* ICData::GetTargetOrCodeAt(intptr_t index) const { |
return raw_data->ptr()->data()[data_pos]; |
} |
- |
void ICData::IncrementCountAt(intptr_t index, intptr_t value) const { |
ASSERT(0 <= value); |
ASSERT(value <= Smi::kMaxValue); |
SetCountAt(index, Utils::Minimum(GetCountAt(index) + value, Smi::kMaxValue)); |
} |
- |
void ICData::SetCountAt(intptr_t index, intptr_t value) const { |
ASSERT(0 <= value); |
ASSERT(value <= Smi::kMaxValue); |
@@ -13819,7 +13089,6 @@ void ICData::SetCountAt(intptr_t index, intptr_t value) const { |
data.SetAt(data_pos, Smi::Handle(Smi::New(value))); |
} |
- |
intptr_t ICData::GetCountAt(intptr_t index) const { |
ASSERT(Isolate::Current()->compilation_allowed()); |
const Array& data = Array::Handle(ic_data()); |
@@ -13834,7 +13103,6 @@ intptr_t ICData::GetCountAt(intptr_t index) const { |
return 0; |
} |
- |
intptr_t ICData::AggregateCount() const { |
if (IsNull()) return 0; |
const intptr_t len = NumberOfChecks(); |
@@ -13845,7 +13113,6 @@ intptr_t ICData::AggregateCount() const { |
return count; |
} |
- |
void ICData::SetCodeAt(intptr_t index, const Code& value) const { |
ASSERT(!Isolate::Current()->compilation_allowed()); |
const Array& data = Array::Handle(ic_data()); |
@@ -13854,7 +13121,6 @@ void ICData::SetCodeAt(intptr_t index, const Code& value) const { |
data.SetAt(data_pos, value); |
} |
- |
void ICData::SetEntryPointAt(intptr_t index, const Smi& value) const { |
ASSERT(!Isolate::Current()->compilation_allowed()); |
const Array& data = Array::Handle(ic_data()); |
@@ -13863,7 +13129,6 @@ void ICData::SetEntryPointAt(intptr_t index, const Smi& value) const { |
data.SetAt(data_pos, value); |
} |
- |
RawFunction* ICData::GetTargetForReceiverClassId(intptr_t class_id, |
intptr_t* count_return) const { |
const intptr_t len = NumberOfChecks(); |
@@ -13876,7 +13141,6 @@ RawFunction* ICData::GetTargetForReceiverClassId(intptr_t class_id, |
return Function::null(); |
} |
- |
RawICData* ICData::AsUnaryClassChecksForCid(intptr_t cid, |
const Function& target) const { |
ASSERT(!IsNull()); |
@@ -13888,7 +13152,6 @@ RawICData* ICData::AsUnaryClassChecksForCid(intptr_t cid, |
return result.raw(); |
} |
- |
RawICData* ICData::AsUnaryClassChecksForArgNr(intptr_t arg_nr) const { |
ASSERT(!IsNull()); |
ASSERT(NumArgsTested() > arg_nr); |
@@ -13928,7 +13191,6 @@ RawICData* ICData::AsUnaryClassChecksForArgNr(intptr_t arg_nr) const { |
return result.raw(); |
} |
- |
// (cid, count) tuple used to sort ICData by count. |
struct CidCount { |
CidCount(intptr_t cid_, intptr_t count_, Function* f_) |
@@ -13941,7 +13203,6 @@ struct CidCount { |
Function* function; |
}; |
- |
int CidCount::HighestCountFirst(const CidCount* a, const CidCount* b) { |
if (a->count > b->count) { |
return -1; |
@@ -13949,7 +13210,6 @@ int CidCount::HighestCountFirst(const CidCount* a, const CidCount* b) { |
return (a->count < b->count) ? 1 : 0; |
} |
- |
RawICData* ICData::AsUnaryClassChecksSortedByCount() const { |
ASSERT(!IsNull()); |
const intptr_t kNumArgsTested = 1; |
@@ -14002,7 +13262,6 @@ RawICData* ICData::AsUnaryClassChecksSortedByCount() const { |
return result.raw(); |
} |
- |
bool ICData::AllTargetsHaveSameOwner(intptr_t owner_cid) const { |
if (NumberOfChecksIs(0)) return false; |
Class& cls = Class::Handle(); |
@@ -14018,7 +13277,6 @@ bool ICData::AllTargetsHaveSameOwner(intptr_t owner_cid) const { |
return true; |
} |
- |
bool ICData::HasReceiverClassId(intptr_t class_id) const { |
ASSERT(NumArgsTested() > 0); |
const intptr_t len = NumberOfChecks(); |
@@ -14033,7 +13291,6 @@ bool ICData::HasReceiverClassId(intptr_t class_id) const { |
return false; |
} |
- |
// Returns true if all targets are the same. |
// TODO(srdjan): if targets are native use their C_function to compare. |
bool ICData::HasOneTarget() const { |
@@ -14048,7 +13305,6 @@ bool ICData::HasOneTarget() const { |
return true; |
} |
- |
void ICData::GetUsedCidsForTwoArgs(GrowableArray<intptr_t>* first, |
GrowableArray<intptr_t>* second) const { |
ASSERT(NumArgsTested() == 2); |
@@ -14066,7 +13322,6 @@ void ICData::GetUsedCidsForTwoArgs(GrowableArray<intptr_t>* first, |
} |
} |
- |
bool ICData::IsUsedAt(intptr_t i) const { |
if (GetCountAt(i) <= 0) { |
// Do not mistake unoptimized static call ICData for unused. |
@@ -14083,14 +13338,12 @@ bool ICData::IsUsedAt(intptr_t i) const { |
return true; |
} |
- |
void ICData::InitOnce() { |
for (int i = 0; i < kCachedICDataArrayCount; i++) { |
cached_icdata_arrays_[i] = ICData::NewNonCachedEmptyICDataArray(i); |
} |
} |
- |
RawArray* ICData::NewNonCachedEmptyICDataArray(intptr_t num_args_tested) { |
// IC data array must be null terminated (sentinel entry). |
const intptr_t len = TestEntryLengthFor(num_args_tested); |
@@ -14100,14 +13353,12 @@ RawArray* ICData::NewNonCachedEmptyICDataArray(intptr_t num_args_tested) { |
return array.raw(); |
} |
- |
RawArray* ICData::CachedEmptyICDataArray(intptr_t num_args_tested) { |
ASSERT(num_args_tested >= 0); |
ASSERT(num_args_tested < kCachedICDataArrayCount); |
return cached_icdata_arrays_[num_args_tested]; |
} |
- |
// Does not initialize ICData array. |
RawICData* ICData::NewDescriptor(Zone* zone, |
const Function& owner, |
@@ -14142,13 +13393,11 @@ RawICData* ICData::NewDescriptor(Zone* zone, |
return result.raw(); |
} |
- |
bool ICData::IsImmutable() const { |
const Array& data = Array::Handle(ic_data()); |
return data.IsImmutable(); |
} |
- |
RawICData* ICData::New() { |
ICData& result = ICData::Handle(); |
{ |
@@ -14166,7 +13415,6 @@ RawICData* ICData::New() { |
return result.raw(); |
} |
- |
RawICData* ICData::New(const Function& owner, |
const String& target_name, |
const Array& arguments_descriptor, |
@@ -14182,7 +13430,6 @@ RawICData* ICData::New(const Function& owner, |
return result.raw(); |
} |
- |
RawICData* ICData::NewFrom(const ICData& from, intptr_t num_args_tested) { |
const ICData& result = ICData::Handle(ICData::New( |
Function::Handle(from.Owner()), String::Handle(from.target_name()), |
@@ -14193,7 +13440,6 @@ RawICData* ICData::NewFrom(const ICData& from, intptr_t num_args_tested) { |
return result.raw(); |
} |
- |
RawICData* ICData::Clone(const ICData& from) { |
Zone* zone = Thread::Current()->zone(); |
const ICData& result = ICData::Handle(ICData::NewDescriptor( |
@@ -14216,7 +13462,6 @@ RawICData* ICData::Clone(const ICData& from) { |
return result.raw(); |
} |
- |
Code::Comments& Code::Comments::New(intptr_t count) { |
Comments* comments; |
if (count < 0 || count > (kIntptrMax / kNumberOfEntries)) { |
@@ -14234,7 +13479,6 @@ Code::Comments& Code::Comments::New(intptr_t count) { |
return *comments; |
} |
- |
intptr_t Code::Comments::Length() const { |
if (comments_.IsNull()) { |
return 0; |
@@ -14242,32 +13486,26 @@ intptr_t Code::Comments::Length() const { |
return comments_.Length() / kNumberOfEntries; |
} |
- |
intptr_t Code::Comments::PCOffsetAt(intptr_t idx) const { |
return Smi::Value( |
Smi::RawCast(comments_.At(idx * kNumberOfEntries + kPCOffsetEntry))); |
} |
- |
void Code::Comments::SetPCOffsetAt(intptr_t idx, intptr_t pc) { |
comments_.SetAt(idx * kNumberOfEntries + kPCOffsetEntry, |
Smi::Handle(Smi::New(pc))); |
} |
- |
RawString* Code::Comments::CommentAt(intptr_t idx) const { |
return String::RawCast(comments_.At(idx * kNumberOfEntries + kCommentEntry)); |
} |
- |
void Code::Comments::SetCommentAt(intptr_t idx, const String& comment) { |
comments_.SetAt(idx * kNumberOfEntries + kCommentEntry, comment); |
} |
- |
Code::Comments::Comments(const Array& comments) : comments_(comments) {} |
- |
RawLocalVarDescriptors* Code::GetLocalVarDescriptors() const { |
const LocalVarDescriptors& v = LocalVarDescriptors::Handle(var_descriptors()); |
if (v.IsNull()) { |
@@ -14279,22 +13517,18 @@ RawLocalVarDescriptors* Code::GetLocalVarDescriptors() const { |
return var_descriptors(); |
} |
- |
void Code::set_state_bits(intptr_t bits) const { |
StoreNonPointer(&raw_ptr()->state_bits_, bits); |
} |
- |
void Code::set_is_optimized(bool value) const { |
set_state_bits(OptimizedBit::update(value, raw_ptr()->state_bits_)); |
} |
- |
void Code::set_is_alive(bool value) const { |
set_state_bits(AliveBit::update(value, raw_ptr()->state_bits_)); |
} |
- |
void Code::set_stackmaps(const Array& maps) const { |
ASSERT(maps.IsOld()); |
StorePointer(&raw_ptr()->stackmaps_, maps.raw()); |
@@ -14302,7 +13536,6 @@ void Code::set_stackmaps(const Array& maps) const { |
maps.IsNull() ? 0 : maps.Length() * sizeof(uword)); |
} |
- |
#if !defined(DART_PRECOMPILED_RUNTIME) && !defined(DART_PRECOMPILER) |
void Code::set_variables(const Smi& smi) const { |
StorePointer(&raw_ptr()->catch_entry_.variables_, smi.raw()); |
@@ -14313,7 +13546,6 @@ void Code::set_catch_entry_state_maps(const TypedData& maps) const { |
} |
#endif |
- |
void Code::set_deopt_info_array(const Array& array) const { |
#if defined(DART_PRECOMPILED_RUNTIME) |
UNREACHABLE(); |
@@ -14323,7 +13555,6 @@ void Code::set_deopt_info_array(const Array& array) const { |
#endif |
} |
- |
void Code::set_static_calls_target_table(const Array& value) const { |
#if defined(DART_PRECOMPILED_RUNTIME) |
UNREACHABLE(); |
@@ -14342,7 +13573,6 @@ void Code::set_static_calls_target_table(const Array& value) const { |
#endif // DEBUG |
} |
- |
bool Code::HasBreakpoint() const { |
if (!FLAG_support_debugger) { |
return false; |
@@ -14350,7 +13580,6 @@ bool Code::HasBreakpoint() const { |
return Isolate::Current()->debugger()->HasBreakpoint(*this); |
} |
- |
RawTypedData* Code::GetDeoptInfoAtPc(uword pc, |
ICData::DeoptReasonId* deopt_reason, |
uint32_t* deopt_flags) const { |
@@ -14385,7 +13614,6 @@ RawTypedData* Code::GetDeoptInfoAtPc(uword pc, |
#endif // defined(DART_PRECOMPILED_RUNTIME) |
} |
- |
intptr_t Code::BinarySearchInSCallTable(uword pc) const { |
#if defined(DART_PRECOMPILED_RUNTIME) |
UNREACHABLE(); |
@@ -14411,7 +13639,6 @@ intptr_t Code::BinarySearchInSCallTable(uword pc) const { |
return -1; |
} |
- |
RawFunction* Code::GetStaticCallTargetFunctionAt(uword pc) const { |
#if defined(DART_PRECOMPILED_RUNTIME) |
UNREACHABLE(); |
@@ -14428,7 +13655,6 @@ RawFunction* Code::GetStaticCallTargetFunctionAt(uword pc) const { |
#endif |
} |
- |
RawCode* Code::GetStaticCallTargetCodeAt(uword pc) const { |
#if defined(DART_PRECOMPILED_RUNTIME) |
UNREACHABLE(); |
@@ -14445,7 +13671,6 @@ RawCode* Code::GetStaticCallTargetCodeAt(uword pc) const { |
#endif |
} |
- |
void Code::SetStaticCallTargetCodeAt(uword pc, const Code& code) const { |
#if defined(DART_PRECOMPILED_RUNTIME) |
UNREACHABLE(); |
@@ -14459,7 +13684,6 @@ void Code::SetStaticCallTargetCodeAt(uword pc, const Code& code) const { |
#endif |
} |
- |
void Code::SetStubCallTargetCodeAt(uword pc, const Code& code) const { |
#if defined(DART_PRECOMPILED_RUNTIME) |
UNREACHABLE(); |
@@ -14479,7 +13703,6 @@ void Code::SetStubCallTargetCodeAt(uword pc, const Code& code) const { |
#endif |
} |
- |
void Code::Disassemble(DisassemblyFormatter* formatter) const { |
#ifndef PRODUCT |
if (!FLAG_support_disassembler) { |
@@ -14495,7 +13718,6 @@ void Code::Disassemble(DisassemblyFormatter* formatter) const { |
#endif |
} |
- |
const Code::Comments& Code::comments() const { |
#if defined(DART_PRECOMPILED_RUNTIME) |
Comments* comments = new Code::Comments(Array::Handle()); |
@@ -14505,7 +13727,6 @@ const Code::Comments& Code::comments() const { |
return *comments; |
} |
- |
void Code::set_comments(const Code::Comments& comments) const { |
#if defined(DART_PRECOMPILED_RUNTIME) |
UNREACHABLE(); |
@@ -14515,7 +13736,6 @@ void Code::set_comments(const Code::Comments& comments) const { |
#endif |
} |
- |
void Code::SetPrologueOffset(intptr_t offset) const { |
#if defined(DART_PRECOMPILED_RUNTIME) |
UNREACHABLE(); |
@@ -14527,7 +13747,6 @@ void Code::SetPrologueOffset(intptr_t offset) const { |
#endif |
} |
- |
intptr_t Code::GetPrologueOffset() const { |
#if defined(DART_PRECOMPILED_RUNTIME) |
return -1; |
@@ -14542,18 +13761,15 @@ intptr_t Code::GetPrologueOffset() const { |
#endif |
} |
- |
RawArray* Code::inlined_id_to_function() const { |
return raw_ptr()->inlined_id_to_function_; |
} |
- |
void Code::set_inlined_id_to_function(const Array& value) const { |
ASSERT(value.IsOld()); |
StorePointer(&raw_ptr()->inlined_id_to_function_, value.raw()); |
} |
- |
RawCode* Code::New(intptr_t pointer_offsets_length) { |
if (pointer_offsets_length < 0 || pointer_offsets_length > kMaxElements) { |
// This should be caught before we reach here. |
@@ -14577,7 +13793,6 @@ RawCode* Code::New(intptr_t pointer_offsets_length) { |
return result.raw(); |
} |
- |
RawCode* Code::FinalizeCode(const char* name, |
Assembler* assembler, |
bool optimized) { |
@@ -14665,7 +13880,6 @@ RawCode* Code::FinalizeCode(const char* name, |
return code.raw(); |
} |
- |
RawCode* Code::FinalizeCode(const Function& function, |
Assembler* assembler, |
bool optimized) { |
@@ -14680,12 +13894,10 @@ RawCode* Code::FinalizeCode(const Function& function, |
return FinalizeCode("", assembler, optimized); |
} |
- |
bool Code::SlowFindRawCodeVisitor::FindObject(RawObject* raw_obj) const { |
return RawCode::ContainsPC(raw_obj, pc_); |
} |
- |
RawCode* Code::LookupCodeInIsolate(Isolate* isolate, uword pc) { |
ASSERT((isolate == Isolate::Current()) || (isolate == Dart::vm_isolate())); |
if (isolate->heap() == NULL) { |
@@ -14700,17 +13912,14 @@ RawCode* Code::LookupCodeInIsolate(Isolate* isolate, uword pc) { |
return Code::null(); |
} |
- |
RawCode* Code::LookupCode(uword pc) { |
return LookupCodeInIsolate(Isolate::Current(), pc); |
} |
- |
RawCode* Code::LookupCodeInVmIsolate(uword pc) { |
return LookupCodeInIsolate(Dart::vm_isolate(), pc); |
} |
- |
// Given a pc and a timestamp, lookup the code. |
RawCode* Code::FindCode(uword pc, int64_t timestamp) { |
Code& code = Code::Handle(Code::LookupCode(pc)); |
@@ -14728,7 +13937,6 @@ RawCode* Code::FindCode(uword pc, int64_t timestamp) { |
return Code::null(); |
} |
- |
TokenPosition Code::GetTokenIndexOfPC(uword pc) const { |
uword pc_offset = pc - PayloadStart(); |
const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors()); |
@@ -14741,7 +13949,6 @@ TokenPosition Code::GetTokenIndexOfPC(uword pc) const { |
return TokenPosition::kNoSource; |
} |
- |
uword Code::GetPcForDeoptId(intptr_t deopt_id, |
RawPcDescriptors::Kind kind) const { |
const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors()); |
@@ -14757,7 +13964,6 @@ uword Code::GetPcForDeoptId(intptr_t deopt_id, |
return 0; |
} |
- |
intptr_t Code::GetDeoptIdForOsr(uword pc) const { |
uword pc_offset = pc - PayloadStart(); |
const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors()); |
@@ -14770,12 +13976,10 @@ intptr_t Code::GetDeoptIdForOsr(uword pc) const { |
return Thread::kNoDeoptId; |
} |
- |
const char* Code::ToCString() const { |
return Thread::Current()->zone()->PrintToString("Code(%s)", QualifiedName()); |
} |
- |
const char* Code::Name() const { |
Zone* zone = Thread::Current()->zone(); |
const Object& obj = Object::Handle(zone, owner()); |
@@ -14802,7 +14006,6 @@ const char* Code::Name() const { |
} |
} |
- |
const char* Code::QualifiedName() const { |
Zone* zone = Thread::Current()->zone(); |
const Object& obj = Object::Handle(zone, owner()); |
@@ -14816,25 +14019,21 @@ const char* Code::QualifiedName() const { |
return Name(); |
} |
- |
bool Code::IsAllocationStubCode() const { |
const Object& obj = Object::Handle(owner()); |
return obj.IsClass(); |
} |
- |
bool Code::IsStubCode() const { |
const Object& obj = Object::Handle(owner()); |
return obj.IsNull(); |
} |
- |
bool Code::IsFunctionCode() const { |
const Object& obj = Object::Handle(owner()); |
return obj.IsFunction(); |
} |
- |
void Code::DisableDartCode() const { |
DEBUG_ASSERT(IsMutatorOrAtSafepoint()); |
ASSERT(IsFunctionCode()); |
@@ -14844,7 +14043,6 @@ void Code::DisableDartCode() const { |
SetActiveInstructions(Instructions::Handle(new_code.instructions())); |
} |
- |
void Code::DisableStubCode() const { |
#if !defined(TARGET_ARCH_DBC) |
ASSERT(Thread::Current()->IsMutatorThread()); |
@@ -14859,7 +14057,6 @@ void Code::DisableStubCode() const { |
#endif // !defined(TARGET_ARCH_DBC) |
} |
- |
void Code::SetActiveInstructions(const Instructions& instructions) const { |
#if defined(DART_PRECOMPILED_RUNTIME) |
UNREACHABLE(); |
@@ -14875,7 +14072,6 @@ void Code::SetActiveInstructions(const Instructions& instructions) const { |
#endif |
} |
- |
RawStackMap* Code::GetStackMap(uint32_t pc_offset, |
Array* maps, |
StackMap* map) const { |
@@ -14907,7 +14103,6 @@ RawStackMap* Code::GetStackMap(uint32_t pc_offset, |
return StackMap::null(); |
} |
- |
void Code::GetInlinedFunctionsAtInstruction( |
intptr_t pc_offset, |
GrowableArray<const Function*>* functions, |
@@ -14923,7 +14118,6 @@ void Code::GetInlinedFunctionsAtInstruction( |
reader.GetInlinedFunctionsAt(pc_offset, functions, token_positions); |
} |
- |
#ifndef PRODUCT |
void Code::PrintJSONInlineIntervals(JSONObject* jsobj) const { |
if (!is_optimized()) { |
@@ -14937,7 +14131,6 @@ void Code::PrintJSONInlineIntervals(JSONObject* jsobj) const { |
} |
#endif |
- |
void Code::DumpInlineIntervals() const { |
const CodeSourceMap& map = CodeSourceMap::Handle(code_source_map()); |
if (map.IsNull()) { |
@@ -14950,7 +14143,6 @@ void Code::DumpInlineIntervals() const { |
reader.DumpInlineIntervals(PayloadStart()); |
} |
- |
void Code::DumpSourcePositions() const { |
const CodeSourceMap& map = CodeSourceMap::Handle(code_source_map()); |
if (map.IsNull()) { |
@@ -14963,7 +14155,6 @@ void Code::DumpSourcePositions() const { |
reader.DumpSourcePositions(PayloadStart()); |
} |
- |
RawArray* Code::await_token_positions() const { |
#if defined(DART_PRECOMPILED_RUNTIME) |
return Array::null(); |
@@ -14992,7 +14183,6 @@ RawContext* Context::New(intptr_t num_variables, Heap::Space space) { |
return result.raw(); |
} |
- |
const char* Context::ToCString() const { |
if (IsNull()) { |
return "Context: null"; |
@@ -15009,14 +14199,12 @@ const char* Context::ToCString() const { |
} |
} |
- |
static void IndentN(int count) { |
for (int i = 0; i < count; i++) { |
THR_Print(" "); |
} |
} |
- |
void Context::Dump(int indent) const { |
if (IsNull()) { |
IndentN(indent); |
@@ -15046,7 +14234,6 @@ void Context::Dump(int indent) const { |
THR_Print("}\n"); |
} |
- |
RawContextScope* ContextScope::New(intptr_t num_variables, bool is_implicit) { |
ASSERT(Object::context_scope_class() != Class::null()); |
if (num_variables < 0 || num_variables > kMaxElements) { |
@@ -15066,26 +14253,22 @@ RawContextScope* ContextScope::New(intptr_t num_variables, bool is_implicit) { |
return result.raw(); |
} |
- |
TokenPosition ContextScope::TokenIndexAt(intptr_t scope_index) const { |
return TokenPosition(Smi::Value(VariableDescAddr(scope_index)->token_pos)); |
} |
- |
void ContextScope::SetTokenIndexAt(intptr_t scope_index, |
TokenPosition token_pos) const { |
StoreSmi(&VariableDescAddr(scope_index)->token_pos, |
Smi::New(token_pos.value())); |
} |
- |
TokenPosition ContextScope::DeclarationTokenIndexAt( |
intptr_t scope_index) const { |
return TokenPosition( |
Smi::Value(VariableDescAddr(scope_index)->declaration_token_pos)); |
} |
- |
void ContextScope::SetDeclarationTokenIndexAt( |
intptr_t scope_index, |
TokenPosition declaration_token_pos) const { |
@@ -15093,88 +14276,73 @@ void ContextScope::SetDeclarationTokenIndexAt( |
Smi::New(declaration_token_pos.value())); |
} |
- |
RawString* ContextScope::NameAt(intptr_t scope_index) const { |
return VariableDescAddr(scope_index)->name; |
} |
- |
void ContextScope::SetNameAt(intptr_t scope_index, const String& name) const { |
StorePointer(&(VariableDescAddr(scope_index)->name), name.raw()); |
} |
- |
bool ContextScope::IsFinalAt(intptr_t scope_index) const { |
return Bool::Handle(VariableDescAddr(scope_index)->is_final).value(); |
} |
- |
void ContextScope::SetIsFinalAt(intptr_t scope_index, bool is_final) const { |
StorePointer(&(VariableDescAddr(scope_index)->is_final), |
Bool::Get(is_final).raw()); |
} |
- |
bool ContextScope::IsConstAt(intptr_t scope_index) const { |
return Bool::Handle(VariableDescAddr(scope_index)->is_const).value(); |
} |
- |
void ContextScope::SetIsConstAt(intptr_t scope_index, bool is_const) const { |
StorePointer(&(VariableDescAddr(scope_index)->is_const), |
Bool::Get(is_const).raw()); |
} |
- |
RawAbstractType* ContextScope::TypeAt(intptr_t scope_index) const { |
ASSERT(!IsConstAt(scope_index)); |
return VariableDescAddr(scope_index)->type; |
} |
- |
void ContextScope::SetTypeAt(intptr_t scope_index, |
const AbstractType& type) const { |
StorePointer(&(VariableDescAddr(scope_index)->type), type.raw()); |
} |
- |
RawInstance* ContextScope::ConstValueAt(intptr_t scope_index) const { |
ASSERT(IsConstAt(scope_index)); |
return VariableDescAddr(scope_index)->value; |
} |
- |
void ContextScope::SetConstValueAt(intptr_t scope_index, |
const Instance& value) const { |
ASSERT(IsConstAt(scope_index)); |
StorePointer(&(VariableDescAddr(scope_index)->value), value.raw()); |
} |
- |
intptr_t ContextScope::ContextIndexAt(intptr_t scope_index) const { |
return Smi::Value(VariableDescAddr(scope_index)->context_index); |
} |
- |
void ContextScope::SetContextIndexAt(intptr_t scope_index, |
intptr_t context_index) const { |
StoreSmi(&(VariableDescAddr(scope_index)->context_index), |
Smi::New(context_index)); |
} |
- |
intptr_t ContextScope::ContextLevelAt(intptr_t scope_index) const { |
return Smi::Value(VariableDescAddr(scope_index)->context_level); |
} |
- |
void ContextScope::SetContextLevelAt(intptr_t scope_index, |
intptr_t context_level) const { |
StoreSmi(&(VariableDescAddr(scope_index)->context_level), |
Smi::New(context_level)); |
} |
- |
const char* ContextScope::ToCString() const { |
const char* prev_cstr = "ContextScope:"; |
String& name = String::Handle(); |
@@ -15193,17 +14361,14 @@ const char* ContextScope::ToCString() const { |
return prev_cstr; |
} |
- |
RawArray* MegamorphicCache::buckets() const { |
return raw_ptr()->buckets_; |
} |
- |
void MegamorphicCache::set_buckets(const Array& buckets) const { |
StorePointer(&raw_ptr()->buckets_, buckets.raw()); |
} |
- |
// Class IDs in the table are smi-tagged, so we use a smi-tagged mask |
// and target class ID to avoid untagging (on each iteration of the |
// test loop) in generated code. |
@@ -15211,32 +14376,26 @@ intptr_t MegamorphicCache::mask() const { |
return Smi::Value(raw_ptr()->mask_); |
} |
- |
void MegamorphicCache::set_mask(intptr_t mask) const { |
StoreSmi(&raw_ptr()->mask_, Smi::New(mask)); |
} |
- |
intptr_t MegamorphicCache::filled_entry_count() const { |
return raw_ptr()->filled_entry_count_; |
} |
- |
void MegamorphicCache::set_filled_entry_count(intptr_t count) const { |
StoreNonPointer(&raw_ptr()->filled_entry_count_, count); |
} |
- |
void MegamorphicCache::set_target_name(const String& value) const { |
StorePointer(&raw_ptr()->target_name_, value.raw()); |
} |
- |
void MegamorphicCache::set_arguments_descriptor(const Array& value) const { |
StorePointer(&raw_ptr()->args_descriptor_, value.raw()); |
} |
- |
RawMegamorphicCache* MegamorphicCache::New() { |
MegamorphicCache& result = MegamorphicCache::Handle(); |
{ |
@@ -15250,7 +14409,6 @@ RawMegamorphicCache* MegamorphicCache::New() { |
return result.raw(); |
} |
- |
RawMegamorphicCache* MegamorphicCache::New(const String& target_name, |
const Array& arguments_descriptor) { |
MegamorphicCache& result = MegamorphicCache::Handle(); |
@@ -15277,7 +14435,6 @@ RawMegamorphicCache* MegamorphicCache::New(const String& target_name, |
return result.raw(); |
} |
- |
void MegamorphicCache::EnsureCapacity() const { |
intptr_t old_capacity = mask() + 1; |
double load_limit = kLoadFactor * static_cast<double>(old_capacity); |
@@ -15308,7 +14465,6 @@ void MegamorphicCache::EnsureCapacity() const { |
} |
} |
- |
void MegamorphicCache::Insert(const Smi& class_id, |
const Function& target) const { |
ASSERT(static_cast<double>(filled_entry_count() + 1) <= |
@@ -15328,14 +14484,12 @@ void MegamorphicCache::Insert(const Smi& class_id, |
UNREACHABLE(); |
} |
- |
const char* MegamorphicCache::ToCString() const { |
const String& name = String::Handle(target_name()); |
return OS::SCreate(Thread::Current()->zone(), "MegamorphicCache(%s)", |
name.ToCString()); |
} |
- |
RawSubtypeTestCache* SubtypeTestCache::New() { |
ASSERT(Object::subtypetestcache_class() != Class::null()); |
SubtypeTestCache& result = SubtypeTestCache::Handle(); |
@@ -15353,19 +14507,16 @@ RawSubtypeTestCache* SubtypeTestCache::New() { |
return result.raw(); |
} |
- |
void SubtypeTestCache::set_cache(const Array& value) const { |
StorePointer(&raw_ptr()->cache_, value.raw()); |
} |
- |
intptr_t SubtypeTestCache::NumberOfChecks() const { |
NoSafepointScope no_safepoint; |
// Do not count the sentinel; |
return (Smi::Value(cache()->ptr()->length_) / kTestEntryLength) - 1; |
} |
- |
void SubtypeTestCache::AddCheck( |
const Object& instance_class_id_or_function, |
const TypeArguments& instance_type_arguments, |
@@ -15387,7 +14538,6 @@ void SubtypeTestCache::AddCheck( |
data.SetAt(data_pos + kTestResult, test_result); |
} |
- |
void SubtypeTestCache::GetCheck(intptr_t ix, |
Object* instance_class_id_or_function, |
TypeArguments* instance_type_arguments, |
@@ -15405,12 +14555,10 @@ void SubtypeTestCache::GetCheck(intptr_t ix, |
*test_result ^= data.At(data_pos + kTestResult); |
} |
- |
const char* SubtypeTestCache::ToCString() const { |
return "SubtypeTestCache"; |
} |
- |
const char* Error::ToErrorCString() const { |
if (IsNull()) { |
return "Error: null"; |
@@ -15419,7 +14567,6 @@ const char* Error::ToErrorCString() const { |
return "Error"; |
} |
- |
const char* Error::ToCString() const { |
if (IsNull()) { |
return "Error: null"; |
@@ -15429,7 +14576,6 @@ const char* Error::ToCString() const { |
return "Error"; |
} |
- |
RawApiError* ApiError::New() { |
ASSERT(Object::api_error_class() != Class::null()); |
RawObject* raw = Object::Allocate(ApiError::kClassId, |
@@ -15437,7 +14583,6 @@ RawApiError* ApiError::New() { |
return reinterpret_cast<RawApiError*>(raw); |
} |
- |
RawApiError* ApiError::New(const String& message, Heap::Space space) { |
#ifndef PRODUCT |
if (FLAG_print_stacktrace_at_api_error) { |
@@ -15458,23 +14603,19 @@ RawApiError* ApiError::New(const String& message, Heap::Space space) { |
return result.raw(); |
} |
- |
void ApiError::set_message(const String& message) const { |
StorePointer(&raw_ptr()->message_, message.raw()); |
} |
- |
const char* ApiError::ToErrorCString() const { |
const String& msg_str = String::Handle(message()); |
return msg_str.ToCString(); |
} |
- |
const char* ApiError::ToCString() const { |
return "ApiError"; |
} |
- |
RawLanguageError* LanguageError::New() { |
ASSERT(Object::language_error_class() != Class::null()); |
RawObject* raw = Object::Allocate(LanguageError::kClassId, |
@@ -15482,7 +14623,6 @@ RawLanguageError* LanguageError::New() { |
return reinterpret_cast<RawLanguageError*>(raw); |
} |
- |
RawLanguageError* LanguageError::NewFormattedV(const Error& prev_error, |
const Script& script, |
TokenPosition token_pos, |
@@ -15509,7 +14649,6 @@ RawLanguageError* LanguageError::NewFormattedV(const Error& prev_error, |
return result.raw(); |
} |
- |
RawLanguageError* LanguageError::NewFormatted(const Error& prev_error, |
const Script& script, |
TokenPosition token_pos, |
@@ -15528,7 +14667,6 @@ RawLanguageError* LanguageError::NewFormatted(const Error& prev_error, |
return result; |
} |
- |
RawLanguageError* LanguageError::New(const String& formatted_message, |
Report::Kind kind, |
Heap::Space space) { |
@@ -15545,43 +14683,35 @@ RawLanguageError* LanguageError::New(const String& formatted_message, |
return result.raw(); |
} |
- |
void LanguageError::set_previous_error(const Error& value) const { |
StorePointer(&raw_ptr()->previous_error_, value.raw()); |
} |
- |
void LanguageError::set_script(const Script& value) const { |
StorePointer(&raw_ptr()->script_, value.raw()); |
} |
- |
void LanguageError::set_token_pos(TokenPosition token_pos) const { |
ASSERT(!token_pos.IsClassifying()); |
StoreNonPointer(&raw_ptr()->token_pos_, token_pos); |
} |
- |
void LanguageError::set_report_after_token(bool value) { |
StoreNonPointer(&raw_ptr()->report_after_token_, value); |
} |
- |
void LanguageError::set_kind(uint8_t value) const { |
StoreNonPointer(&raw_ptr()->kind_, value); |
} |
- |
void LanguageError::set_message(const String& value) const { |
StorePointer(&raw_ptr()->message_, value.raw()); |
} |
- |
void LanguageError::set_formatted_message(const String& value) const { |
StorePointer(&raw_ptr()->formatted_message_, value.raw()); |
} |
- |
RawString* LanguageError::FormatMessage() const { |
if (formatted_message() != String::null()) { |
return formatted_message(); |
@@ -15599,7 +14729,6 @@ RawString* LanguageError::FormatMessage() const { |
return result.raw(); |
} |
- |
const char* LanguageError::ToErrorCString() const { |
Thread* thread = Thread::Current(); |
NoReloadScope no_reload_scope(thread->isolate(), thread); |
@@ -15607,12 +14736,10 @@ const char* LanguageError::ToErrorCString() const { |
return msg_str.ToCString(); |
} |
- |
const char* LanguageError::ToCString() const { |
return "LanguageError"; |
} |
- |
RawUnhandledException* UnhandledException::New(const Instance& exception, |
const Instance& stacktrace, |
Heap::Space space) { |
@@ -15630,7 +14757,6 @@ RawUnhandledException* UnhandledException::New(const Instance& exception, |
return result.raw(); |
} |
- |
RawUnhandledException* UnhandledException::New(Heap::Space space) { |
ASSERT(Object::unhandled_exception_class() != Class::null()); |
UnhandledException& result = UnhandledException::Handle(); |
@@ -15646,17 +14772,14 @@ RawUnhandledException* UnhandledException::New(Heap::Space space) { |
return result.raw(); |
} |
- |
void UnhandledException::set_exception(const Instance& exception) const { |
StorePointer(&raw_ptr()->exception_, exception.raw()); |
} |
- |
void UnhandledException::set_stacktrace(const Instance& stacktrace) const { |
StorePointer(&raw_ptr()->stacktrace_, stacktrace.raw()); |
} |
- |
const char* UnhandledException::ToErrorCString() const { |
Thread* thread = Thread::Current(); |
Isolate* isolate = thread->isolate(); |
@@ -15688,12 +14811,10 @@ const char* UnhandledException::ToErrorCString() const { |
stack_str); |
} |
- |
const char* UnhandledException::ToCString() const { |
return "UnhandledException"; |
} |
- |
RawUnwindError* UnwindError::New(const String& message, Heap::Space space) { |
ASSERT(Object::unwind_error_class() != Class::null()); |
UnwindError& result = UnwindError::Handle(); |
@@ -15708,28 +14829,23 @@ RawUnwindError* UnwindError::New(const String& message, Heap::Space space) { |
return result.raw(); |
} |
- |
void UnwindError::set_message(const String& message) const { |
StorePointer(&raw_ptr()->message_, message.raw()); |
} |
- |
void UnwindError::set_is_user_initiated(bool value) const { |
StoreNonPointer(&raw_ptr()->is_user_initiated_, value); |
} |
- |
const char* UnwindError::ToErrorCString() const { |
const String& msg_str = String::Handle(message()); |
return msg_str.ToCString(); |
} |
- |
const char* UnwindError::ToCString() const { |
return "UnwindError"; |
} |
- |
RawObject* Instance::Evaluate(const Class& method_cls, |
const String& expr, |
const Array& param_names, |
@@ -15746,14 +14862,12 @@ RawObject* Instance::Evaluate(const Class& method_cls, |
return DartEntry::InvokeFunction(eval_func, args); |
} |
- |
RawObject* Instance::HashCode() const { |
// TODO(koda): Optimize for all builtin classes and all classes |
// that do not override hashCode. |
return DartLibraryCalls::HashCode(*this); |
} |
- |
bool Instance::CanonicalizeEquals(const Instance& other) const { |
if (this->raw() == other.raw()) { |
return true; // "===". |
@@ -15786,7 +14900,6 @@ bool Instance::CanonicalizeEquals(const Instance& other) const { |
return true; |
} |
- |
uword Instance::ComputeCanonicalTableHash() const { |
ASSERT(!IsNull()); |
NoSafepointScope no_safepoint; |
@@ -15803,7 +14916,6 @@ uword Instance::ComputeCanonicalTableHash() const { |
return FinalizeHash(hash, (kBitsPerWord - 1)); |
} |
- |
#if defined(DEBUG) |
class CheckForPointers : public ObjectPointerVisitor { |
public: |
@@ -15825,7 +14937,6 @@ class CheckForPointers : public ObjectPointerVisitor { |
}; |
#endif // DEBUG |
- |
bool Instance::CheckAndCanonicalizeFields(Thread* thread, |
const char** error_str) const { |
if (GetClassId() >= kNumPredefinedCids) { |
@@ -15862,7 +14973,6 @@ bool Instance::CheckAndCanonicalizeFields(Thread* thread, |
return true; |
} |
- |
RawInstance* Instance::CheckAndCanonicalize(Thread* thread, |
const char** error_str) const { |
ASSERT(!IsNull()); |
@@ -15895,7 +15005,6 @@ RawInstance* Instance::CheckAndCanonicalize(Thread* thread, |
} |
} |
- |
#if defined(DEBUG) |
bool Instance::CheckIsCanonical(Thread* thread) const { |
Zone* zone = thread->zone(); |
@@ -15908,7 +15017,6 @@ bool Instance::CheckIsCanonical(Thread* thread) const { |
} |
#endif // DEBUG |
- |
RawAbstractType* Instance::GetType(Heap::Space space) const { |
if (IsNull()) { |
return Type::NullType(); |
@@ -15947,7 +15055,6 @@ RawAbstractType* Instance::GetType(Heap::Space space) const { |
return type.raw(); |
} |
- |
RawTypeArguments* Instance::GetTypeArguments() const { |
const Class& cls = Class::Handle(clazz()); |
intptr_t field_offset = cls.type_arguments_field_offset(); |
@@ -15957,7 +15064,6 @@ RawTypeArguments* Instance::GetTypeArguments() const { |
return type_arguments.raw(); |
} |
- |
void Instance::SetTypeArguments(const TypeArguments& value) const { |
ASSERT(value.IsNull() || value.IsCanonical()); |
const Class& cls = Class::Handle(clazz()); |
@@ -15966,7 +15072,6 @@ void Instance::SetTypeArguments(const TypeArguments& value) const { |
SetFieldAtOffset(field_offset, value); |
} |
- |
bool Instance::IsInstanceOf( |
const AbstractType& other, |
const TypeArguments& other_instantiator_type_arguments, |
@@ -16101,14 +15206,12 @@ bool Instance::IsInstanceOf( |
bound_error, NULL, Heap::kOld); |
} |
- |
bool Instance::OperatorEquals(const Instance& other) const { |
// TODO(koda): Optimize for all builtin classes and all classes |
// that do not override operator==. |
return DartLibraryCalls::Equals(*this, other) == Object::bool_true().raw(); |
} |
- |
bool Instance::IsIdenticalTo(const Instance& other) const { |
if (raw() == other.raw()) return true; |
if (IsInteger() && other.IsInteger()) { |
@@ -16121,7 +15224,6 @@ bool Instance::IsIdenticalTo(const Instance& other) const { |
return false; |
} |
- |
intptr_t* Instance::NativeFieldsDataAddr() const { |
ASSERT(Thread::Current()->no_safepoint_scope_depth() > 0); |
RawTypedData* native_fields = |
@@ -16132,7 +15234,6 @@ intptr_t* Instance::NativeFieldsDataAddr() const { |
return reinterpret_cast<intptr_t*>(native_fields->ptr()->data()); |
} |
- |
void Instance::SetNativeField(int index, intptr_t value) const { |
ASSERT(IsValidNativeIndex(index)); |
Object& native_fields = Object::Handle(*NativeFieldsAddr()); |
@@ -16145,7 +15246,6 @@ void Instance::SetNativeField(int index, intptr_t value) const { |
TypedData::Cast(native_fields).SetIntPtr(byte_offset, value); |
} |
- |
void Instance::SetNativeFields(uint16_t num_native_fields, |
const intptr_t* field_values) const { |
ASSERT(num_native_fields == NumNativeFields()); |
@@ -16162,7 +15262,6 @@ void Instance::SetNativeFields(uint16_t num_native_fields, |
} |
} |
- |
bool Instance::IsCallable(Function* function) const { |
Class& cls = Class::Handle(clazz()); |
if (cls.IsClosureClass()) { |
@@ -16186,7 +15285,6 @@ bool Instance::IsCallable(Function* function) const { |
return false; |
} |
- |
RawInstance* Instance::New(const Class& cls, Heap::Space space) { |
Thread* thread = Thread::Current(); |
if (cls.EnsureIsFinalized(thread) != Error::null()) { |
@@ -16198,7 +15296,6 @@ RawInstance* Instance::New(const Class& cls, Heap::Space space) { |
return reinterpret_cast<RawInstance*>(raw); |
} |
- |
bool Instance::IsValidFieldOffset(intptr_t offset) const { |
Thread* thread = Thread::Current(); |
REUSABLE_CLASS_HANDLESCOPE(thread); |
@@ -16207,7 +15304,6 @@ bool Instance::IsValidFieldOffset(intptr_t offset) const { |
return (offset >= 0 && offset <= (cls.instance_size() - kWordSize)); |
} |
- |
intptr_t Instance::ElementSizeFor(intptr_t cid) { |
if (RawObject::IsExternalTypedDataClassId(cid)) { |
return ExternalTypedData::ElementSizeInBytes(cid); |
@@ -16232,7 +15328,6 @@ intptr_t Instance::ElementSizeFor(intptr_t cid) { |
} |
} |
- |
intptr_t Instance::DataOffsetFor(intptr_t cid) { |
if (RawObject::IsExternalTypedDataClassId(cid) || |
RawObject::IsExternalStringClassId(cid)) { |
@@ -16256,7 +15351,6 @@ intptr_t Instance::DataOffsetFor(intptr_t cid) { |
} |
} |
- |
const char* Instance::ToCString() const { |
if (IsNull()) { |
return "null"; |
@@ -16289,55 +15383,47 @@ const char* Instance::ToCString() const { |
} |
} |
- |
bool AbstractType::IsResolved() const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
return false; |
} |
- |
void AbstractType::SetIsResolved() const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
} |
- |
bool AbstractType::HasResolvedTypeClass() const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
return false; |
} |
- |
classid_t AbstractType::type_class_id() const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
return kIllegalCid; |
} |
- |
RawClass* AbstractType::type_class() const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
return Class::null(); |
} |
- |
RawUnresolvedClass* AbstractType::unresolved_class() const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
return UnresolvedClass::null(); |
} |
- |
RawTypeArguments* AbstractType::arguments() const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
return NULL; |
} |
- |
void AbstractType::set_arguments(const TypeArguments& value) const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
@@ -16349,7 +15435,6 @@ TokenPosition AbstractType::token_pos() const { |
return TokenPosition::kNoSource; |
} |
- |
bool AbstractType::IsInstantiated(Genericity genericity, |
intptr_t num_free_fun_type_params, |
TrailPtr trail) const { |
@@ -16358,81 +15443,69 @@ bool AbstractType::IsInstantiated(Genericity genericity, |
return false; |
} |
- |
bool AbstractType::IsFinalized() const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
return false; |
} |
- |
void AbstractType::SetIsFinalized() const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
} |
- |
bool AbstractType::IsBeingFinalized() const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
return false; |
} |
- |
void AbstractType::SetIsBeingFinalized() const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
} |
- |
bool AbstractType::IsMalformed() const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
return false; |
} |
- |
bool AbstractType::IsMalbounded() const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
return false; |
} |
- |
bool AbstractType::IsMalformedOrMalbounded() const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
return false; |
} |
- |
RawLanguageError* AbstractType::error() const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
return LanguageError::null(); |
} |
- |
void AbstractType::set_error(const LanguageError& value) const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
} |
- |
bool AbstractType::IsEquivalent(const Instance& other, TrailPtr trail) const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
return false; |
} |
- |
bool AbstractType::IsRecursive() const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
return false; |
} |
- |
RawAbstractType* AbstractType::InstantiateFrom( |
const TypeArguments& instantiator_type_arguments, |
const TypeArguments& function_type_arguments, |
@@ -16445,14 +15518,12 @@ RawAbstractType* AbstractType::InstantiateFrom( |
return NULL; |
} |
- |
RawAbstractType* AbstractType::CloneUnfinalized() const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
return NULL; |
} |
- |
RawAbstractType* AbstractType::CloneUninstantiated(const Class& new_owner, |
TrailPtr trail) const { |
// AbstractType is an abstract class. |
@@ -16460,21 +15531,18 @@ RawAbstractType* AbstractType::CloneUninstantiated(const Class& new_owner, |
return NULL; |
} |
- |
RawAbstractType* AbstractType::Canonicalize(TrailPtr trail) const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
return NULL; |
} |
- |
RawString* AbstractType::EnumerateURIs() const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
return NULL; |
} |
- |
RawAbstractType* AbstractType::OnlyBuddyInTrail(TrailPtr trail) const { |
if (trail == NULL) { |
return AbstractType::null(); |
@@ -16492,7 +15560,6 @@ RawAbstractType* AbstractType::OnlyBuddyInTrail(TrailPtr trail) const { |
return AbstractType::null(); |
} |
- |
void AbstractType::AddOnlyBuddyToTrail(TrailPtr* trail, |
const AbstractType& buddy) const { |
if (*trail == NULL) { |
@@ -16504,7 +15571,6 @@ void AbstractType::AddOnlyBuddyToTrail(TrailPtr* trail, |
(*trail)->Add(buddy); |
} |
- |
bool AbstractType::TestAndAddToTrail(TrailPtr* trail) const { |
if (*trail == NULL) { |
*trail = new Trail(Thread::Current()->zone(), 4); |
@@ -16520,7 +15586,6 @@ bool AbstractType::TestAndAddToTrail(TrailPtr* trail) const { |
return false; |
} |
- |
bool AbstractType::TestAndAddBuddyToTrail(TrailPtr* trail, |
const AbstractType& buddy) const { |
if (*trail == NULL) { |
@@ -16547,7 +15612,6 @@ bool AbstractType::TestAndAddBuddyToTrail(TrailPtr* trail, |
return false; |
} |
- |
RawString* AbstractType::BuildName(NameVisibility name_visibility) const { |
ASSERT(name_visibility != kScrubbedName); |
Thread* thread = Thread::Current(); |
@@ -16669,7 +15733,6 @@ RawString* AbstractType::BuildName(NameVisibility name_visibility) const { |
return Symbols::FromConcatAll(thread, pieces); |
} |
- |
RawString* AbstractType::ClassName() const { |
ASSERT(!IsFunctionType()); |
if (HasResolvedTypeClass()) { |
@@ -16679,7 +15742,6 @@ RawString* AbstractType::ClassName() const { |
} |
} |
- |
bool AbstractType::IsDynamicType() const { |
if (IsCanonical()) { |
return raw() == Object::dynamic_type().raw(); |
@@ -16687,90 +15749,75 @@ bool AbstractType::IsDynamicType() const { |
return HasResolvedTypeClass() && (type_class() == Object::dynamic_class()); |
} |
- |
bool AbstractType::IsVoidType() const { |
return raw() == Object::void_type().raw(); |
} |
- |
bool AbstractType::IsNullType() const { |
return !IsFunctionType() && HasResolvedTypeClass() && |
(type_class() == Isolate::Current()->object_store()->null_class()); |
} |
- |
bool AbstractType::IsBoolType() const { |
return !IsFunctionType() && HasResolvedTypeClass() && |
(type_class() == Isolate::Current()->object_store()->bool_class()); |
} |
- |
bool AbstractType::IsIntType() const { |
return !IsFunctionType() && HasResolvedTypeClass() && |
(type_class() == Type::Handle(Type::IntType()).type_class()); |
} |
- |
bool AbstractType::IsInt64Type() const { |
return !IsFunctionType() && HasResolvedTypeClass() && |
(type_class() == Type::Handle(Type::Int64Type()).type_class()); |
} |
- |
bool AbstractType::IsDoubleType() const { |
return !IsFunctionType() && HasResolvedTypeClass() && |
(type_class() == Type::Handle(Type::Double()).type_class()); |
} |
- |
bool AbstractType::IsFloat32x4Type() const { |
return !IsFunctionType() && HasResolvedTypeClass() && |
(type_class() == Type::Handle(Type::Float32x4()).type_class()); |
} |
- |
bool AbstractType::IsFloat64x2Type() const { |
return !IsFunctionType() && HasResolvedTypeClass() && |
(type_class() == Type::Handle(Type::Float64x2()).type_class()); |
} |
- |
bool AbstractType::IsInt32x4Type() const { |
return !IsFunctionType() && HasResolvedTypeClass() && |
(type_class() == Type::Handle(Type::Int32x4()).type_class()); |
} |
- |
bool AbstractType::IsNumberType() const { |
return !IsFunctionType() && HasResolvedTypeClass() && |
(type_class() == Type::Handle(Type::Number()).type_class()); |
} |
- |
bool AbstractType::IsSmiType() const { |
return !IsFunctionType() && HasResolvedTypeClass() && |
(type_class() == Type::Handle(Type::SmiType()).type_class()); |
} |
- |
bool AbstractType::IsStringType() const { |
return !IsFunctionType() && HasResolvedTypeClass() && |
(type_class() == Type::Handle(Type::StringType()).type_class()); |
} |
- |
bool AbstractType::IsDartFunctionType() const { |
return !IsFunctionType() && HasResolvedTypeClass() && |
(type_class() == Type::Handle(Type::DartFunctionType()).type_class()); |
} |
- |
bool AbstractType::IsDartClosureType() const { |
return !IsFunctionType() && HasResolvedTypeClass() && |
(type_class() == Isolate::Current()->object_store()->closure_class()); |
} |
- |
bool AbstractType::TypeTest(TypeTestKind test_kind, |
const AbstractType& other, |
Error* bound_error, |
@@ -16941,14 +15988,12 @@ bool AbstractType::TypeTest(TypeTestKind test_kind, |
bound_error, bound_trail, space); |
} |
- |
intptr_t AbstractType::Hash() const { |
// AbstractType is an abstract class. |
UNREACHABLE(); |
return 0; |
} |
- |
const char* AbstractType::ToCString() const { |
if (IsNull()) { |
return "AbstractType: null"; |
@@ -16958,92 +16003,74 @@ const char* AbstractType::ToCString() const { |
return "AbstractType"; |
} |
- |
RawType* Type::NullType() { |
return Isolate::Current()->object_store()->null_type(); |
} |
- |
RawType* Type::DynamicType() { |
return Object::dynamic_type().raw(); |
} |
- |
RawType* Type::VoidType() { |
return Object::void_type().raw(); |
} |
- |
RawType* Type::ObjectType() { |
return Isolate::Current()->object_store()->object_type(); |
} |
- |
RawType* Type::BoolType() { |
return Isolate::Current()->object_store()->bool_type(); |
} |
- |
RawType* Type::IntType() { |
return Isolate::Current()->object_store()->int_type(); |
} |
- |
RawType* Type::Int64Type() { |
return Isolate::Current()->object_store()->int64_type(); |
} |
- |
RawType* Type::SmiType() { |
return Isolate::Current()->object_store()->smi_type(); |
} |
- |
RawType* Type::MintType() { |
return Isolate::Current()->object_store()->mint_type(); |
} |
- |
RawType* Type::Double() { |
return Isolate::Current()->object_store()->double_type(); |
} |
- |
RawType* Type::Float32x4() { |
return Isolate::Current()->object_store()->float32x4_type(); |
} |
- |
RawType* Type::Float64x2() { |
return Isolate::Current()->object_store()->float64x2_type(); |
} |
- |
RawType* Type::Int32x4() { |
return Isolate::Current()->object_store()->int32x4_type(); |
} |
- |
RawType* Type::Number() { |
return Isolate::Current()->object_store()->number_type(); |
} |
- |
RawType* Type::StringType() { |
return Isolate::Current()->object_store()->string_type(); |
} |
- |
RawType* Type::ArrayType() { |
return Isolate::Current()->object_store()->array_type(); |
} |
- |
RawType* Type::DartFunctionType() { |
return Isolate::Current()->object_store()->function_type(); |
} |
- |
RawType* Type::NewNonParameterizedType(const Class& type_class) { |
ASSERT(type_class.NumTypeArguments() == 0); |
Type& type = Type::Handle(type_class.CanonicalType()); |
@@ -17057,7 +16084,6 @@ RawType* Type::NewNonParameterizedType(const Class& type_class) { |
return type.raw(); |
} |
- |
void Type::SetIsFinalized() const { |
ASSERT(!IsFinalized()); |
if (IsInstantiated()) { |
@@ -17068,20 +16094,17 @@ void Type::SetIsFinalized() const { |
} |
} |
- |
void Type::ResetIsFinalized() const { |
ASSERT(IsFinalized()); |
set_type_state(RawType::kBeingFinalized); |
SetIsFinalized(); |
} |
- |
void Type::SetIsBeingFinalized() const { |
ASSERT(IsResolved() && !IsFinalized() && !IsBeingFinalized()); |
set_type_state(RawType::kBeingFinalized); |
} |
- |
bool Type::IsMalformed() const { |
if (raw_ptr()->sig_or_err_.error_ == LanguageError::null()) { |
return false; // Valid type, but not a function type. |
@@ -17094,7 +16117,6 @@ bool Type::IsMalformed() const { |
return type_error.kind() == Report::kMalformedType; |
} |
- |
bool Type::IsMalbounded() const { |
if (raw_ptr()->sig_or_err_.error_ == LanguageError::null()) { |
return false; // Valid type, but not a function type. |
@@ -17110,7 +16132,6 @@ bool Type::IsMalbounded() const { |
return type_error.kind() == Report::kMalboundedType; |
} |
- |
bool Type::IsMalformedOrMalbounded() const { |
if (raw_ptr()->sig_or_err_.error_ == LanguageError::null()) { |
return false; // Valid type, but not a function type. |
@@ -17126,7 +16147,6 @@ bool Type::IsMalformedOrMalbounded() const { |
return Isolate::Current()->type_checks(); |
} |
- |
RawLanguageError* Type::error() const { |
if (raw_ptr()->sig_or_err_.error_->IsLanguageError()) { |
return LanguageError::RawCast(raw_ptr()->sig_or_err_.error_); |
@@ -17134,12 +16154,10 @@ RawLanguageError* Type::error() const { |
return LanguageError::null(); |
} |
- |
void Type::set_error(const LanguageError& value) const { |
StorePointer(&raw_ptr()->sig_or_err_.error_, value.raw()); |
} |
- |
RawFunction* Type::signature() const { |
intptr_t cid = raw_ptr()->sig_or_err_.signature_->GetClassId(); |
if (cid == kNullCid) { |
@@ -17152,34 +16170,28 @@ RawFunction* Type::signature() const { |
return Function::null(); |
} |
- |
void Type::set_signature(const Function& value) const { |
StorePointer(&raw_ptr()->sig_or_err_.signature_, value.raw()); |
} |
- |
void Type::SetIsResolved() const { |
ASSERT(!IsResolved()); |
set_type_state(RawType::kResolved); |
} |
- |
bool Type::HasResolvedTypeClass() const { |
return !raw_ptr()->type_class_id_->IsHeapObject(); |
} |
- |
classid_t Type::type_class_id() const { |
ASSERT(HasResolvedTypeClass()); |
return Smi::Value(reinterpret_cast<RawSmi*>(raw_ptr()->type_class_id_)); |
} |
- |
RawClass* Type::type_class() const { |
return Isolate::Current()->class_table()->At(type_class_id()); |
} |
- |
RawUnresolvedClass* Type::unresolved_class() const { |
#ifdef DEBUG |
ASSERT(!HasResolvedTypeClass()); |
@@ -17194,7 +16206,6 @@ RawUnresolvedClass* Type::unresolved_class() const { |
#endif |
} |
- |
bool Type::IsInstantiated(Genericity genericity, |
intptr_t num_free_fun_type_params, |
TrailPtr trail) const { |
@@ -17242,7 +16253,6 @@ bool Type::IsInstantiated(Genericity genericity, |
num_free_fun_type_params, trail); |
} |
- |
RawAbstractType* Type::InstantiateFrom( |
const TypeArguments& instantiator_type_arguments, |
const TypeArguments& function_type_arguments, |
@@ -17313,7 +16323,6 @@ RawAbstractType* Type::InstantiateFrom( |
return instantiated_type.raw(); |
} |
- |
bool Type::IsEquivalent(const Instance& other, TrailPtr trail) const { |
ASSERT(!IsNull()); |
if (raw() == other.raw()) { |
@@ -17477,12 +16486,10 @@ bool Type::IsEquivalent(const Instance& other, TrailPtr trail) const { |
return true; |
} |
- |
bool Type::IsRecursive() const { |
return TypeArguments::Handle(arguments()).IsRecursive(); |
} |
- |
RawAbstractType* Type::CloneUnfinalized() const { |
ASSERT(IsResolved()); |
if (IsFinalized()) { |
@@ -17549,7 +16556,6 @@ RawAbstractType* Type::CloneUnfinalized() const { |
return clone.raw(); |
} |
- |
RawAbstractType* Type::CloneUninstantiated(const Class& new_owner, |
TrailPtr trail) const { |
ASSERT(IsFinalized()); |
@@ -17629,7 +16635,6 @@ RawAbstractType* Type::CloneUninstantiated(const Class& new_owner, |
return clone.raw(); |
} |
- |
RawAbstractType* Type::Canonicalize(TrailPtr trail) const { |
ASSERT(IsFinalized()); |
if (IsCanonical() || IsMalformed()) { |
@@ -17759,7 +16764,6 @@ RawAbstractType* Type::Canonicalize(TrailPtr trail) const { |
return type.raw(); |
} |
- |
#if defined(DEBUG) |
bool Type::CheckIsCanonical(Thread* thread) const { |
if (IsMalformed()) { |
@@ -17791,7 +16795,6 @@ bool Type::CheckIsCanonical(Thread* thread) const { |
} |
#endif // DEBUG |
- |
RawString* Type::EnumerateURIs() const { |
if (IsDynamicType() || IsVoidType()) { |
return Symbols::Empty().raw(); |
@@ -17828,7 +16831,6 @@ RawString* Type::EnumerateURIs() const { |
return Symbols::FromConcatAll(thread, pieces); |
} |
- |
intptr_t Type::ComputeHash() const { |
ASSERT(IsFinalized()); |
uint32_t result = 1; |
@@ -17858,33 +16860,28 @@ intptr_t Type::ComputeHash() const { |
return result; |
} |
- |
void Type::set_type_class(const Class& value) const { |
ASSERT(!value.IsNull()); |
StorePointer(&raw_ptr()->type_class_id_, |
reinterpret_cast<RawObject*>(Smi::New(value.id()))); |
} |
- |
void Type::set_unresolved_class(const Object& value) const { |
ASSERT(!value.IsNull() && value.IsUnresolvedClass()); |
StorePointer(&raw_ptr()->type_class_id_, value.raw()); |
} |
- |
void Type::set_arguments(const TypeArguments& value) const { |
ASSERT(!IsCanonical()); |
StorePointer(&raw_ptr()->arguments_, value.raw()); |
} |
- |
RawType* Type::New(Heap::Space space) { |
RawObject* raw = |
Object::Allocate(Type::kClassId, Type::InstanceSize(), space); |
return reinterpret_cast<RawType*>(raw); |
} |
- |
RawType* Type::New(const Object& clazz, |
const TypeArguments& arguments, |
TokenPosition token_pos, |
@@ -17902,20 +16899,17 @@ RawType* Type::New(const Object& clazz, |
return result.raw(); |
} |
- |
void Type::set_token_pos(TokenPosition token_pos) const { |
ASSERT(!token_pos.IsClassifying()); |
StoreNonPointer(&raw_ptr()->token_pos_, token_pos); |
} |
- |
void Type::set_type_state(int8_t state) const { |
ASSERT((state >= RawType::kAllocated) && |
(state <= RawType::kFinalizedUninstantiated)); |
StoreNonPointer(&raw_ptr()->type_state_, state); |
} |
- |
const char* Type::ToCString() const { |
if (IsNull()) { |
return "Type: null"; |
@@ -17955,7 +16949,6 @@ const char* Type::ToCString() const { |
} |
} |
- |
bool TypeRef::IsInstantiated(Genericity genericity, |
intptr_t num_free_fun_type_params, |
TrailPtr trail) const { |
@@ -17967,7 +16960,6 @@ bool TypeRef::IsInstantiated(Genericity genericity, |
ref_type.IsInstantiated(genericity, num_free_fun_type_params, trail); |
} |
- |
bool TypeRef::IsEquivalent(const Instance& other, TrailPtr trail) const { |
if (raw() == other.raw()) { |
return true; |
@@ -17982,7 +16974,6 @@ bool TypeRef::IsEquivalent(const Instance& other, TrailPtr trail) const { |
return !ref_type.IsNull() && ref_type.IsEquivalent(other, trail); |
} |
- |
RawTypeRef* TypeRef::InstantiateFrom( |
const TypeArguments& instantiator_type_arguments, |
const TypeArguments& function_type_arguments, |
@@ -18009,7 +17000,6 @@ RawTypeRef* TypeRef::InstantiateFrom( |
return instantiated_type_ref.raw(); |
} |
- |
RawTypeRef* TypeRef::CloneUninstantiated(const Class& new_owner, |
TrailPtr trail) const { |
TypeRef& cloned_type_ref = TypeRef::Handle(); |
@@ -18028,14 +17018,12 @@ RawTypeRef* TypeRef::CloneUninstantiated(const Class& new_owner, |
return cloned_type_ref.raw(); |
} |
- |
void TypeRef::set_type(const AbstractType& value) const { |
ASSERT(value.IsFunctionType() || value.HasResolvedTypeClass()); |
ASSERT(!value.IsTypeRef()); |
StorePointer(&raw_ptr()->type_, value.raw()); |
} |
- |
// A TypeRef cannot be canonical by definition. Only its referenced type can be. |
// Consider the type Derived, where class Derived extends Base<Derived>. |
// The first type argument of its flattened type argument vector is Derived, |
@@ -18053,7 +17041,6 @@ RawAbstractType* TypeRef::Canonicalize(TrailPtr trail) const { |
return raw(); |
} |
- |
#if defined(DEBUG) |
bool TypeRef::CheckIsCanonical(Thread* thread) const { |
AbstractType& ref_type = AbstractType::Handle(type()); |
@@ -18062,7 +17049,6 @@ bool TypeRef::CheckIsCanonical(Thread* thread) const { |
} |
#endif // DEBUG |
- |
RawString* TypeRef::EnumerateURIs() const { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -18081,7 +17067,6 @@ RawString* TypeRef::EnumerateURIs() const { |
return Symbols::FromConcatAll(thread, pieces); |
} |
- |
intptr_t TypeRef::Hash() const { |
// Do not calculate the hash of the referenced type to avoid divergence. |
const AbstractType& ref_type = AbstractType::Handle(type()); |
@@ -18090,21 +17075,18 @@ intptr_t TypeRef::Hash() const { |
return FinalizeHash(result, kHashBits); |
} |
- |
RawTypeRef* TypeRef::New() { |
RawObject* raw = |
Object::Allocate(TypeRef::kClassId, TypeRef::InstanceSize(), Heap::kOld); |
return reinterpret_cast<RawTypeRef*>(raw); |
} |
- |
RawTypeRef* TypeRef::New(const AbstractType& type) { |
const TypeRef& result = TypeRef::Handle(TypeRef::New()); |
result.set_type(type); |
return result.raw(); |
} |
- |
const char* TypeRef::ToCString() const { |
AbstractType& ref_type = AbstractType::Handle(type()); |
if (ref_type.IsNull()) { |
@@ -18123,13 +17105,11 @@ const char* TypeRef::ToCString() const { |
} |
} |
- |
void TypeParameter::SetIsFinalized() const { |
ASSERT(!IsFinalized()); |
set_type_state(RawTypeParameter::kFinalizedUninstantiated); |
} |
- |
bool TypeParameter::IsInstantiated(Genericity genericity, |
intptr_t num_free_fun_type_params, |
TrailPtr trail) const { |
@@ -18141,7 +17121,6 @@ bool TypeParameter::IsInstantiated(Genericity genericity, |
return (genericity == kCurrentClass) || (index() >= num_free_fun_type_params); |
} |
- |
bool TypeParameter::IsEquivalent(const Instance& other, TrailPtr trail) const { |
if (raw() == other.raw()) { |
return true; |
@@ -18170,7 +17149,6 @@ bool TypeParameter::IsEquivalent(const Instance& other, TrailPtr trail) const { |
return name() == other_type_param.name(); |
} |
- |
void TypeParameter::set_parameterized_class(const Class& value) const { |
// Set value may be null. |
classid_t cid = kFunctionCid; // Denotes a function type parameter. |
@@ -18180,12 +17158,10 @@ void TypeParameter::set_parameterized_class(const Class& value) const { |
StoreNonPointer(&raw_ptr()->parameterized_class_id_, cid); |
} |
- |
classid_t TypeParameter::parameterized_class_id() const { |
return raw_ptr()->parameterized_class_id_; |
} |
- |
RawClass* TypeParameter::parameterized_class() const { |
classid_t cid = parameterized_class_id(); |
if (cid == kFunctionCid) { |
@@ -18194,30 +17170,25 @@ RawClass* TypeParameter::parameterized_class() const { |
return Isolate::Current()->class_table()->At(cid); |
} |
- |
void TypeParameter::set_parameterized_function(const Function& value) const { |
StorePointer(&raw_ptr()->parameterized_function_, value.raw()); |
} |
- |
void TypeParameter::set_index(intptr_t value) const { |
ASSERT(value >= 0); |
ASSERT(Utils::IsInt(16, value)); |
StoreNonPointer(&raw_ptr()->index_, value); |
} |
- |
void TypeParameter::set_name(const String& value) const { |
ASSERT(value.IsSymbol()); |
StorePointer(&raw_ptr()->name_, value.raw()); |
} |
- |
void TypeParameter::set_bound(const AbstractType& value) const { |
StorePointer(&raw_ptr()->bound_, value.raw()); |
} |
- |
RawAbstractType* TypeParameter::InstantiateFrom( |
const TypeArguments& instantiator_type_arguments, |
const TypeArguments& function_type_arguments, |
@@ -18261,7 +17232,6 @@ RawAbstractType* TypeParameter::InstantiateFrom( |
// prolog). |
} |
- |
bool TypeParameter::CheckBound(const AbstractType& bounded_type, |
const AbstractType& upper_bound, |
Error* bound_error, |
@@ -18324,7 +17294,6 @@ bool TypeParameter::CheckBound(const AbstractType& bounded_type, |
return false; |
} |
- |
RawAbstractType* TypeParameter::CloneUnfinalized() const { |
if (IsFinalized()) { |
return raw(); |
@@ -18336,7 +17305,6 @@ RawAbstractType* TypeParameter::CloneUnfinalized() const { |
AbstractType::Handle(bound()), token_pos()); |
} |
- |
RawAbstractType* TypeParameter::CloneUninstantiated(const Class& new_owner, |
TrailPtr trail) const { |
ASSERT(IsFinalized()); |
@@ -18369,7 +17337,6 @@ RawAbstractType* TypeParameter::CloneUninstantiated(const Class& new_owner, |
return clone.raw(); |
} |
- |
RawString* TypeParameter::EnumerateURIs() const { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -18395,7 +17362,6 @@ RawString* TypeParameter::EnumerateURIs() const { |
return Symbols::FromConcatAll(thread, pieces); |
} |
- |
intptr_t TypeParameter::ComputeHash() const { |
ASSERT(IsFinalized()); |
uint32_t result; |
@@ -18412,14 +17378,12 @@ intptr_t TypeParameter::ComputeHash() const { |
return result; |
} |
- |
RawTypeParameter* TypeParameter::New() { |
RawObject* raw = Object::Allocate(TypeParameter::kClassId, |
TypeParameter::InstanceSize(), Heap::kOld); |
return reinterpret_cast<RawTypeParameter*>(raw); |
} |
- |
RawTypeParameter* TypeParameter::New(const Class& parameterized_class, |
const Function& parameterized_function, |
intptr_t index, |
@@ -18440,13 +17404,11 @@ RawTypeParameter* TypeParameter::New(const Class& parameterized_class, |
return result.raw(); |
} |
- |
void TypeParameter::set_token_pos(TokenPosition token_pos) const { |
ASSERT(!token_pos.IsClassifying()); |
StoreNonPointer(&raw_ptr()->token_pos_, token_pos); |
} |
- |
void TypeParameter::set_type_state(int8_t state) const { |
ASSERT((state == RawTypeParameter::kAllocated) || |
(state == RawTypeParameter::kBeingFinalized) || |
@@ -18454,7 +17416,6 @@ void TypeParameter::set_type_state(int8_t state) const { |
StoreNonPointer(&raw_ptr()->type_state_, state); |
} |
- |
const char* TypeParameter::ToCString() const { |
const char* name_cstr = String::Handle(Name()).ToCString(); |
const AbstractType& upper_bound = AbstractType::Handle(bound()); |
@@ -18485,27 +17446,22 @@ const char* TypeParameter::ToCString() const { |
} |
} |
- |
bool BoundedType::IsMalformed() const { |
return AbstractType::Handle(type()).IsMalformed(); |
} |
- |
bool BoundedType::IsMalbounded() const { |
return AbstractType::Handle(type()).IsMalbounded(); |
} |
- |
bool BoundedType::IsMalformedOrMalbounded() const { |
return AbstractType::Handle(type()).IsMalformedOrMalbounded(); |
} |
- |
RawLanguageError* BoundedType::error() const { |
return AbstractType::Handle(type()).error(); |
} |
- |
bool BoundedType::IsEquivalent(const Instance& other, TrailPtr trail) const { |
// BoundedType are not canonicalized, because their bound may get finalized |
// after the BoundedType is created and initialized. |
@@ -18537,12 +17493,10 @@ bool BoundedType::IsEquivalent(const Instance& other, TrailPtr trail) const { |
this_bound.Equals(other_bound); // Different graph, do not pass trail. |
} |
- |
bool BoundedType::IsRecursive() const { |
return AbstractType::Handle(type()).IsRecursive(); |
} |
- |
void BoundedType::set_type(const AbstractType& value) const { |
ASSERT(value.IsFinalized() || value.IsBeingFinalized() || |
value.IsTypeParameter()); |
@@ -18550,7 +17504,6 @@ void BoundedType::set_type(const AbstractType& value) const { |
StorePointer(&raw_ptr()->type_, value.raw()); |
} |
- |
void BoundedType::set_bound(const AbstractType& value) const { |
// The bound may still be unfinalized because of legal cycles. |
// It must be finalized before it is checked at run time, though. |
@@ -18558,7 +17511,6 @@ void BoundedType::set_bound(const AbstractType& value) const { |
StorePointer(&raw_ptr()->bound_, value.raw()); |
} |
- |
void BoundedType::set_type_parameter(const TypeParameter& value) const { |
// A null type parameter is set when marking a type malformed because of a |
// bound error at compile time. |
@@ -18566,7 +17518,6 @@ void BoundedType::set_type_parameter(const TypeParameter& value) const { |
StorePointer(&raw_ptr()->type_parameter_, value.raw()); |
} |
- |
RawAbstractType* BoundedType::InstantiateFrom( |
const TypeArguments& instantiator_type_arguments, |
const TypeArguments& function_type_arguments, |
@@ -18641,7 +17592,6 @@ RawAbstractType* BoundedType::InstantiateFrom( |
return instantiated_bounded_type.raw(); |
} |
- |
RawAbstractType* BoundedType::CloneUnfinalized() const { |
if (IsFinalized()) { |
return raw(); |
@@ -18658,7 +17608,6 @@ RawAbstractType* BoundedType::CloneUnfinalized() const { |
TypeParameter::Handle(type_parameter())); |
} |
- |
RawAbstractType* BoundedType::CloneUninstantiated(const Class& new_owner, |
TrailPtr trail) const { |
if (IsInstantiated()) { |
@@ -18673,13 +17622,11 @@ RawAbstractType* BoundedType::CloneUninstantiated(const Class& new_owner, |
return BoundedType::New(bounded_type, upper_bound, type_param); |
} |
- |
RawString* BoundedType::EnumerateURIs() const { |
// The bound does not appear in the user visible name. |
return AbstractType::Handle(type()).EnumerateURIs(); |
} |
- |
intptr_t BoundedType::ComputeHash() const { |
uint32_t result = AbstractType::Handle(type()).Hash(); |
// No need to include the hash of the bound, since the bound is defined by the |
@@ -18691,14 +17638,12 @@ intptr_t BoundedType::ComputeHash() const { |
return result; |
} |
- |
RawBoundedType* BoundedType::New() { |
RawObject* raw = Object::Allocate(BoundedType::kClassId, |
BoundedType::InstanceSize(), Heap::kOld); |
return reinterpret_cast<RawBoundedType*>(raw); |
} |
- |
RawBoundedType* BoundedType::New(const AbstractType& type, |
const AbstractType& bound, |
const TypeParameter& type_parameter) { |
@@ -18710,7 +17655,6 @@ RawBoundedType* BoundedType::New(const AbstractType& type, |
return result.raw(); |
} |
- |
const char* BoundedType::ToCString() const { |
const char* format = "BoundedType: type %s; bound: %s; type param: %s of %s"; |
const char* type_cstr = |
@@ -18730,22 +17674,18 @@ const char* BoundedType::ToCString() const { |
return chars; |
} |
- |
TokenPosition MixinAppType::token_pos() const { |
return AbstractType::Handle(MixinTypeAt(0)).token_pos(); |
} |
- |
intptr_t MixinAppType::Depth() const { |
return Array::Handle(mixin_types()).Length(); |
} |
- |
RawString* MixinAppType::Name() const { |
return String::New("MixinAppType"); |
} |
- |
const char* MixinAppType::ToCString() const { |
const char* format = "MixinAppType: super type: %s; first mixin type: %s"; |
const char* super_type_cstr = |
@@ -18759,22 +17699,18 @@ const char* MixinAppType::ToCString() const { |
return chars; |
} |
- |
RawAbstractType* MixinAppType::MixinTypeAt(intptr_t depth) const { |
return AbstractType::RawCast(Array::Handle(mixin_types()).At(depth)); |
} |
- |
void MixinAppType::set_super_type(const AbstractType& value) const { |
StorePointer(&raw_ptr()->super_type_, value.raw()); |
} |
- |
void MixinAppType::set_mixin_types(const Array& value) const { |
StorePointer(&raw_ptr()->mixin_types_, value.raw()); |
} |
- |
RawMixinAppType* MixinAppType::New() { |
// MixinAppType objects do not survive finalization, so allocate |
// on new heap. |
@@ -18783,7 +17719,6 @@ RawMixinAppType* MixinAppType::New() { |
return reinterpret_cast<RawMixinAppType*>(raw); |
} |
- |
RawMixinAppType* MixinAppType::New(const AbstractType& super_type, |
const Array& mixin_types) { |
const MixinAppType& result = MixinAppType::Handle(MixinAppType::New()); |
@@ -18792,7 +17727,6 @@ RawMixinAppType* MixinAppType::New(const AbstractType& super_type, |
return result.raw(); |
} |
- |
RawInstance* Number::CheckAndCanonicalize(Thread* thread, |
const char** error_str) const { |
intptr_t cid = GetClassId(); |
@@ -18847,7 +17781,6 @@ RawInstance* Number::CheckAndCanonicalize(Thread* thread, |
return Instance::null(); |
} |
- |
#if defined(DEBUG) |
bool Number::CheckIsCanonical(Thread* thread) const { |
intptr_t cid = GetClassId(); |
@@ -18879,21 +17812,18 @@ bool Number::CheckIsCanonical(Thread* thread) const { |
} |
#endif // DEBUG |
- |
const char* Number::ToCString() const { |
// Number is an interface. No instances of Number should exist. |
UNREACHABLE(); |
return "Number"; |
} |
- |
const char* Integer::ToCString() const { |
// Integer is an interface. No instances of Integer should exist except null. |
ASSERT(IsNull()); |
return "NULL Integer"; |
} |
- |
RawInteger* Integer::New(const String& str, Heap::Space space) { |
// We are not supposed to have integers represented as two byte strings. |
ASSERT(str.IsOneByteString()); |
@@ -18912,7 +17842,6 @@ RawInteger* Integer::New(const String& str, Heap::Space space) { |
return Integer::New(value, space); |
} |
- |
RawInteger* Integer::NewCanonical(const String& str) { |
// We are not supposed to have integers represented as two byte strings. |
ASSERT(str.IsOneByteString()); |
@@ -18933,7 +17862,6 @@ RawInteger* Integer::NewCanonical(const String& str) { |
return Mint::NewCanonical(value); |
} |
- |
RawInteger* Integer::New(int64_t value, Heap::Space space) { |
const bool is_smi = Smi::IsValid(value); |
if (is_smi) { |
@@ -18942,7 +17870,6 @@ RawInteger* Integer::New(int64_t value, Heap::Space space) { |
return Mint::New(value, space); |
} |
- |
RawInteger* Integer::NewFromUint64(uint64_t value, Heap::Space space) { |
if (value > static_cast<uint64_t>(Mint::kMaxValue)) { |
if (FLAG_limit_ints_to_64_bits) { |
@@ -18956,63 +17883,54 @@ RawInteger* Integer::NewFromUint64(uint64_t value, Heap::Space space) { |
} |
} |
- |
bool Integer::Equals(const Instance& other) const { |
// Integer is an abstract class. |
UNREACHABLE(); |
return false; |
} |
- |
bool Integer::IsZero() const { |
// Integer is an abstract class. |
UNREACHABLE(); |
return false; |
} |
- |
bool Integer::IsNegative() const { |
// Integer is an abstract class. |
UNREACHABLE(); |
return false; |
} |
- |
double Integer::AsDoubleValue() const { |
// Integer is an abstract class. |
UNREACHABLE(); |
return 0.0; |
} |
- |
int64_t Integer::AsInt64Value() const { |
// Integer is an abstract class. |
UNREACHABLE(); |
return 0; |
} |
- |
uint32_t Integer::AsTruncatedUint32Value() const { |
// Integer is an abstract class. |
UNREACHABLE(); |
return 0; |
} |
- |
bool Integer::FitsIntoSmi() const { |
// Integer is an abstract class. |
UNREACHABLE(); |
return false; |
} |
- |
int Integer::CompareWith(const Integer& other) const { |
// Integer is an abstract class. |
UNREACHABLE(); |
return 0; |
} |
- |
RawInteger* Integer::AsValidInteger() const { |
if (IsSmi()) return raw(); |
if (IsMint()) { |
@@ -19036,7 +17954,6 @@ RawInteger* Integer::AsValidInteger() const { |
return raw(); |
} |
- |
RawInteger* Integer::ArithmeticOp(Token::Kind operation, |
const Integer& other, |
Heap::Space space) const { |
@@ -19162,12 +18079,10 @@ RawInteger* Integer::ArithmeticOp(Token::Kind operation, |
return Integer::null(); // Notify caller that a bigint operation is required. |
} |
- |
static bool Are64bitOperands(const Integer& op1, const Integer& op2) { |
return !op1.IsBigint() && !op2.IsBigint(); |
} |
- |
RawInteger* Integer::BitOp(Token::Kind kind, |
const Integer& other, |
Heap::Space space) const { |
@@ -19208,7 +18123,6 @@ RawInteger* Integer::BitOp(Token::Kind kind, |
return Integer::null(); // Notify caller that a bigint operation is required. |
} |
- |
// TODO(srdjan): Clarify handling of negative right operand in a shift op. |
RawInteger* Smi::ShiftOp(Token::Kind kind, |
const Smi& other, |
@@ -19255,7 +18169,6 @@ RawInteger* Smi::ShiftOp(Token::Kind kind, |
return Smi::New(result); |
} |
- |
bool Smi::Equals(const Instance& other) const { |
if (other.IsNull() || !other.IsSmi()) { |
return false; |
@@ -19263,22 +18176,18 @@ bool Smi::Equals(const Instance& other) const { |
return (this->Value() == Smi::Cast(other).Value()); |
} |
- |
double Smi::AsDoubleValue() const { |
return static_cast<double>(this->Value()); |
} |
- |
int64_t Smi::AsInt64Value() const { |
return this->Value(); |
} |
- |
uint32_t Smi::AsTruncatedUint32Value() const { |
return this->Value() & 0xFFFFFFFF; |
} |
- |
int Smi::CompareWith(const Integer& other) const { |
if (other.IsSmi()) { |
const Smi& other_smi = Smi::Cast(other); |
@@ -19301,22 +18210,18 @@ int Smi::CompareWith(const Integer& other) const { |
return 0; |
} |
- |
const char* Smi::ToCString() const { |
return OS::SCreate(Thread::Current()->zone(), "%" Pd "", Value()); |
} |
- |
RawClass* Smi::Class() { |
return Isolate::Current()->object_store()->smi_class(); |
} |
- |
void Mint::set_value(int64_t value) const { |
StoreNonPointer(&raw_ptr()->value_, value); |
} |
- |
RawMint* Mint::New(int64_t val, Heap::Space space) { |
// Do not allocate a Mint if Smi would do. |
ASSERT(!Smi::IsValid(val)); |
@@ -19332,7 +18237,6 @@ RawMint* Mint::New(int64_t val, Heap::Space space) { |
return result.raw(); |
} |
- |
RawMint* Mint::NewCanonical(int64_t value) { |
// Do not allocate a Mint if Smi would do. |
ASSERT(!Smi::IsValid(value)); |
@@ -19364,7 +18268,6 @@ RawMint* Mint::NewCanonical(int64_t value) { |
} |
} |
- |
bool Mint::Equals(const Instance& other) const { |
if (this->raw() == other.raw()) { |
// Both handles point to the same raw instance. |
@@ -19376,27 +18279,22 @@ bool Mint::Equals(const Instance& other) const { |
return value() == Mint::Cast(other).value(); |
} |
- |
double Mint::AsDoubleValue() const { |
return static_cast<double>(this->value()); |
} |
- |
int64_t Mint::AsInt64Value() const { |
return this->value(); |
} |
- |
uint32_t Mint::AsTruncatedUint32Value() const { |
return this->value() & 0xFFFFFFFF; |
} |
- |
bool Mint::FitsIntoSmi() const { |
return Smi::IsValid(AsInt64Value()); |
} |
- |
int Mint::CompareWith(const Integer& other) const { |
ASSERT(!FitsIntoSmi()); |
if (other.IsMint() || other.IsSmi()) { |
@@ -19418,17 +18316,14 @@ int Mint::CompareWith(const Integer& other) const { |
return this->IsNegative() ? -1 : 1; |
} |
- |
const char* Mint::ToCString() const { |
return OS::SCreate(Thread::Current()->zone(), "%" Pd64 "", value()); |
} |
- |
void Double::set_value(double value) const { |
StoreNonPointer(&raw_ptr()->value_, value); |
} |
- |
bool Double::BitwiseEqualsToDouble(double value) const { |
intptr_t value_offset = Double::value_offset(); |
void* this_addr = reinterpret_cast<void*>( |
@@ -19437,7 +18332,6 @@ bool Double::BitwiseEqualsToDouble(double value) const { |
return (memcmp(this_addr, other_addr, sizeof(value)) == 0); |
} |
- |
bool Double::OperatorEquals(const Instance& other) const { |
if (this->IsNull() || other.IsNull()) { |
return (this->IsNull() && other.IsNull()); |
@@ -19448,7 +18342,6 @@ bool Double::OperatorEquals(const Instance& other) const { |
return this->value() == Double::Cast(other).value(); |
} |
- |
bool Double::CanonicalizeEquals(const Instance& other) const { |
if (this->raw() == other.raw()) { |
return true; // "===". |
@@ -19459,7 +18352,6 @@ bool Double::CanonicalizeEquals(const Instance& other) const { |
return BitwiseEqualsToDouble(Double::Cast(other).value()); |
} |
- |
RawDouble* Double::New(double d, Heap::Space space) { |
ASSERT(Isolate::Current()->object_store()->double_class() != Class::null()); |
Double& result = Double::Handle(); |
@@ -19473,7 +18365,6 @@ RawDouble* Double::New(double d, Heap::Space space) { |
return result.raw(); |
} |
- |
RawDouble* Double::New(const String& str, Heap::Space space) { |
double double_value; |
if (!CStringToDouble(str.ToCString(), str.Length(), &double_value)) { |
@@ -19482,7 +18373,6 @@ RawDouble* Double::New(const String& str, Heap::Space space) { |
return New(double_value, space); |
} |
- |
RawDouble* Double::NewCanonical(double value) { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -19515,7 +18405,6 @@ RawDouble* Double::NewCanonical(double value) { |
} |
} |
- |
RawDouble* Double::NewCanonical(const String& str) { |
double double_value; |
if (!CStringToDouble(str.ToCString(), str.Length(), &double_value)) { |
@@ -19524,7 +18413,6 @@ RawDouble* Double::NewCanonical(const String& str) { |
return NewCanonical(double_value); |
} |
- |
RawString* Number::ToString(Heap::Space space) const { |
// Refactoring can avoid Zone::Alloc and strlen, but gains are insignificant. |
const char* cstr = ToCString(); |
@@ -19539,7 +18427,6 @@ RawString* Number::ToString(Heap::Space space) const { |
return String::FromLatin1(reinterpret_cast<const uint8_t*>(cstr), len, space); |
} |
- |
const char* Double::ToCString() const { |
if (isnan(value())) { |
return "NaN"; |
@@ -19554,59 +18441,49 @@ const char* Double::ToCString() const { |
return buffer; |
} |
- |
bool Bigint::Neg() const { |
return Bool::Handle(neg()).value(); |
} |
- |
void Bigint::SetNeg(bool value) const { |
StorePointer(&raw_ptr()->neg_, Bool::Get(value).raw()); |
} |
- |
intptr_t Bigint::Used() const { |
return Smi::Value(used()); |
} |
- |
void Bigint::SetUsed(intptr_t value) const { |
StoreSmi(&raw_ptr()->used_, Smi::New(value)); |
} |
- |
uint32_t Bigint::DigitAt(intptr_t index) const { |
const TypedData& typed_data = TypedData::Handle(digits()); |
return typed_data.GetUint32(index << 2); |
} |
- |
void Bigint::set_digits(const TypedData& value) const { |
// The VM expects digits_ to be a Uint32List (not null). |
ASSERT(!value.IsNull() && (value.GetClassId() == kTypedDataUint32ArrayCid)); |
StorePointer(&raw_ptr()->digits_, value.raw()); |
} |
- |
RawTypedData* Bigint::NewDigits(intptr_t length, Heap::Space space) { |
ASSERT(length > 0); |
// Account for leading zero for 64-bit processing. |
return TypedData::New(kTypedDataUint32ArrayCid, length + 1, space); |
} |
- |
uint32_t Bigint::DigitAt(const TypedData& digits, intptr_t index) { |
return digits.GetUint32(index << 2); |
} |
- |
void Bigint::SetDigitAt(const TypedData& digits, |
intptr_t index, |
uint32_t value) { |
digits.SetUint32(index << 2, value); |
} |
- |
bool Bigint::Equals(const Instance& other) const { |
if (this->raw() == other.raw()) { |
// Both handles point to the same raw instance. |
@@ -19636,7 +18513,6 @@ bool Bigint::Equals(const Instance& other) const { |
return true; |
} |
- |
bool Bigint::CheckAndCanonicalizeFields(Thread* thread, |
const char** error_str) const { |
Zone* zone = thread->zone(); |
@@ -19655,7 +18531,6 @@ bool Bigint::CheckAndCanonicalizeFields(Thread* thread, |
return true; |
} |
- |
RawBigint* Bigint::New(Heap::Space space) { |
// TODO(alexmarkov): Throw error or assert in --limit-ints-to-64-bits mode. |
Thread* thread = Thread::Current(); |
@@ -19676,7 +18551,6 @@ RawBigint* Bigint::New(Heap::Space space) { |
return result.raw(); |
} |
- |
RawBigint* Bigint::New(bool neg, |
intptr_t used, |
const TypedData& digits, |
@@ -19717,7 +18591,6 @@ RawBigint* Bigint::New(bool neg, |
return result.raw(); |
} |
- |
RawBigint* Bigint::NewFromInt64(int64_t value, Heap::Space space) { |
// Currently only used to convert Smi or Mint to hex String, therefore do |
// not throw RangeError if --limit-ints-to-64-bits. |
@@ -19737,7 +18610,6 @@ RawBigint* Bigint::NewFromInt64(int64_t value, Heap::Space space) { |
return New(neg, 2, digits, space); |
} |
- |
RawBigint* Bigint::NewFromUint64(uint64_t value, Heap::Space space) { |
// TODO(alexmarkov): Revise this assertion if this factory method is used |
// to explicitly allocate Bigint objects in --limit-ints-to-64-bits mode. |
@@ -19748,7 +18620,6 @@ RawBigint* Bigint::NewFromUint64(uint64_t value, Heap::Space space) { |
return New(false, 2, digits, space); |
} |
- |
RawBigint* Bigint::NewFromShiftedInt64(int64_t value, |
intptr_t shift, |
Heap::Space space) { |
@@ -19778,12 +18649,12 @@ RawBigint* Bigint::NewFromShiftedInt64(int64_t value, |
SetDigitAt(digits, 1 + digit_shift, |
static_cast<uint32_t>(abs_value >> (32 - bit_shift))); |
SetDigitAt(digits, 2 + digit_shift, |
- (bit_shift == 0) ? 0 : static_cast<uint32_t>(abs_value >> |
- (64 - bit_shift))); |
+ (bit_shift == 0) |
+ ? 0 |
+ : static_cast<uint32_t>(abs_value >> (64 - bit_shift))); |
return New(neg, used, digits, space); |
} |
- |
RawBigint* Bigint::NewFromCString(const char* str, Heap::Space space) { |
// Allow parser to scan Bigint literal, even with --limit-ints-to-64-bits. |
// TODO(alexmarkov): Throw error or assert in --limit-ints-to-64-bits mode. |
@@ -19806,7 +18677,6 @@ RawBigint* Bigint::NewFromCString(const char* str, Heap::Space space) { |
return New(neg, used, digits, space); |
} |
- |
RawBigint* Bigint::NewCanonical(const String& str) { |
// Allow parser to scan Bigint literal, even with --limit-ints-to-64-bits. |
// TODO(alexmarkov): Throw error or assert in --limit-ints-to-64-bits mode. |
@@ -19840,7 +18710,6 @@ RawBigint* Bigint::NewCanonical(const String& str) { |
} |
} |
- |
RawTypedData* Bigint::NewDigitsFromHexCString(const char* str, |
intptr_t* used, |
Heap::Space space) { |
@@ -19872,7 +18741,6 @@ RawTypedData* Bigint::NewDigitsFromHexCString(const char* str, |
return digits.raw(); |
} |
- |
RawTypedData* Bigint::NewDigitsFromDecCString(const char* str, |
intptr_t* used, |
Heap::Space space) { |
@@ -19927,7 +18795,6 @@ RawTypedData* Bigint::NewDigitsFromDecCString(const char* str, |
return digits.raw(); |
} |
- |
static double Uint64ToDouble(uint64_t x) { |
#if _WIN64 |
// For static_cast<double>(x) MSVC x64 generates |
@@ -19971,7 +18838,6 @@ static double Uint64ToDouble(uint64_t x) { |
#endif |
} |
- |
double Bigint::AsDoubleValue() const { |
ASSERT(kBitsPerDigit == 32); |
const intptr_t used = Used(); |
@@ -20106,12 +18972,10 @@ double Bigint::AsDoubleValue() const { |
return Neg() ? -value : value; |
} |
- |
bool Bigint::FitsIntoSmi() const { |
return FitsIntoInt64() && Smi::IsValid(AsInt64Value()); |
} |
- |
bool Bigint::FitsIntoInt64() const { |
ASSERT(Bigint::kBitsPerDigit == 32); |
const intptr_t used = Used(); |
@@ -20126,7 +18990,6 @@ bool Bigint::FitsIntoInt64() const { |
return value <= limit; |
} |
- |
int64_t Bigint::AsTruncatedInt64Value() const { |
const intptr_t used = Used(); |
if (used == 0) return 0; |
@@ -20135,19 +18998,16 @@ int64_t Bigint::AsTruncatedInt64Value() const { |
return Neg() ? -value : value; |
} |
- |
int64_t Bigint::AsInt64Value() const { |
ASSERT(FitsIntoInt64()); |
return AsTruncatedInt64Value(); |
} |
- |
bool Bigint::FitsIntoUint64() const { |
ASSERT(Bigint::kBitsPerDigit == 32); |
return !Neg() && (Used() <= 2); |
} |
- |
uint64_t Bigint::AsUint64Value() const { |
ASSERT(FitsIntoUint64()); |
const intptr_t used = Used(); |
@@ -20156,7 +19016,6 @@ uint64_t Bigint::AsUint64Value() const { |
return (digit1 << 32) + DigitAt(0); |
} |
- |
uint32_t Bigint::AsTruncatedUint32Value() const { |
// Note: the previous implementation of Bigint returned the absolute value |
// truncated to 32 bits, which is not consistent with Smi and Mint behavior. |
@@ -20167,7 +19026,6 @@ uint32_t Bigint::AsTruncatedUint32Value() const { |
return Neg() ? static_cast<uint32_t>(-static_cast<int32_t>(digit0)) : digit0; |
} |
- |
// For positive values: Smi < Mint < Bigint. |
int Bigint::CompareWith(const Integer& other) const { |
ASSERT(!FitsIntoSmi()); |
@@ -20190,7 +19048,6 @@ int Bigint::CompareWith(const Integer& other) const { |
return this->IsNegative() ? -1 : 1; |
} |
- |
const char* Bigint::ToDecCString(Zone* zone) const { |
// log10(2) ~= 0.30102999566398114. |
const intptr_t kLog2Dividend = 30103; |
@@ -20262,7 +19119,6 @@ const char* Bigint::ToDecCString(Zone* zone) const { |
return chars; |
} |
- |
const char* Bigint::ToHexCString(Zone* zone) const { |
const intptr_t used = Used(); |
if (used == 0) { |
@@ -20313,12 +19169,10 @@ const char* Bigint::ToHexCString(Zone* zone) const { |
return chars; |
} |
- |
const char* Bigint::ToCString() const { |
return ToDecCString(Thread::Current()->zone()); |
} |
- |
// Synchronize with implementation in compiler (intrinsifier). |
class StringHasher : ValueObject { |
public: |
@@ -20338,7 +19192,6 @@ class StringHasher : ValueObject { |
uint32_t hash_; |
}; |
- |
void StringHasher::Add(const String& str, intptr_t begin_index, intptr_t len) { |
ASSERT(begin_index >= 0); |
ASSERT(len >= 0); |
@@ -20361,14 +19214,12 @@ void StringHasher::Add(const String& str, intptr_t begin_index, intptr_t len) { |
} |
} |
- |
intptr_t String::Hash(const String& str, intptr_t begin_index, intptr_t len) { |
StringHasher hasher; |
hasher.Add(str, begin_index, len); |
return hasher.Finalize(kHashBits); |
} |
- |
intptr_t String::HashConcat(const String& str1, const String& str2) { |
intptr_t len1 = str1.Length(); |
// Since String::Hash works at the code point (rune) level, a surrogate pair |
@@ -20384,7 +19235,6 @@ intptr_t String::HashConcat(const String& str1, const String& str2) { |
} |
} |
- |
template <typename T> |
static intptr_t HashImpl(const T* characters, intptr_t len) { |
ASSERT(len >= 0); |
@@ -20395,7 +19245,6 @@ static intptr_t HashImpl(const T* characters, intptr_t len) { |
return hasher.Finalize(String::kHashBits); |
} |
- |
intptr_t String::Hash(RawString* raw) { |
StringHasher hasher; |
uword length = Smi::Value(raw->ptr()->length_); |
@@ -20424,17 +19273,14 @@ intptr_t String::Hash(RawString* raw) { |
} |
} |
- |
intptr_t String::Hash(const char* characters, intptr_t len) { |
return HashImpl(characters, len); |
} |
- |
intptr_t String::Hash(const uint8_t* characters, intptr_t len) { |
return HashImpl(characters, len); |
} |
- |
intptr_t String::Hash(const uint16_t* characters, intptr_t len) { |
StringHasher hasher; |
intptr_t i = 0; |
@@ -20444,12 +19290,10 @@ intptr_t String::Hash(const uint16_t* characters, intptr_t len) { |
return hasher.Finalize(kHashBits); |
} |
- |
intptr_t String::Hash(const int32_t* characters, intptr_t len) { |
return HashImpl(characters, len); |
} |
- |
uint16_t String::CharAt(intptr_t index) const { |
intptr_t class_id = raw()->GetClassId(); |
ASSERT(RawObject::IsStringClassId(class_id)); |
@@ -20466,7 +19310,6 @@ uint16_t String::CharAt(intptr_t index) const { |
return ExternalTwoByteString::CharAt(*this, index); |
} |
- |
Scanner::CharAtFunc String::CharAtFunc() const { |
intptr_t class_id = raw()->GetClassId(); |
ASSERT(RawObject::IsStringClassId(class_id)); |
@@ -20483,7 +19326,6 @@ Scanner::CharAtFunc String::CharAtFunc() const { |
return &ExternalTwoByteString::CharAt; |
} |
- |
intptr_t String::CharSize() const { |
intptr_t class_id = raw()->GetClassId(); |
if (class_id == kOneByteStringCid || class_id == kExternalOneByteStringCid) { |
@@ -20494,7 +19336,6 @@ intptr_t String::CharSize() const { |
return kTwoByteChar; |
} |
- |
void* String::GetPeer() const { |
intptr_t class_id = raw()->GetClassId(); |
if (class_id == kExternalOneByteStringCid) { |
@@ -20504,7 +19345,6 @@ void* String::GetPeer() const { |
return ExternalTwoByteString::GetPeer(*this); |
} |
- |
bool String::Equals(const Instance& other) const { |
if (this->raw() == other.raw()) { |
// Both handles point to the same raw instance. |
@@ -20519,7 +19359,6 @@ bool String::Equals(const Instance& other) const { |
return Equals(other_string); |
} |
- |
bool String::Equals(const String& str, |
intptr_t begin_index, |
intptr_t len) const { |
@@ -20542,7 +19381,6 @@ bool String::Equals(const String& str, |
return true; |
} |
- |
bool String::Equals(const char* cstr) const { |
ASSERT(cstr != NULL); |
CodePointIterator it(*this); |
@@ -20564,7 +19402,6 @@ bool String::Equals(const char* cstr) const { |
return *cstr == '\0'; |
} |
- |
bool String::Equals(const uint8_t* latin1_array, intptr_t len) const { |
if (len != this->Length()) { |
// Lengths don't match. |
@@ -20579,7 +19416,6 @@ bool String::Equals(const uint8_t* latin1_array, intptr_t len) const { |
return true; |
} |
- |
bool String::Equals(const uint16_t* utf16_array, intptr_t len) const { |
if (len != this->Length()) { |
// Lengths don't match. |
@@ -20594,7 +19430,6 @@ bool String::Equals(const uint16_t* utf16_array, intptr_t len) const { |
return true; |
} |
- |
bool String::Equals(const int32_t* utf32_array, intptr_t len) const { |
if (len < 0) return false; |
intptr_t j = 0; |
@@ -20613,14 +19448,12 @@ bool String::Equals(const int32_t* utf32_array, intptr_t len) const { |
return j == Length(); |
} |
- |
bool String::EqualsConcat(const String& str1, const String& str2) const { |
return (Length() == str1.Length() + str2.Length()) && |
str1.Equals(*this, 0, str1.Length()) && |
str2.Equals(*this, str1.Length(), str2.Length()); |
} |
- |
intptr_t String::CompareTo(const String& other) const { |
const intptr_t this_len = this->Length(); |
const intptr_t other_len = other.IsNull() ? 0 : other.Length(); |
@@ -20640,7 +19473,6 @@ intptr_t String::CompareTo(const String& other) const { |
return 0; |
} |
- |
bool String::StartsWith(const String& other) const { |
if (other.IsNull() || (other.Length() > this->Length())) { |
return false; |
@@ -20654,7 +19486,6 @@ bool String::StartsWith(const String& other) const { |
return true; |
} |
- |
RawInstance* String::CheckAndCanonicalize(Thread* thread, |
const char** error_str) const { |
if (IsCanonical()) { |
@@ -20663,7 +19494,6 @@ RawInstance* String::CheckAndCanonicalize(Thread* thread, |
return Symbols::New(Thread::Current(), *this); |
} |
- |
#if defined(DEBUG) |
bool String::CheckIsCanonical(Thread* thread) const { |
Zone* zone = thread->zone(); |
@@ -20672,7 +19502,6 @@ bool String::CheckIsCanonical(Thread* thread) const { |
} |
#endif // DEBUG |
- |
RawString* String::New(const char* cstr, Heap::Space space) { |
ASSERT(cstr != NULL); |
intptr_t array_len = strlen(cstr); |
@@ -20680,7 +19509,6 @@ RawString* String::New(const char* cstr, Heap::Space space) { |
return String::FromUTF8(utf8_array, array_len, space); |
} |
- |
RawString* String::FromUTF8(const uint8_t* utf8_array, |
intptr_t array_len, |
Heap::Space space) { |
@@ -20703,14 +19531,12 @@ RawString* String::FromUTF8(const uint8_t* utf8_array, |
return strobj.raw(); |
} |
- |
RawString* String::FromLatin1(const uint8_t* latin1_array, |
intptr_t array_len, |
Heap::Space space) { |
return OneByteString::New(latin1_array, array_len, space); |
} |
- |
RawString* String::FromUTF16(const uint16_t* utf16_array, |
intptr_t array_len, |
Heap::Space space) { |
@@ -20727,7 +19553,6 @@ RawString* String::FromUTF16(const uint16_t* utf16_array, |
return TwoByteString::New(utf16_array, array_len, space); |
} |
- |
RawString* String::FromUTF32(const int32_t* utf32_array, |
intptr_t array_len, |
Heap::Space space) { |
@@ -20747,7 +19572,6 @@ RawString* String::FromUTF32(const int32_t* utf32_array, |
return TwoByteString::New(utf16_len, utf32_array, array_len, space); |
} |
- |
RawString* String::New(const String& str, Heap::Space space) { |
// Currently this just creates a copy of the string in the correct space. |
// Once we have external string support, this will also create a heap copy of |
@@ -20766,7 +19590,6 @@ RawString* String::New(const String& str, Heap::Space space) { |
return result.raw(); |
} |
- |
RawString* String::NewExternal(const uint8_t* characters, |
intptr_t len, |
void* peer, |
@@ -20775,7 +19598,6 @@ RawString* String::NewExternal(const uint8_t* characters, |
return ExternalOneByteString::New(characters, len, peer, callback, space); |
} |
- |
RawString* String::NewExternal(const uint16_t* characters, |
intptr_t len, |
void* peer, |
@@ -20784,7 +19606,6 @@ RawString* String::NewExternal(const uint16_t* characters, |
return ExternalTwoByteString::New(characters, len, peer, callback, space); |
} |
- |
void String::Copy(const String& dst, |
intptr_t dst_offset, |
const uint8_t* characters, |
@@ -20804,7 +19625,6 @@ void String::Copy(const String& dst, |
} |
} |
- |
void String::Copy(const String& dst, |
intptr_t dst_offset, |
const uint16_t* utf16_array, |
@@ -20828,7 +19648,6 @@ void String::Copy(const String& dst, |
} |
} |
- |
void String::Copy(const String& dst, |
intptr_t dst_offset, |
const String& src, |
@@ -20868,7 +19687,6 @@ void String::Copy(const String& dst, |
} |
} |
- |
RawString* String::EscapeSpecialCharacters(const String& str) { |
if (str.IsOneByteString()) { |
return OneByteString::EscapeSpecialCharacters(str); |
@@ -20887,12 +19705,10 @@ RawString* String::EscapeSpecialCharacters(const String& str) { |
String::Handle(TwoByteString::New(str, Heap::kNew))); |
} |
- |
static bool IsPercent(int32_t c) { |
return c == '%'; |
} |
- |
static bool IsHexCharacter(int32_t c) { |
if (c >= '0' && c <= '9') { |
return true; |
@@ -20903,7 +19719,6 @@ static bool IsHexCharacter(int32_t c) { |
return false; |
} |
- |
static bool IsURISafeCharacter(int32_t c) { |
if ((c >= '0') && (c <= '9')) { |
return true; |
@@ -20917,7 +19732,6 @@ static bool IsURISafeCharacter(int32_t c) { |
return (c == '-') || (c == '_') || (c == '.') || (c == '~'); |
} |
- |
static int32_t GetHexCharacter(int32_t c) { |
ASSERT(c >= 0); |
ASSERT(c < 16); |
@@ -20925,7 +19739,6 @@ static int32_t GetHexCharacter(int32_t c) { |
return hex[c]; |
} |
- |
static int32_t GetHexValue(int32_t c) { |
if (c >= '0' && c <= '9') { |
return c - '0'; |
@@ -20937,12 +19750,10 @@ static int32_t GetHexValue(int32_t c) { |
return 0; |
} |
- |
static int32_t MergeHexCharacters(int32_t c1, int32_t c2) { |
return GetHexValue(c1) << 4 | GetHexValue(c2); |
} |
- |
const char* String::EncodeIRI(const String& str) { |
const intptr_t len = Utf8::Length(str); |
Zone* zone = Thread::Current()->zone(); |
@@ -20973,7 +19784,6 @@ const char* String::EncodeIRI(const String& str) { |
return cstr; |
} |
- |
RawString* String::DecodeIRI(const String& str) { |
CodePointIterator cpi(str); |
intptr_t num_escapes = 0; |
@@ -21030,7 +19840,6 @@ RawString* String::DecodeIRI(const String& str) { |
return FromUTF8(utf8, utf8_len); |
} |
- |
RawString* String::NewFormatted(const char* format, ...) { |
va_list args; |
va_start(args, format); |
@@ -21040,7 +19849,6 @@ RawString* String::NewFormatted(const char* format, ...) { |
return result; |
} |
- |
RawString* String::NewFormatted(Heap::Space space, const char* format, ...) { |
va_list args; |
va_start(args, format); |
@@ -21050,7 +19858,6 @@ RawString* String::NewFormatted(Heap::Space space, const char* format, ...) { |
return result; |
} |
- |
RawString* String::NewFormattedV(const char* format, |
va_list args, |
Heap::Space space) { |
@@ -21066,7 +19873,6 @@ RawString* String::NewFormattedV(const char* format, |
return String::New(buffer, space); |
} |
- |
RawString* String::Concat(const String& str1, |
const String& str2, |
Heap::Space space) { |
@@ -21078,12 +19884,10 @@ RawString* String::Concat(const String& str1, |
return OneByteString::Concat(str1, str2, space); |
} |
- |
RawString* String::ConcatAll(const Array& strings, Heap::Space space) { |
return ConcatAllRange(strings, 0, strings.Length(), space); |
} |
- |
RawString* String::ConcatAllRange(const Array& strings, |
intptr_t start, |
intptr_t end, |
@@ -21112,7 +19916,6 @@ RawString* String::ConcatAllRange(const Array& strings, |
return TwoByteString::ConcatAll(strings, start, end, result_len, space); |
} |
- |
RawString* String::SubString(const String& str, |
intptr_t begin_index, |
Heap::Space space) { |
@@ -21124,7 +19927,6 @@ RawString* String::SubString(const String& str, |
space); |
} |
- |
RawString* String::SubString(Thread* thread, |
const String& str, |
intptr_t begin_index, |
@@ -21160,7 +19962,6 @@ RawString* String::SubString(Thread* thread, |
return result.raw(); |
} |
- |
const char* String::ToCString() const { |
if (IsOneByteString()) { |
// Quick conversion if OneByteString contains only ASCII characters. |
@@ -21193,13 +19994,11 @@ const char* String::ToCString() const { |
return reinterpret_cast<const char*>(result); |
} |
- |
void String::ToUTF8(uint8_t* utf8_array, intptr_t array_len) const { |
ASSERT(array_len >= Utf8::Length(*this)); |
Utf8::Encode(*this, reinterpret_cast<char*>(utf8_array), array_len); |
} |
- |
static FinalizablePersistentHandle* AddFinalizer( |
const Object& referent, |
void* peer, |
@@ -21211,7 +20010,6 @@ static FinalizablePersistentHandle* AddFinalizer( |
callback, external_size); |
} |
- |
RawString* String::MakeExternal(void* array, |
intptr_t external_size, |
void* peer, |
@@ -21306,7 +20104,6 @@ RawString* String::MakeExternal(void* array, |
return this->raw(); |
} |
- |
RawString* String::Transform(int32_t (*mapping)(int32_t ch), |
const String& str, |
Heap::Space space) { |
@@ -21332,13 +20129,11 @@ RawString* String::Transform(int32_t (*mapping)(int32_t ch), |
return TwoByteString::Transform(mapping, str, space); |
} |
- |
RawString* String::ToUpperCase(const String& str, Heap::Space space) { |
// TODO(cshapiro): create a fast-path for OneByteString instances. |
return Transform(CaseMapping::ToUpper, str, space); |
} |
- |
RawString* String::ToLowerCase(const String& str, Heap::Space space) { |
// TODO(cshapiro): create a fast-path for OneByteString instances. |
return Transform(CaseMapping::ToLower, str, space); |
@@ -21375,7 +20170,6 @@ bool String::ParseDouble(const String& str, |
result); |
} |
- |
// Check to see if 'str1' matches 'str2' as is or |
// once the private key separator is stripped from str2. |
// |
@@ -21428,7 +20222,6 @@ static bool EqualsIgnoringPrivateKey(const String& str1, const String& str2) { |
return (str2_pos == str2_len); |
} |
- |
#define EQUALS_IGNORING_PRIVATE_KEY(class_id, type, str1, str2) \ |
switch (class_id) { \ |
case kOneByteStringCid: \ |
@@ -21444,7 +20237,6 @@ static bool EqualsIgnoringPrivateKey(const String& str1, const String& str2) { |
} \ |
UNREACHABLE(); |
- |
bool String::EqualsIgnoringPrivateKey(const String& str1, const String& str2) { |
if (str1.raw() == str2.raw()) { |
return true; // Both handles point to the same raw instance. |
@@ -21472,7 +20264,6 @@ bool String::EqualsIgnoringPrivateKey(const String& str1, const String& str2) { |
return false; |
} |
- |
bool String::CodePointIterator::Next() { |
ASSERT(index_ >= -1); |
intptr_t length = Utf16::Length(ch_); |
@@ -21491,7 +20282,6 @@ bool String::CodePointIterator::Next() { |
return false; |
} |
- |
RawOneByteString* OneByteString::EscapeSpecialCharacters(const String& str) { |
intptr_t len = str.Length(); |
if (len > 0) { |
@@ -21524,7 +20314,6 @@ RawOneByteString* OneByteString::EscapeSpecialCharacters(const String& str) { |
return OneByteString::raw(Symbols::Empty()); |
} |
- |
RawOneByteString* ExternalOneByteString::EscapeSpecialCharacters( |
const String& str) { |
intptr_t len = str.Length(); |
@@ -21558,7 +20347,6 @@ RawOneByteString* ExternalOneByteString::EscapeSpecialCharacters( |
return OneByteString::raw(Symbols::Empty()); |
} |
- |
RawOneByteString* OneByteString::New(intptr_t len, Heap::Space space) { |
ASSERT((Isolate::Current() == Dart::vm_isolate()) || |
((Isolate::Current()->object_store() != NULL) && |
@@ -21581,7 +20369,6 @@ RawOneByteString* OneByteString::New(intptr_t len, Heap::Space space) { |
} |
} |
- |
RawOneByteString* OneByteString::New(const uint8_t* characters, |
intptr_t len, |
Heap::Space space) { |
@@ -21593,7 +20380,6 @@ RawOneByteString* OneByteString::New(const uint8_t* characters, |
return OneByteString::raw(result); |
} |
- |
RawOneByteString* OneByteString::New(const uint16_t* characters, |
intptr_t len, |
Heap::Space space) { |
@@ -21606,7 +20392,6 @@ RawOneByteString* OneByteString::New(const uint16_t* characters, |
return OneByteString::raw(result); |
} |
- |
RawOneByteString* OneByteString::New(const int32_t* characters, |
intptr_t len, |
Heap::Space space) { |
@@ -21619,7 +20404,6 @@ RawOneByteString* OneByteString::New(const int32_t* characters, |
return OneByteString::raw(result); |
} |
- |
RawOneByteString* OneByteString::New(const String& str, Heap::Space space) { |
intptr_t len = str.Length(); |
const String& result = String::Handle(OneByteString::New(len, space)); |
@@ -21627,7 +20411,6 @@ RawOneByteString* OneByteString::New(const String& str, Heap::Space space) { |
return OneByteString::raw(result); |
} |
- |
RawOneByteString* OneByteString::New(const String& other_one_byte_string, |
intptr_t other_start_index, |
intptr_t other_len, |
@@ -21643,7 +20426,6 @@ RawOneByteString* OneByteString::New(const String& other_one_byte_string, |
return OneByteString::raw(result); |
} |
- |
RawOneByteString* OneByteString::New(const TypedData& other_typed_data, |
intptr_t other_start_index, |
intptr_t other_len, |
@@ -21658,7 +20440,6 @@ RawOneByteString* OneByteString::New(const TypedData& other_typed_data, |
return OneByteString::raw(result); |
} |
- |
RawOneByteString* OneByteString::New(const ExternalTypedData& other_typed_data, |
intptr_t other_start_index, |
intptr_t other_len, |
@@ -21673,7 +20454,6 @@ RawOneByteString* OneByteString::New(const ExternalTypedData& other_typed_data, |
return OneByteString::raw(result); |
} |
- |
RawOneByteString* OneByteString::Concat(const String& str1, |
const String& str2, |
Heap::Space space) { |
@@ -21686,7 +20466,6 @@ RawOneByteString* OneByteString::Concat(const String& str1, |
return OneByteString::raw(result); |
} |
- |
RawOneByteString* OneByteString::ConcatAll(const Array& strings, |
intptr_t start, |
intptr_t end, |
@@ -21708,7 +20487,6 @@ RawOneByteString* OneByteString::ConcatAll(const Array& strings, |
return OneByteString::raw(result); |
} |
- |
RawOneByteString* OneByteString::Transform(int32_t (*mapping)(int32_t ch), |
const String& str, |
Heap::Space space) { |
@@ -21724,7 +20502,6 @@ RawOneByteString* OneByteString::Transform(int32_t (*mapping)(int32_t ch), |
return OneByteString::raw(result); |
} |
- |
RawOneByteString* OneByteString::SubStringUnchecked(const String& str, |
intptr_t begin_index, |
intptr_t length, |
@@ -21746,7 +20523,6 @@ RawOneByteString* OneByteString::SubStringUnchecked(const String& str, |
return result; |
} |
- |
void OneByteString::SetPeer(const String& str, |
intptr_t external_size, |
void* peer, |
@@ -21759,14 +20535,12 @@ void OneByteString::SetPeer(const String& str, |
Isolate::Current()->heap()->SetPeer(str.raw(), peer); |
} |
- |
void OneByteString::Finalize(void* isolate_callback_data, |
Dart_WeakPersistentHandle handle, |
void* peer) { |
delete reinterpret_cast<ExternalStringData<uint8_t>*>(peer); |
} |
- |
RawTwoByteString* TwoByteString::EscapeSpecialCharacters(const String& str) { |
intptr_t len = str.Length(); |
if (len > 0) { |
@@ -21799,7 +20573,6 @@ RawTwoByteString* TwoByteString::EscapeSpecialCharacters(const String& str) { |
return TwoByteString::New(0, Heap::kNew); |
} |
- |
RawTwoByteString* TwoByteString::New(intptr_t len, Heap::Space space) { |
ASSERT(Isolate::Current()->object_store()->two_byte_string_class()); |
if (len < 0 || len > kMaxElements) { |
@@ -21818,7 +20591,6 @@ RawTwoByteString* TwoByteString::New(intptr_t len, Heap::Space space) { |
return TwoByteString::raw(result); |
} |
- |
RawTwoByteString* TwoByteString::New(const uint16_t* utf16_array, |
intptr_t array_len, |
Heap::Space space) { |
@@ -21831,7 +20603,6 @@ RawTwoByteString* TwoByteString::New(const uint16_t* utf16_array, |
return TwoByteString::raw(result); |
} |
- |
RawTwoByteString* TwoByteString::New(intptr_t utf16_len, |
const int32_t* utf32_array, |
intptr_t array_len, |
@@ -21856,7 +20627,6 @@ RawTwoByteString* TwoByteString::New(intptr_t utf16_len, |
return TwoByteString::raw(result); |
} |
- |
RawTwoByteString* TwoByteString::New(const String& str, Heap::Space space) { |
intptr_t len = str.Length(); |
const String& result = String::Handle(TwoByteString::New(len, space)); |
@@ -21864,7 +20634,6 @@ RawTwoByteString* TwoByteString::New(const String& str, Heap::Space space) { |
return TwoByteString::raw(result); |
} |
- |
RawTwoByteString* TwoByteString::New(const TypedData& other_typed_data, |
intptr_t other_start_index, |
intptr_t other_len, |
@@ -21879,7 +20648,6 @@ RawTwoByteString* TwoByteString::New(const TypedData& other_typed_data, |
return TwoByteString::raw(result); |
} |
- |
RawTwoByteString* TwoByteString::New(const ExternalTypedData& other_typed_data, |
intptr_t other_start_index, |
intptr_t other_len, |
@@ -21894,7 +20662,6 @@ RawTwoByteString* TwoByteString::New(const ExternalTypedData& other_typed_data, |
return TwoByteString::raw(result); |
} |
- |
RawTwoByteString* TwoByteString::Concat(const String& str1, |
const String& str2, |
Heap::Space space) { |
@@ -21907,7 +20674,6 @@ RawTwoByteString* TwoByteString::Concat(const String& str1, |
return TwoByteString::raw(result); |
} |
- |
RawTwoByteString* TwoByteString::ConcatAll(const Array& strings, |
intptr_t start, |
intptr_t end, |
@@ -21929,7 +20695,6 @@ RawTwoByteString* TwoByteString::ConcatAll(const Array& strings, |
return TwoByteString::raw(result); |
} |
- |
RawTwoByteString* TwoByteString::Transform(int32_t (*mapping)(int32_t ch), |
const String& str, |
Heap::Space space) { |
@@ -21955,7 +20720,6 @@ RawTwoByteString* TwoByteString::Transform(int32_t (*mapping)(int32_t ch), |
return TwoByteString::raw(result); |
} |
- |
void TwoByteString::SetPeer(const String& str, |
intptr_t external_size, |
void* peer, |
@@ -21968,14 +20732,12 @@ void TwoByteString::SetPeer(const String& str, |
Isolate::Current()->heap()->SetPeer(str.raw(), peer); |
} |
- |
void TwoByteString::Finalize(void* isolate_callback_data, |
Dart_WeakPersistentHandle handle, |
void* peer) { |
delete reinterpret_cast<ExternalStringData<uint16_t>*>(peer); |
} |
- |
RawExternalOneByteString* ExternalOneByteString::New( |
const uint8_t* data, |
intptr_t len, |
@@ -22008,14 +20770,12 @@ RawExternalOneByteString* ExternalOneByteString::New( |
return ExternalOneByteString::raw(result); |
} |
- |
void ExternalOneByteString::Finalize(void* isolate_callback_data, |
Dart_WeakPersistentHandle handle, |
void* peer) { |
delete reinterpret_cast<ExternalStringData<uint8_t>*>(peer); |
} |
- |
RawExternalTwoByteString* ExternalTwoByteString::New( |
const uint16_t* data, |
intptr_t len, |
@@ -22048,14 +20808,12 @@ RawExternalTwoByteString* ExternalTwoByteString::New( |
return ExternalTwoByteString::raw(result); |
} |
- |
void ExternalTwoByteString::Finalize(void* isolate_callback_data, |
Dart_WeakPersistentHandle handle, |
void* peer) { |
delete reinterpret_cast<ExternalStringData<uint16_t>*>(peer); |
} |
- |
RawBool* Bool::New(bool value) { |
ASSERT(Isolate::Current()->object_store()->bool_class() != Class::null()); |
Bool& result = Bool::Handle(); |
@@ -22072,12 +20830,10 @@ RawBool* Bool::New(bool value) { |
return result.raw(); |
} |
- |
const char* Bool::ToCString() const { |
return value() ? "true" : "false"; |
} |
- |
bool Array::CanonicalizeEquals(const Instance& other) const { |
if (this->raw() == other.raw()) { |
// Both handles point to the same raw instance. |
@@ -22116,7 +20872,6 @@ bool Array::CanonicalizeEquals(const Instance& other) const { |
return true; |
} |
- |
uword Array::ComputeCanonicalTableHash() const { |
ASSERT(!IsNull()); |
NoSafepointScope no_safepoint; |
@@ -22131,13 +20886,11 @@ uword Array::ComputeCanonicalTableHash() const { |
return FinalizeHash(hash, kHashBits); |
} |
- |
RawArray* Array::New(intptr_t len, Heap::Space space) { |
ASSERT(Isolate::Current()->object_store()->array_class() != Class::null()); |
return New(kClassId, len, space); |
} |
- |
RawArray* Array::New(intptr_t class_id, intptr_t len, Heap::Space space) { |
if ((len < 0) || (len > Array::kMaxElements)) { |
// This should be caught before we reach here. |
@@ -22152,7 +20905,6 @@ RawArray* Array::New(intptr_t class_id, intptr_t len, Heap::Space space) { |
} |
} |
- |
RawArray* Array::Slice(intptr_t start, |
intptr_t count, |
bool with_type_argument) const { |
@@ -22169,7 +20921,6 @@ RawArray* Array::Slice(intptr_t start, |
return dest.raw(); |
} |
- |
void Array::MakeImmutable() const { |
if (IsImmutable()) return; |
ASSERT(!IsCanonical()); |
@@ -22184,7 +20935,6 @@ void Array::MakeImmutable() const { |
} while (tags != old_tags); |
} |
- |
const char* Array::ToCString() const { |
if (IsNull()) { |
return IsImmutable() ? "_ImmutableList NULL" : "_List NULL"; |
@@ -22195,7 +20945,6 @@ const char* Array::ToCString() const { |
return zone->PrintToString(format, Length()); |
} |
- |
RawArray* Array::Grow(const Array& source, |
intptr_t new_length, |
Heap::Space space) { |
@@ -22217,7 +20966,6 @@ RawArray* Array::Grow(const Array& source, |
return result.raw(); |
} |
- |
RawArray* Array::MakeFixedLength(const GrowableObjectArray& growable_array, |
bool unique) { |
ASSERT(!growable_array.IsNull()); |
@@ -22281,7 +21029,6 @@ RawArray* Array::MakeFixedLength(const GrowableObjectArray& growable_array, |
return array.raw(); |
} |
- |
bool Array::CheckAndCanonicalizeFields(Thread* thread, |
const char** error_str) const { |
intptr_t len = Length(); |
@@ -22310,14 +21057,12 @@ bool Array::CheckAndCanonicalizeFields(Thread* thread, |
return true; |
} |
- |
RawImmutableArray* ImmutableArray::New(intptr_t len, Heap::Space space) { |
ASSERT(Isolate::Current()->object_store()->immutable_array_class() != |
Class::null()); |
return reinterpret_cast<RawImmutableArray*>(Array::New(kClassId, len, space)); |
} |
- |
void GrowableObjectArray::Add(const Object& value, Heap::Space space) const { |
ASSERT(!IsNull()); |
if (Length() == Capacity()) { |
@@ -22335,7 +21080,6 @@ void GrowableObjectArray::Add(const Object& value, Heap::Space space) const { |
SetAt(index, value); |
} |
- |
void GrowableObjectArray::Grow(intptr_t new_capacity, Heap::Space space) const { |
ASSERT(new_capacity > Capacity()); |
const Array& contents = Array::Handle(data()); |
@@ -22344,7 +21088,6 @@ void GrowableObjectArray::Grow(intptr_t new_capacity, Heap::Space space) const { |
StorePointer(&(raw_ptr()->data_), new_contents.raw()); |
} |
- |
RawObject* GrowableObjectArray::RemoveLast() const { |
ASSERT(!IsNull()); |
ASSERT(Length() > 0); |
@@ -22356,7 +21099,6 @@ RawObject* GrowableObjectArray::RemoveLast() const { |
return obj.raw(); |
} |
- |
RawGrowableObjectArray* GrowableObjectArray::New(intptr_t capacity, |
Heap::Space space) { |
RawArray* raw_data = (capacity == 0) ? Object::empty_array().raw() |
@@ -22365,7 +21107,6 @@ RawGrowableObjectArray* GrowableObjectArray::New(intptr_t capacity, |
return New(data, space); |
} |
- |
RawGrowableObjectArray* GrowableObjectArray::New(const Array& array, |
Heap::Space space) { |
ASSERT(Isolate::Current()->object_store()->growable_object_array_class() != |
@@ -22383,7 +21124,6 @@ RawGrowableObjectArray* GrowableObjectArray::New(const Array& array, |
return result.raw(); |
} |
- |
const char* GrowableObjectArray::ToCString() const { |
if (IsNull()) { |
return "_GrowableList: null"; |
@@ -22392,7 +21132,6 @@ const char* GrowableObjectArray::ToCString() const { |
"Instance(length:%" Pd ") of '_GrowableList'", Length()); |
} |
- |
// Equivalent to Dart's operator "==" and hashCode. |
class DefaultHashTraits { |
public: |
@@ -22428,7 +21167,6 @@ class DefaultHashTraits { |
} |
}; |
- |
RawLinkedHashMap* LinkedHashMap::NewDefault(Heap::Space space) { |
const Array& data = Array::Handle(Array::New(kInitialIndexSize, space)); |
const TypedData& index = TypedData::Handle( |
@@ -22440,7 +21178,6 @@ RawLinkedHashMap* LinkedHashMap::NewDefault(Heap::Space space) { |
return LinkedHashMap::New(data, index, kInitialHashMask, 0, 0, space); |
} |
- |
RawLinkedHashMap* LinkedHashMap::New(const Array& data, |
const TypedData& index, |
intptr_t hash_mask, |
@@ -22459,7 +21196,6 @@ RawLinkedHashMap* LinkedHashMap::New(const Array& data, |
return result.raw(); |
} |
- |
RawLinkedHashMap* LinkedHashMap::NewUninitialized(Heap::Space space) { |
ASSERT(Isolate::Current()->object_store()->linked_hash_map_class() != |
Class::null()); |
@@ -22473,13 +21209,11 @@ RawLinkedHashMap* LinkedHashMap::NewUninitialized(Heap::Space space) { |
return result.raw(); |
} |
- |
const char* LinkedHashMap::ToCString() const { |
Zone* zone = Thread::Current()->zone(); |
return zone->PrintToString("_LinkedHashMap len:%" Pd, Length()); |
} |
- |
RawFloat32x4* Float32x4::New(float v0, |
float v1, |
float v2, |
@@ -22501,7 +21235,6 @@ RawFloat32x4* Float32x4::New(float v0, |
return result.raw(); |
} |
- |
RawFloat32x4* Float32x4::New(simd128_value_t value, Heap::Space space) { |
ASSERT(Isolate::Current()->object_store()->float32x4_class() != |
Class::null()); |
@@ -22516,59 +21249,48 @@ RawFloat32x4* Float32x4::New(simd128_value_t value, Heap::Space space) { |
return result.raw(); |
} |
- |
simd128_value_t Float32x4::value() const { |
return ReadUnaligned( |
reinterpret_cast<const simd128_value_t*>(&raw_ptr()->value_)); |
} |
- |
void Float32x4::set_value(simd128_value_t value) const { |
StoreUnaligned(reinterpret_cast<simd128_value_t*>(&raw()->ptr()->value_), |
value); |
} |
- |
void Float32x4::set_x(float value) const { |
StoreNonPointer(&raw_ptr()->value_[0], value); |
} |
- |
void Float32x4::set_y(float value) const { |
StoreNonPointer(&raw_ptr()->value_[1], value); |
} |
- |
void Float32x4::set_z(float value) const { |
StoreNonPointer(&raw_ptr()->value_[2], value); |
} |
- |
void Float32x4::set_w(float value) const { |
StoreNonPointer(&raw_ptr()->value_[3], value); |
} |
- |
float Float32x4::x() const { |
return raw_ptr()->value_[0]; |
} |
- |
float Float32x4::y() const { |
return raw_ptr()->value_[1]; |
} |
- |
float Float32x4::z() const { |
return raw_ptr()->value_[2]; |
} |
- |
float Float32x4::w() const { |
return raw_ptr()->value_[3]; |
} |
- |
const char* Float32x4::ToCString() const { |
float _x = x(); |
float _y = y(); |
@@ -22578,7 +21300,6 @@ const char* Float32x4::ToCString() const { |
_w); |
} |
- |
RawInt32x4* Int32x4::New(int32_t v0, |
int32_t v1, |
int32_t v2, |
@@ -22599,7 +21320,6 @@ RawInt32x4* Int32x4::New(int32_t v0, |
return result.raw(); |
} |
- |
RawInt32x4* Int32x4::New(simd128_value_t value, Heap::Space space) { |
ASSERT(Isolate::Current()->object_store()->int32x4_class() != Class::null()); |
Int32x4& result = Int32x4::Handle(); |
@@ -22613,59 +21333,48 @@ RawInt32x4* Int32x4::New(simd128_value_t value, Heap::Space space) { |
return result.raw(); |
} |
- |
void Int32x4::set_x(int32_t value) const { |
StoreNonPointer(&raw_ptr()->value_[0], value); |
} |
- |
void Int32x4::set_y(int32_t value) const { |
StoreNonPointer(&raw_ptr()->value_[1], value); |
} |
- |
void Int32x4::set_z(int32_t value) const { |
StoreNonPointer(&raw_ptr()->value_[2], value); |
} |
- |
void Int32x4::set_w(int32_t value) const { |
StoreNonPointer(&raw_ptr()->value_[3], value); |
} |
- |
int32_t Int32x4::x() const { |
return raw_ptr()->value_[0]; |
} |
- |
int32_t Int32x4::y() const { |
return raw_ptr()->value_[1]; |
} |
- |
int32_t Int32x4::z() const { |
return raw_ptr()->value_[2]; |
} |
- |
int32_t Int32x4::w() const { |
return raw_ptr()->value_[3]; |
} |
- |
simd128_value_t Int32x4::value() const { |
return ReadUnaligned( |
reinterpret_cast<const simd128_value_t*>(&raw_ptr()->value_)); |
} |
- |
void Int32x4::set_value(simd128_value_t value) const { |
StoreUnaligned(reinterpret_cast<simd128_value_t*>(&raw()->ptr()->value_), |
value); |
} |
- |
const char* Int32x4::ToCString() const { |
int32_t _x = x(); |
int32_t _y = y(); |
@@ -22675,7 +21384,6 @@ const char* Int32x4::ToCString() const { |
_y, _z, _w); |
} |
- |
RawFloat64x2* Float64x2::New(double value0, double value1, Heap::Space space) { |
ASSERT(Isolate::Current()->object_store()->float64x2_class() != |
Class::null()); |
@@ -22691,7 +21399,6 @@ RawFloat64x2* Float64x2::New(double value0, double value1, Heap::Space space) { |
return result.raw(); |
} |
- |
RawFloat64x2* Float64x2::New(simd128_value_t value, Heap::Space space) { |
ASSERT(Isolate::Current()->object_store()->float64x2_class() != |
Class::null()); |
@@ -22706,44 +21413,36 @@ RawFloat64x2* Float64x2::New(simd128_value_t value, Heap::Space space) { |
return result.raw(); |
} |
- |
double Float64x2::x() const { |
return raw_ptr()->value_[0]; |
} |
- |
double Float64x2::y() const { |
return raw_ptr()->value_[1]; |
} |
- |
void Float64x2::set_x(double x) const { |
StoreNonPointer(&raw_ptr()->value_[0], x); |
} |
- |
void Float64x2::set_y(double y) const { |
StoreNonPointer(&raw_ptr()->value_[1], y); |
} |
- |
simd128_value_t Float64x2::value() const { |
return simd128_value_t().readFrom(&raw_ptr()->value_[0]); |
} |
- |
void Float64x2::set_value(simd128_value_t value) const { |
StoreSimd128(&raw_ptr()->value_[0], value); |
} |
- |
const char* Float64x2::ToCString() const { |
double _x = x(); |
double _y = y(); |
return OS::SCreate(Thread::Current()->zone(), "[%f, %f]", _x, _y); |
} |
- |
const intptr_t TypedData::element_size_table[TypedData::kNumElementSizes] = { |
1, // kTypedDataInt8ArrayCid. |
1, // kTypedDataUint8ArrayCid. |
@@ -22761,7 +21460,6 @@ const intptr_t TypedData::element_size_table[TypedData::kNumElementSizes] = { |
16, // kTypedDataFloat64x2ArrayCid, |
}; |
- |
bool TypedData::CanonicalizeEquals(const Instance& other) const { |
if (this->raw() == other.raw()) { |
// Both handles point to the same raw instance. |
@@ -22787,7 +21485,6 @@ bool TypedData::CanonicalizeEquals(const Instance& other) const { |
(memcmp(DataAddr(0), other_typed_data.DataAddr(0), len) == 0); |
} |
- |
uword TypedData::ComputeCanonicalTableHash() const { |
const intptr_t len = this->LengthInBytes(); |
ASSERT(len != 0); |
@@ -22798,7 +21495,6 @@ uword TypedData::ComputeCanonicalTableHash() const { |
return FinalizeHash(hash, kHashBits); |
} |
- |
RawTypedData* TypedData::New(intptr_t class_id, |
intptr_t len, |
Heap::Space space) { |
@@ -22820,7 +21516,6 @@ RawTypedData* TypedData::New(intptr_t class_id, |
return result.raw(); |
} |
- |
RawTypedData* TypedData::EmptyUint32Array(Thread* thread) { |
ASSERT(thread != NULL); |
Isolate* isolate = thread->isolate(); |
@@ -22836,7 +21531,6 @@ RawTypedData* TypedData::EmptyUint32Array(Thread* thread) { |
return array.raw(); |
} |
- |
const char* TypedData::ToCString() const { |
switch (GetClassId()) { |
#define CASE_TYPED_DATA_CLASS(clazz) \ |
@@ -22848,7 +21542,6 @@ const char* TypedData::ToCString() const { |
return "TypedData"; |
} |
- |
FinalizablePersistentHandle* ExternalTypedData::AddFinalizer( |
void* peer, |
Dart_WeakPersistentHandleFinalizer callback, |
@@ -22856,7 +21549,6 @@ FinalizablePersistentHandle* ExternalTypedData::AddFinalizer( |
return dart::AddFinalizer(*this, peer, callback, external_size); |
} |
- |
RawExternalTypedData* ExternalTypedData::New(intptr_t class_id, |
uint8_t* data, |
intptr_t len, |
@@ -22873,12 +21565,10 @@ RawExternalTypedData* ExternalTypedData::New(intptr_t class_id, |
return result.raw(); |
} |
- |
const char* ExternalTypedData::ToCString() const { |
return "ExternalTypedData"; |
} |
- |
RawCapability* Capability::New(uint64_t id, Heap::Space space) { |
Capability& result = Capability::Handle(); |
{ |
@@ -22891,12 +21581,10 @@ RawCapability* Capability::New(uint64_t id, Heap::Space space) { |
return result.raw(); |
} |
- |
const char* Capability::ToCString() const { |
return "Capability"; |
} |
- |
RawReceivePort* ReceivePort::New(Dart_Port id, |
bool is_control_port, |
Heap::Space space) { |
@@ -22922,17 +21610,14 @@ RawReceivePort* ReceivePort::New(Dart_Port id, |
return result.raw(); |
} |
- |
const char* ReceivePort::ToCString() const { |
return "ReceivePort"; |
} |
- |
RawSendPort* SendPort::New(Dart_Port id, Heap::Space space) { |
return New(id, Isolate::Current()->origin_id(), space); |
} |
- |
RawSendPort* SendPort::New(Dart_Port id, |
Dart_Port origin_id, |
Heap::Space space) { |
@@ -22949,12 +21634,10 @@ RawSendPort* SendPort::New(Dart_Port id, |
return result.raw(); |
} |
- |
const char* SendPort::ToCString() const { |
return "SendPort"; |
} |
- |
const char* Closure::ToCString() const { |
const Function& fun = Function::Handle(function()); |
const bool is_implicit_closure = fun.IsImplicitClosureFunction(); |
@@ -22965,7 +21648,6 @@ const char* Closure::ToCString() const { |
from, fun_desc); |
} |
- |
RawClosure* Closure::New(const TypeArguments& instantiator_type_arguments, |
const TypeArguments& function_type_arguments, |
const Function& function, |
@@ -22987,70 +21669,58 @@ RawClosure* Closure::New(const TypeArguments& instantiator_type_arguments, |
return result.raw(); |
} |
- |
RawClosure* Closure::New() { |
RawObject* raw = |
Object::Allocate(Closure::kClassId, Closure::InstanceSize(), Heap::kOld); |
return reinterpret_cast<RawClosure*>(raw); |
} |
- |
intptr_t StackTrace::Length() const { |
const Array& code_array = Array::Handle(raw_ptr()->code_array_); |
return code_array.Length(); |
} |
- |
RawCode* StackTrace::CodeAtFrame(intptr_t frame_index) const { |
const Array& code_array = Array::Handle(raw_ptr()->code_array_); |
return reinterpret_cast<RawCode*>(code_array.At(frame_index)); |
} |
- |
void StackTrace::SetCodeAtFrame(intptr_t frame_index, const Code& code) const { |
const Array& code_array = Array::Handle(raw_ptr()->code_array_); |
code_array.SetAt(frame_index, code); |
} |
- |
RawSmi* StackTrace::PcOffsetAtFrame(intptr_t frame_index) const { |
const Array& pc_offset_array = Array::Handle(raw_ptr()->pc_offset_array_); |
return reinterpret_cast<RawSmi*>(pc_offset_array.At(frame_index)); |
} |
- |
void StackTrace::SetPcOffsetAtFrame(intptr_t frame_index, |
const Smi& pc_offset) const { |
const Array& pc_offset_array = Array::Handle(raw_ptr()->pc_offset_array_); |
pc_offset_array.SetAt(frame_index, pc_offset); |
} |
- |
void StackTrace::set_async_link(const StackTrace& async_link) const { |
StorePointer(&raw_ptr()->async_link_, async_link.raw()); |
} |
- |
void StackTrace::set_code_array(const Array& code_array) const { |
StorePointer(&raw_ptr()->code_array_, code_array.raw()); |
} |
- |
void StackTrace::set_pc_offset_array(const Array& pc_offset_array) const { |
StorePointer(&raw_ptr()->pc_offset_array_, pc_offset_array.raw()); |
} |
- |
void StackTrace::set_expand_inlined(bool value) const { |
StoreNonPointer(&raw_ptr()->expand_inlined_, value); |
} |
- |
bool StackTrace::expand_inlined() const { |
return raw_ptr()->expand_inlined_; |
} |
- |
RawStackTrace* StackTrace::New(const Array& code_array, |
const Array& pc_offset_array, |
Heap::Space space) { |
@@ -23067,7 +21737,6 @@ RawStackTrace* StackTrace::New(const Array& code_array, |
return result.raw(); |
} |
- |
RawStackTrace* StackTrace::New(const Array& code_array, |
const Array& pc_offset_array, |
const StackTrace& async_link, |
@@ -23086,7 +21755,6 @@ RawStackTrace* StackTrace::New(const Array& code_array, |
return result.raw(); |
} |
- |
static void PrintStackTraceFrame(Zone* zone, |
ZoneTextBuffer* buffer, |
const Function& function, |
@@ -23122,7 +21790,6 @@ static void PrintStackTraceFrame(Zone* zone, |
} |
} |
- |
const char* StackTrace::ToDartCString(const StackTrace& stack_trace_in) { |
Zone* zone = Thread::Current()->zone(); |
StackTrace& stack_trace = StackTrace::Handle(zone, stack_trace_in.raw()); |
@@ -23190,7 +21857,6 @@ const char* StackTrace::ToDartCString(const StackTrace& stack_trace_in) { |
return buffer.buffer(); |
} |
- |
const char* StackTrace::ToDwarfCString(const StackTrace& stack_trace_in) { |
#if defined(DART_PRECOMPILER) || defined(DART_PRECOMPILED_RUNTIME) |
Zone* zone = Thread::Current()->zone(); |
@@ -23264,7 +21930,6 @@ const char* StackTrace::ToDwarfCString(const StackTrace& stack_trace_in) { |
#endif // defined(DART_PRECOMPILER) || defined(DART_PRECOMPILED_RUNTIME) |
} |
- |
const char* StackTrace::ToCString() const { |
#if defined(DART_PRECOMPILER) || defined(DART_PRECOMPILED_RUNTIME) |
if (FLAG_dwarf_stack_traces) { |
@@ -23274,19 +21939,16 @@ const char* StackTrace::ToCString() const { |
return ToDartCString(*this); |
} |
- |
void RegExp::set_pattern(const String& pattern) const { |
StorePointer(&raw_ptr()->pattern_, pattern.raw()); |
} |
- |
void RegExp::set_function(intptr_t cid, |
bool sticky, |
const Function& value) const { |
StorePointer(FunctionAddr(cid, sticky), value.raw()); |
} |
- |
void RegExp::set_bytecode(bool is_one_byte, |
bool sticky, |
const TypedData& bytecode) const { |
@@ -23305,12 +21967,10 @@ void RegExp::set_bytecode(bool is_one_byte, |
} |
} |
- |
void RegExp::set_num_bracket_expressions(intptr_t value) const { |
StoreSmi(&raw_ptr()->num_bracket_expressions_, Smi::New(value)); |
} |
- |
RawRegExp* RegExp::New(Heap::Space space) { |
RegExp& result = RegExp::Handle(); |
{ |
@@ -23325,13 +21985,11 @@ RawRegExp* RegExp::New(Heap::Space space) { |
return result.raw(); |
} |
- |
void* RegExp::GetDataStartAddress() const { |
intptr_t addr = reinterpret_cast<intptr_t>(raw_ptr()); |
return reinterpret_cast<void*>(addr + sizeof(RawRegExp)); |
} |
- |
RawRegExp* RegExp::FromDataStartAddress(void* data) { |
RegExp& regexp = RegExp::Handle(); |
intptr_t addr = reinterpret_cast<intptr_t>(data) - sizeof(RawRegExp); |
@@ -23339,7 +21997,6 @@ RawRegExp* RegExp::FromDataStartAddress(void* data) { |
return regexp.raw(); |
} |
- |
const char* RegExp::Flags() const { |
switch (flags()) { |
case kGlobal | kIgnoreCase | kMultiLine: |
@@ -23357,7 +22014,6 @@ const char* RegExp::Flags() const { |
return ""; |
} |
- |
bool RegExp::CanonicalizeEquals(const Instance& other) const { |
if (this->raw() == other.raw()) { |
return true; // "===". |
@@ -23381,14 +22037,12 @@ bool RegExp::CanonicalizeEquals(const Instance& other) const { |
return true; |
} |
- |
const char* RegExp::ToCString() const { |
const String& str = String::Handle(pattern()); |
return OS::SCreate(Thread::Current()->zone(), "RegExp: pattern=%s flags=%s", |
str.ToCString(), Flags()); |
} |
- |
RawWeakProperty* WeakProperty::New(Heap::Space space) { |
ASSERT(Isolate::Current()->object_store()->weak_property_class() != |
Class::null()); |
@@ -23399,48 +22053,40 @@ RawWeakProperty* WeakProperty::New(Heap::Space space) { |
return result; |
} |
- |
const char* WeakProperty::ToCString() const { |
return "_WeakProperty"; |
} |
- |
RawAbstractType* MirrorReference::GetAbstractTypeReferent() const { |
ASSERT(Object::Handle(referent()).IsAbstractType()); |
return AbstractType::Cast(Object::Handle(referent())).raw(); |
} |
- |
RawClass* MirrorReference::GetClassReferent() const { |
ASSERT(Object::Handle(referent()).IsClass()); |
return Class::Cast(Object::Handle(referent())).raw(); |
} |
- |
RawField* MirrorReference::GetFieldReferent() const { |
ASSERT(Object::Handle(referent()).IsField()); |
return Field::Cast(Object::Handle(referent())).raw(); |
} |
- |
RawFunction* MirrorReference::GetFunctionReferent() const { |
ASSERT(Object::Handle(referent()).IsFunction()); |
return Function::Cast(Object::Handle(referent())).raw(); |
} |
- |
RawLibrary* MirrorReference::GetLibraryReferent() const { |
ASSERT(Object::Handle(referent()).IsLibrary()); |
return Library::Cast(Object::Handle(referent())).raw(); |
} |
- |
RawTypeParameter* MirrorReference::GetTypeParameterReferent() const { |
ASSERT(Object::Handle(referent()).IsTypeParameter()); |
return TypeParameter::Cast(Object::Handle(referent())).raw(); |
} |
- |
RawMirrorReference* MirrorReference::New(const Object& referent, |
Heap::Space space) { |
MirrorReference& result = MirrorReference::Handle(); |
@@ -23454,19 +22100,16 @@ RawMirrorReference* MirrorReference::New(const Object& referent, |
return result.raw(); |
} |
- |
const char* MirrorReference::ToCString() const { |
return "_MirrorReference"; |
} |
- |
void UserTag::MakeActive() const { |
Isolate* isolate = Isolate::Current(); |
ASSERT(isolate != NULL); |
isolate->set_current_tag(*this); |
} |
- |
RawUserTag* UserTag::New(const String& label, Heap::Space space) { |
Thread* thread = Thread::Current(); |
Isolate* isolate = thread->isolate(); |
@@ -23496,7 +22139,6 @@ RawUserTag* UserTag::New(const String& label, Heap::Space space) { |
return result.raw(); |
} |
- |
RawUserTag* UserTag::DefaultTag() { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -23514,7 +22156,6 @@ RawUserTag* UserTag::DefaultTag() { |
return result.raw(); |
} |
- |
RawUserTag* UserTag::FindTagInIsolate(Thread* thread, const String& label) { |
Isolate* isolate = thread->isolate(); |
Zone* zone = thread->zone(); |
@@ -23535,7 +22176,6 @@ RawUserTag* UserTag::FindTagInIsolate(Thread* thread, const String& label) { |
return UserTag::null(); |
} |
- |
void UserTag::AddTagToIsolate(Thread* thread, const UserTag& tag) { |
Isolate* isolate = thread->isolate(); |
Zone* zone = thread->zone(); |
@@ -23561,7 +22201,6 @@ void UserTag::AddTagToIsolate(Thread* thread, const UserTag& tag) { |
tag_table.Add(tag); |
} |
- |
bool UserTag::TagTableIsFull(Thread* thread) { |
Isolate* isolate = thread->isolate(); |
ASSERT(isolate->tag_table() != GrowableObjectArray::null()); |
@@ -23571,7 +22210,6 @@ bool UserTag::TagTableIsFull(Thread* thread) { |
return tag_table.Length() == UserTags::kMaxUserTags; |
} |
- |
RawUserTag* UserTag::FindTagById(uword tag_id) { |
Thread* thread = Thread::Current(); |
Zone* zone = thread->zone(); |
@@ -23589,7 +22227,6 @@ RawUserTag* UserTag::FindTagById(uword tag_id) { |
return UserTag::null(); |
} |
- |
const char* UserTag::ToCString() const { |
const String& tag_label = String::Handle(label()); |
return tag_label.ToCString(); |