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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 1870343002: - Refactor Symbol allocation to expect a thread parameter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review feedback. 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/heap_test.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 8b23f064021a276b5616da96d985e280b2d47f6c..723b1ab426a0d55598e419f025fe101917102f1f 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -3052,8 +3052,8 @@ void InstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT(call_ic_data->NumArgsTested() == 2);
const String& name = String::Handle(zone, call_ic_data->target_name());
const Class& smi_class = Class::Handle(zone, Smi::Class());
- const Function& smi_op_target =
- Function::Handle(Resolver::ResolveDynamicAnyArgs(smi_class, name));
+ const Function& smi_op_target = Function::Handle(zone,
+ Resolver::ResolveDynamicAnyArgs(zone, smi_class, name));
if (call_ic_data->NumberOfChecks() == 0) {
GrowableArray<intptr_t> class_ids(2);
class_ids.Add(kSmiCid);
@@ -3480,7 +3480,8 @@ Definition* StringInterpolateInstr::Canonicalize(FlowGraph* flow_graph) {
return this;
}
const intptr_t length = Smi::Cast(num_elements->BoundConstant()).Value();
- Zone* zone = Thread::Current()->zone();
+ Thread* thread = Thread::Current();
+ Zone* zone = thread->zone();
GrowableHandlePtrArray<const String> pieces(zone, length);
for (intptr_t i = 0; i < length; i++) {
pieces.Add(Object::null_string());
@@ -3508,7 +3509,7 @@ Definition* StringInterpolateInstr::Canonicalize(FlowGraph* flow_graph) {
pieces.SetAt(store_index, String::Cast(obj));
} else if (obj.IsSmi()) {
const char* cstr = obj.ToCString();
- pieces.SetAt(store_index, String::Handle(zone, Symbols::New(cstr)));
+ pieces.SetAt(store_index, String::Handle(zone, String::New(cstr)));
} else if (obj.IsBool()) {
pieces.SetAt(store_index,
Bool::Cast(obj).value() ? Symbols::True() : Symbols::False());
@@ -3522,9 +3523,8 @@ Definition* StringInterpolateInstr::Canonicalize(FlowGraph* flow_graph) {
}
}
- ASSERT(pieces.length() == length);
const String& concatenated = String::ZoneHandle(zone,
- Symbols::FromConcatAll(pieces));
+ Symbols::FromConcatAll(thread, pieces));
return flow_graph->GetConstant(concatenated);
}
« no previous file with comments | « runtime/vm/heap_test.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698