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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 1320673012: Lookup getter/setter symbols before alllocating them, thus eliminating extra String allocations in … (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Formatting Created 5 years, 3 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/ast.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 7f4a862d317a2557328a3d2f18d630ac96b8f64d..e70d96b97d5264a49ef9d0aad6bfc2444e503b57 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -1683,13 +1683,15 @@ RawInteger* BinaryIntegerOpInstr::Evaluate(const Integer& left,
case Token::kSHL:
case Token::kSHR:
if (left.IsSmi() && right.IsSmi() && (Smi::Cast(right).Value() >= 0)) {
- result = Smi::Cast(left).ShiftOp(op_kind(), Smi::Cast(right));
+ result = Smi::Cast(left).ShiftOp(op_kind(),
+ Smi::Cast(right),
+ Heap::kOld);
}
break;
case Token::kBIT_AND:
case Token::kBIT_OR:
case Token::kBIT_XOR: {
- result = left.BitOp(op_kind(), right);
+ result = left.BitOp(op_kind(), right, Heap::kOld);
break;
}
case Token::kDIV:
@@ -3459,7 +3461,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, String::New(cstr)));
+ pieces.SetAt(store_index, String::Handle(zone, Symbols::New(cstr)));
} else if (obj.IsBool()) {
pieces.SetAt(store_index,
Bool::Cast(obj).value() ? Symbols::True() : Symbols::False());
« no previous file with comments | « runtime/vm/ast.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698