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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 1873143003: - Use a hash table to canonicalize instances/arrays to avoid having to iterate over a linear list a… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address-code-review 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
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index c68f277692311605272ee04f5a0cced09fcf3624..7aacdc535fdea704cb30483a320815198247b5a5 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -1651,12 +1651,14 @@ static bool IsRepresentable(const Integer& value, Representation rep) {
RawInteger* UnaryIntegerOpInstr::Evaluate(const Integer& value) const {
- Integer& result = Integer::Handle();
+ Thread* thread = Thread::Current();
+ Zone* zone = thread->zone();
+ Integer& result = Integer::Handle(zone);
switch (op_kind()) {
case Token::kNEGATE:
result = value.ArithmeticOp(Token::kMUL,
- Smi::Handle(Smi::New(-1)),
+ Smi::Handle(zone, Smi::New(-1)),
Heap::kOld);
break;
@@ -1680,7 +1682,7 @@ RawInteger* UnaryIntegerOpInstr::Evaluate(const Integer& value) const {
// specialized instructions that use this value under this assumption.
return Integer::null();
}
- result ^= result.CheckAndCanonicalize(NULL);
+ result ^= result.CheckAndCanonicalize(thread, NULL);
}
return result.raw();
@@ -1689,7 +1691,9 @@ RawInteger* UnaryIntegerOpInstr::Evaluate(const Integer& value) const {
RawInteger* BinaryIntegerOpInstr::Evaluate(const Integer& left,
const Integer& right) const {
- Integer& result = Integer::Handle();
+ Thread* thread = Thread::Current();
+ Zone* zone = thread->zone();
+ Integer& result = Integer::Handle(zone);
switch (op_kind()) {
case Token::kTRUNCDIV:
@@ -1738,7 +1742,7 @@ RawInteger* BinaryIntegerOpInstr::Evaluate(const Integer& left,
// specialized instructions that use this value under this assumption.
return Integer::null();
}
- result ^= result.CheckAndCanonicalize(NULL);
+ result ^= result.CheckAndCanonicalize(thread, NULL);
}
return result.raw();
« no previous file with comments | « runtime/vm/dart_entry.cc ('k') | runtime/vm/object.h » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698