Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: runtime/vm/class_finalizer.cc

Issue 1888593003: Revert "- Use a hash table to canonicalize instances/arrays to avoid having to iterate over a linea… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/integers.cc ('k') | runtime/vm/dart_entry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_finalizer.cc
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index 81cd85c1e7a4657a6e62c1f0724d35e602e16c01..1a7f6cf2fb3f07d134bbc0b5c43c512577f239d3 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -2519,22 +2519,20 @@ void ClassFinalizer::FinalizeClass(const Class& cls) {
// values field. We also don't have to generate the code for these getters
// from thin air (no source code is available).
void ClassFinalizer::AllocateEnumValues(const Class &enum_cls) {
- Thread* thread = Thread::Current();
- Zone* zone = thread->zone();
const Field& index_field =
- Field::Handle(zone, enum_cls.LookupInstanceField(Symbols::Index()));
+ Field::Handle(enum_cls.LookupInstanceField(Symbols::Index()));
ASSERT(!index_field.IsNull());
const Field& values_field =
- Field::Handle(zone, enum_cls.LookupStaticField(Symbols::Values()));
+ Field::Handle(enum_cls.LookupStaticField(Symbols::Values()));
ASSERT(!values_field.IsNull());
- ASSERT(Instance::Handle(zone, values_field.StaticValue()).IsArray());
+ ASSERT(Instance::Handle(values_field.StaticValue()).IsArray());
Array& values_list = Array::Handle(
- zone, Array::RawCast(values_field.StaticValue()));
+ Array::RawCast(values_field.StaticValue()));
- const Array& fields = Array::Handle(zone, enum_cls.fields());
- Field& field = Field::Handle(zone);
- Instance& ordinal_value = Instance::Handle(zone);
- Instance& enum_value = Instance::Handle(zone);
+ const Array& fields = Array::Handle(enum_cls.fields());
+ Field& field = Field::Handle();
+ Instance& ordinal_value = Instance::Handle();
+ Instance& enum_value = Instance::Handle();
for (intptr_t i = 0; i < fields.Length(); i++) {
field = Field::RawCast(fields.At(i));
@@ -2547,7 +2545,7 @@ void ClassFinalizer::AllocateEnumValues(const Class &enum_cls) {
enum_value = Instance::New(enum_cls, Heap::kOld);
enum_value.SetField(index_field, ordinal_value);
const char* error_msg = "";
- enum_value = enum_value.CheckAndCanonicalize(thread, &error_msg);
+ enum_value = enum_value.CheckAndCanonicalize(&error_msg);
ASSERT(!enum_value.IsNull());
ASSERT(enum_value.IsCanonical());
field.SetStaticValue(enum_value, true);
@@ -2558,7 +2556,7 @@ void ClassFinalizer::AllocateEnumValues(const Class &enum_cls) {
}
values_list.MakeImmutable();
const char* error_msg = NULL;
- values_list ^= values_list.CheckAndCanonicalize(thread, &error_msg);
+ values_list ^= values_list.CheckAndCanonicalize(&error_msg);
ASSERT(!values_list.IsNull());
}
« no previous file with comments | « runtime/lib/integers.cc ('k') | runtime/vm/dart_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698