| Index: runtime/vm/object_reload.cc
|
| diff --git a/runtime/vm/object_reload.cc b/runtime/vm/object_reload.cc
|
| index 0429adfcff87cf511223b620800fe736faf5ae5a..a1318b73b3a55e519c2f1f042be8a80dfa1803e9 100644
|
| --- a/runtime/vm/object_reload.cc
|
| +++ b/runtime/vm/object_reload.cc
|
| @@ -58,7 +58,7 @@ void Function::ZeroEdgeCounters() const {
|
|
|
|
|
| void Code::ResetICDatas(Zone* zone) const {
|
| - // Iterate over the Code's object pool and reset all ICDatas.
|
| +// Iterate over the Code's object pool and reset all ICDatas.
|
| #ifdef TARGET_ARCH_IA32
|
| // IA32 does not have an object pool, but, we can iterate over all
|
| // embedded objects by using the variable length data section.
|
| @@ -161,8 +161,7 @@ void Class::CopyCanonicalConstants(const Class& old_cls) const {
|
| return;
|
| }
|
| TIR_Print("Copied %" Pd " canonical constants for class `%s`\n",
|
| - old_constants.Length(),
|
| - ToCString());
|
| + old_constants.Length(), ToCString());
|
| set_constants(old_constants);
|
| }
|
|
|
| @@ -238,8 +237,8 @@ void Class::ReplaceEnum(const Class& old_enum) const {
|
| Instance& old_enum_values = Instance::Handle(zone);
|
| // The E.values array.
|
| Instance& enum_values = Instance::Handle(zone);
|
| - Array& enum_map_storage = Array::Handle(zone,
|
| - HashTables::New<UnorderedHashMap<EnumMapTraits> >(4));
|
| + Array& enum_map_storage =
|
| + Array::Handle(zone, HashTables::New<UnorderedHashMap<EnumMapTraits> >(4));
|
| ASSERT(!enum_map_storage.IsNull());
|
|
|
| TIR_Print("Replacing enum `%s`\n", String::Handle(Name()).ToCString());
|
| @@ -316,8 +315,9 @@ void Class::ReplaceEnum(const Class& old_enum) const {
|
|
|
| if (enums_deleted && FLAG_trace_reload_verbose) {
|
| // TODO(johnmccutchan): Add this to the reload 'notices' list.
|
| - VTIR_Print("The following enum values were deleted and are forever lost in "
|
| - "the heap:\n");
|
| + VTIR_Print(
|
| + "The following enum values were deleted and are forever lost in "
|
| + "the heap:\n");
|
| UnorderedHashMap<EnumMapTraits> enum_map(enum_map_storage.raw());
|
| UnorderedHashMap<EnumMapTraits>::Iterator it(&enum_map);
|
| while (it.MoveNext()) {
|
| @@ -385,8 +385,7 @@ void Class::MigrateImplicitStaticClosures(IsolateReloadContext* irc,
|
| Instance& new_closure = Instance::Handle();
|
| for (intptr_t i = 0; i < funcs.Length(); i++) {
|
| old_func ^= funcs.At(i);
|
| - if (old_func.is_static() &&
|
| - old_func.HasImplicitClosureFunction()) {
|
| + if (old_func.is_static() && old_func.HasImplicitClosureFunction()) {
|
| selector = old_func.name();
|
| new_func = new_cls.LookupFunction(selector);
|
| if (!new_func.IsNull() && new_func.is_static()) {
|
| @@ -407,13 +406,13 @@ void Class::MigrateImplicitStaticClosures(IsolateReloadContext* irc,
|
| class EnumClassConflict : public ClassReasonForCancelling {
|
| public:
|
| EnumClassConflict(Zone* zone, const Class& from, const Class& to)
|
| - : ClassReasonForCancelling(zone, from, to) { }
|
| + : ClassReasonForCancelling(zone, from, to) {}
|
|
|
| RawString* ToString() {
|
| return String::NewFormatted(
|
| from_.is_enum_class()
|
| - ? "Enum class cannot be redefined to be a non-enum class: %s"
|
| - : "Class cannot be redefined to be a enum class: %s",
|
| + ? "Enum class cannot be redefined to be a non-enum class: %s"
|
| + : "Class cannot be redefined to be a enum class: %s",
|
| from_.ToCString());
|
| }
|
| };
|
| @@ -425,28 +424,26 @@ class EnsureFinalizedError : public ClassReasonForCancelling {
|
| const Class& from,
|
| const Class& to,
|
| const Error& error)
|
| - : ClassReasonForCancelling(zone, from, to), error_(error) { }
|
| + : ClassReasonForCancelling(zone, from, to), error_(error) {}
|
|
|
| private:
|
| const Error& error_;
|
|
|
| RawError* ToError() { return error_.raw(); }
|
|
|
| - RawString* ToString() {
|
| - return String::New(error_.ToErrorCString());
|
| - }
|
| + RawString* ToString() { return String::New(error_.ToErrorCString()); }
|
| };
|
|
|
|
|
| class NativeFieldsConflict : public ClassReasonForCancelling {
|
| public:
|
| NativeFieldsConflict(Zone* zone, const Class& from, const Class& to)
|
| - : ClassReasonForCancelling(zone, from, to) { }
|
| + : ClassReasonForCancelling(zone, from, to) {}
|
|
|
| private:
|
| RawString* ToString() {
|
| - return String::NewFormatted(
|
| - "Number of native fields changed in %s", from_.ToCString());
|
| + return String::NewFormatted("Number of native fields changed in %s",
|
| + from_.ToCString());
|
| }
|
| };
|
|
|
| @@ -473,7 +470,7 @@ class TypeParametersChanged : public ClassReasonForCancelling {
|
| };
|
|
|
|
|
| -class PreFinalizedConflict : public ClassReasonForCancelling {
|
| +class PreFinalizedConflict : public ClassReasonForCancelling {
|
| public:
|
| PreFinalizedConflict(Zone* zone, const Class& from, const Class& to)
|
| : ClassReasonForCancelling(zone, from, to) {}
|
| @@ -488,20 +485,18 @@ class PreFinalizedConflict : public ClassReasonForCancelling {
|
| };
|
|
|
|
|
| -class InstanceSizeConflict : public ClassReasonForCancelling {
|
| +class InstanceSizeConflict : public ClassReasonForCancelling {
|
| public:
|
| InstanceSizeConflict(Zone* zone, const Class& from, const Class& to)
|
| : ClassReasonForCancelling(zone, from, to) {}
|
|
|
| private:
|
| RawString* ToString() {
|
| - return String::NewFormatted(
|
| - "Instance size mismatch between '%s' (%" Pd ") and replacement "
|
| - "'%s' ( %" Pd ")",
|
| - from_.ToCString(),
|
| - from_.instance_size(),
|
| - to_.ToCString(),
|
| - to_.instance_size());
|
| + return String::NewFormatted("Instance size mismatch between '%s' (%" Pd
|
| + ") and replacement "
|
| + "'%s' ( %" Pd ")",
|
| + from_.ToCString(), from_.instance_size(),
|
| + to_.ToCString(), to_.instance_size());
|
| }
|
| };
|
|
|
| @@ -537,9 +532,8 @@ void Class::CheckReload(const Class& replacement,
|
|
|
| // Class cannot change enum property.
|
| if (is_enum_class() != replacement.is_enum_class()) {
|
| - context->AddReasonForCancelling(
|
| - new(context->zone())
|
| - EnumClassConflict(context->zone(), *this, replacement));
|
| + context->AddReasonForCancelling(new (context->zone()) EnumClassConflict(
|
| + context->zone(), *this, replacement));
|
| return;
|
| }
|
|
|
| @@ -549,7 +543,7 @@ void Class::CheckReload(const Class& replacement,
|
| Error::Handle(replacement.EnsureIsFinalized(Thread::Current()));
|
| if (!error.IsNull()) {
|
| context->AddReasonForCancelling(
|
| - new(context->zone())
|
| + new (context->zone())
|
| EnsureFinalizedError(context->zone(), *this, replacement, error));
|
| return; // No reason to check other properties.
|
| }
|
| @@ -559,10 +553,9 @@ void Class::CheckReload(const Class& replacement,
|
|
|
| // Native field count cannot change.
|
| if (num_native_fields() != replacement.num_native_fields()) {
|
| - context->AddReasonForCancelling(
|
| - new(context->zone())
|
| - NativeFieldsConflict(context->zone(), *this, replacement));
|
| - return;
|
| + context->AddReasonForCancelling(new (context->zone()) NativeFieldsConflict(
|
| + context->zone(), *this, replacement));
|
| + return;
|
| }
|
|
|
| // Just checking.
|
| @@ -576,18 +569,17 @@ void Class::CheckReload(const Class& replacement,
|
| if (!CanReloadPreFinalized(replacement, context)) return;
|
| }
|
| ASSERT(is_finalized() == replacement.is_finalized());
|
| - TIR_Print("Class `%s` can be reloaded (%" Pd " and %" Pd ")\n",
|
| - ToCString(), id(), replacement.id());
|
| + TIR_Print("Class `%s` can be reloaded (%" Pd " and %" Pd ")\n", ToCString(),
|
| + id(), replacement.id());
|
| }
|
|
|
|
|
| -
|
| bool Class::RequiresInstanceMorphing(const Class& replacement) const {
|
| // Get the field maps for both classes. These field maps walk the class
|
| // hierarchy.
|
| const Array& fields = Array::Handle(OffsetToFieldMap());
|
| - const Array& replacement_fields
|
| - = Array::Handle(replacement.OffsetToFieldMap());
|
| + const Array& replacement_fields =
|
| + Array::Handle(replacement.OffsetToFieldMap());
|
|
|
| // Check that the size of the instance is the same.
|
| if (fields.Length() != replacement_fields.Length()) return true;
|
| @@ -627,15 +619,13 @@ bool Class::CanReloadFinalized(const Class& replacement,
|
| const AbstractType& replacement_dt =
|
| AbstractType::Handle(replacement.DeclarationType());
|
| if (!dt.Equals(replacement_dt)) {
|
| - context->AddReasonForCancelling(
|
| - new(context->zone())
|
| - TypeParametersChanged(context->zone(), *this, replacement));
|
| + context->AddReasonForCancelling(new (context->zone()) TypeParametersChanged(
|
| + context->zone(), *this, replacement));
|
| return false;
|
| }
|
| if (RequiresInstanceMorphing(replacement)) {
|
| - context->AddInstanceMorpher(
|
| - new(context->zone())
|
| - InstanceMorpher(context->zone(), *this, replacement));
|
| + context->AddInstanceMorpher(new (context->zone()) InstanceMorpher(
|
| + context->zone(), *this, replacement));
|
| }
|
| return true;
|
| }
|
| @@ -645,17 +635,15 @@ bool Class::CanReloadPreFinalized(const Class& replacement,
|
| IsolateReloadContext* context) const {
|
| // The replacement class must also prefinalized.
|
| if (!replacement.is_prefinalized()) {
|
| - context->AddReasonForCancelling(
|
| - new(context->zone())
|
| - PreFinalizedConflict(context->zone(), *this, replacement));
|
| - return false;
|
| + context->AddReasonForCancelling(new (context->zone()) PreFinalizedConflict(
|
| + context->zone(), *this, replacement));
|
| + return false;
|
| }
|
| // Check the instance sizes are equal.
|
| if (instance_size() != replacement.instance_size()) {
|
| - context->AddReasonForCancelling(
|
| - new(context->zone())
|
| - InstanceSizeConflict(context->zone(), *this, replacement));
|
| - return false;
|
| + context->AddReasonForCancelling(new (context->zone()) InstanceSizeConflict(
|
| + context->zone(), *this, replacement));
|
| + return false;
|
| }
|
| return true;
|
| }
|
| @@ -672,9 +660,8 @@ void Library::CheckReload(const Library& replacement,
|
| if (prefix.is_deferred_load()) {
|
| const String& prefix_name = String::Handle(prefix.name());
|
| context->AddReasonForCancelling(
|
| - new(context->zone())
|
| - UnimplementedDeferredLibrary(context->zone(),
|
| - *this, replacement, prefix_name));
|
| + new (context->zone()) UnimplementedDeferredLibrary(
|
| + context->zone(), *this, replacement, prefix_name));
|
| return;
|
| }
|
| }
|
| @@ -741,8 +728,7 @@ void ICData::Reset(Zone* zone) const {
|
|
|
| const Array& args_desc_array = Array::Handle(zone, arguments_descriptor());
|
| ArgumentsDescriptor args_desc(args_desc_array);
|
| - if (new_target.IsNull() ||
|
| - !new_target.AreValidArguments(args_desc, NULL)) {
|
| + if (new_target.IsNull() || !new_target.AreValidArguments(args_desc, NULL)) {
|
| // TODO(rmacnak): Patch to a NSME stub.
|
| VTIR_Print("Cannot rebind static call to %s from %s\n",
|
| old_target.ToCString(),
|
| @@ -764,4 +750,4 @@ void ICData::Reset(Zone* zone) const {
|
|
|
| #endif // !PRODUCT
|
|
|
| -} // namespace dart.
|
| +} // namespace dart.
|
|
|