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

Unified Diff: runtime/vm/dart_entry.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/vm/class_finalizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_entry.cc
diff --git a/runtime/vm/dart_entry.cc b/runtime/vm/dart_entry.cc
index ec881ea7f9813f075909d0164089fa729e395dcf..ea55b49e9f7eeaa6d5ca9d714ebfddeb2cd9617f 100644
--- a/runtime/vm/dart_entry.cc
+++ b/runtime/vm/dart_entry.cc
@@ -322,26 +322,23 @@ RawArray* ArgumentsDescriptor::New(intptr_t num_arguments,
// argument count; the positional argument count; a sequence of (name,
// position) pairs, sorted by name, for each named optional argument; and
// a terminating null to simplify iterating in generated code.
- Thread* thread = Thread::Current();
- Zone* zone = thread->zone();
const intptr_t descriptor_len = LengthFor(num_named_args);
- Array& descriptor = Array::Handle(
- zone, Array::New(descriptor_len, Heap::kOld));
+ Array& descriptor = Array::Handle(Array::New(descriptor_len, Heap::kOld));
// Set total number of passed arguments.
descriptor.SetAt(kCountIndex, Smi::Handle(Smi::New(num_arguments)));
// Set number of positional arguments.
descriptor.SetAt(kPositionalCountIndex, Smi::Handle(Smi::New(num_pos_args)));
// Set alphabetically sorted entries for named arguments.
- String& name = String::Handle(zone);
- Smi& pos = Smi::Handle(zone);
- String& previous_name = String::Handle(zone);
- Smi& previous_pos = Smi::Handle(zone);
+ String& name = String::Handle();
+ Smi& pos = Smi::Handle();
for (intptr_t i = 0; i < num_named_args; i++) {
name ^= optional_arguments_names.At(i);
pos = Smi::New(num_pos_args + i);
intptr_t insert_index = kFirstNamedEntryIndex + (kNamedEntrySize * i);
// Shift already inserted pairs with "larger" names.
+ String& previous_name = String::Handle();
+ Smi& previous_pos = Smi::Handle();
while (insert_index > kFirstNamedEntryIndex) {
intptr_t previous_index = insert_index - kNamedEntrySize;
previous_name ^= descriptor.At(previous_index + kNameOffset);
@@ -362,7 +359,7 @@ RawArray* ArgumentsDescriptor::New(intptr_t num_arguments,
// Share the immutable descriptor when possible by canonicalizing it.
descriptor.MakeImmutable();
- descriptor ^= descriptor.CheckAndCanonicalize(thread, NULL);
+ descriptor ^= descriptor.CheckAndCanonicalize(NULL);
ASSERT(!descriptor.IsNull());
return descriptor.raw();
}
@@ -382,12 +379,9 @@ RawArray* ArgumentsDescriptor::NewNonCached(intptr_t num_arguments,
// Build the arguments descriptor array, which consists of the total
// argument count; the positional argument count; and
// a terminating null to simplify iterating in generated code.
- Thread* thread = Thread::Current();
- Zone* zone = thread->zone();
const intptr_t descriptor_len = LengthFor(0);
- Array& descriptor = Array::Handle(
- zone, Array::New(descriptor_len, Heap::kOld));
- const Smi& arg_count = Smi::Handle(zone, Smi::New(num_arguments));
+ Array& descriptor = Array::Handle(Array::New(descriptor_len, Heap::kOld));
+ const Smi& arg_count = Smi::Handle(Smi::New(num_arguments));
// Set total number of passed arguments.
descriptor.SetAt(kCountIndex, arg_count);
@@ -401,7 +395,7 @@ RawArray* ArgumentsDescriptor::NewNonCached(intptr_t num_arguments,
// Share the immutable descriptor when possible by canonicalizing it.
descriptor.MakeImmutable();
if (canonicalize) {
- descriptor ^= descriptor.CheckAndCanonicalize(thread, NULL);
+ descriptor ^= descriptor.CheckAndCanonicalize(NULL);
}
ASSERT(!descriptor.IsNull());
return descriptor.raw();
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698