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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 10540040: Inline setters, getters, various cleanups & restructuring. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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/intermediate_language.h ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
===================================================================
--- runtime/vm/intermediate_language.cc (revision 8404)
+++ runtime/vm/intermediate_language.cc (working copy)
@@ -37,6 +37,14 @@
#undef DEFINE_ACCEPT
+// Truee iff. the v2 is above v1 on stack, or one of them is constant.
+static bool VerifyValues(Value* v1, Value* v2) {
+ ASSERT(v1->IsUse() && v2->IsUse());
+ return (v1->AsUse()->definition()->temp_index() + 1) ==
+ v2->AsUse()->definition()->temp_index();
+}
+
+
// Default implementation of visiting basic blocks. Can be overridden.
void FlowGraphVisitor::VisitBlocks() {
for (intptr_t i = 0; i < block_order_.length(); ++i) {
@@ -616,14 +624,6 @@
}
-// Truee iff. the v2 is above v1 on stack, or one of them is constant.
-static bool VerifyValues(Value* v1, Value* v2) {
- ASSERT(v1->IsUse() && v2->IsUse());
- return (v1->AsUse()->definition()->temp_index() + 1) ==
- v2->AsUse()->definition()->temp_index();
-}
-
-
#define __ compiler->assembler()->
void GraphEntryInstr::PrepareEntry(FlowGraphCompiler* compiler) {
@@ -645,6 +645,43 @@
}
+LocationSummary* StoreInstanceFieldComp::MakeLocationSummary() const {
+ const intptr_t kNumInputs = 2;
+ intptr_t num_temps = (class_ids() == NULL) ? 0 : 1;
+ LocationSummary* summary = new LocationSummary(kNumInputs, num_temps);
+ summary->set_in(0, Location::RequiresRegister());
+ summary->set_in(1, Location::RequiresRegister());
+ if (class_ids() != NULL) {
+ summary->set_temp(0, Location::RequiresRegister());
+ }
+ return summary;
+}
+
+
+void StoreInstanceFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
+ ASSERT(VerifyValues(instance(), value()));
+ Register instance = locs()->in(0).reg();
+ Register value = locs()->in(1).reg();
+
+ if (class_ids() != NULL) {
+ ASSERT(original() != NULL);
+ Label* deopt = compiler->AddDeoptStub(original()->cid(),
+ original()->token_index(),
+ original()->try_index(),
+ kDeoptInstanceGetterSameTarget,
+ instance,
+ value);
+ // Smis do not have instance fields (Smi class is always first).
+ Register temp = locs()->temp(0).reg();
+ ASSERT(temp != instance);
+ ASSERT(temp != value);
+ compiler->EmitClassChecksNoSmi(*class_ids(), instance, temp, deopt);
+ }
+ __ StoreIntoObject(instance, FieldAddress(instance, field().Offset()),
+ value);
+}
+
+
LocationSummary* ThrowInstr::MakeLocationSummary() const {
const int kNumInputs = 0;
const int kNumTemps = 0;
@@ -842,25 +879,6 @@
}
-LocationSummary* StoreInstanceFieldComp::MakeLocationSummary() const {
- return LocationSummary::Make(2, Location::RequiresRegister());
-}
-
-
-void StoreInstanceFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) {
- ASSERT(VerifyValues(instance(), value()));
- Register instance = locs()->in(0).reg();
- Register value = locs()->in(1).reg();
- Register result = locs()->out().reg();
-
- __ StoreIntoObject(instance, FieldAddress(instance, field().Offset()),
- value);
- // TODO(fschneider): Consider eliminating this move by specifying a
- // SameAsSecondInput for the result.
- __ MoveRegister(result, value);
-}
-
-
LocationSummary* StoreStaticFieldComp::MakeLocationSummary() const {
LocationSummary* locs = new LocationSummary(1, 1);
locs->set_in(0, Location::RequiresRegister());
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698