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

Unified Diff: runtime/vm/intermediate_language_ia32.cc

Issue 104583002: Small cleanup and more test coverage for guarded fields. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_ia32.cc
===================================================================
--- runtime/vm/intermediate_language_ia32.cc (revision 30852)
+++ runtime/vm/intermediate_language_ia32.cc (working copy)
@@ -1494,7 +1494,24 @@
if (!ok_is_fall_through) {
__ jmp(&ok);
}
+
+ if (deopt == NULL) {
+ ASSERT(!compiler->is_optimizing());
+ __ Bind(fail);
+
+ __ cmpl(FieldAddress(field_reg, Field::guarded_cid_offset()),
+ Immediate(kDynamicCid));
+ __ j(EQUAL, &ok);
+
+ __ pushl(field_reg);
+ __ pushl(value_reg);
+ __ CallRuntime(kUpdateFieldCidRuntimeEntry, 2);
+ __ Drop(2); // Drop the field and the value.
+ }
} else {
+ ASSERT(compiler->is_optimizing());
+ ASSERT(deopt != NULL);
+ ASSERT(ok_is_fall_through);
// Field guard class has been initialized and is known.
if (field_reg != kNoRegister) {
__ LoadObject(field_reg, Field::ZoneHandle(field().raw()));
@@ -1537,18 +1554,11 @@
Immediate(reinterpret_cast<intptr_t>(Object::null()));
__ cmpl(value_reg, raw_null);
}
-
- if (ok_is_fall_through) {
- __ j(NOT_EQUAL, fail);
- } else {
- __ j(EQUAL, &ok);
- }
+ __ j(NOT_EQUAL, fail);
} else {
// Both value's and field's class id is known.
if ((value_cid != field_cid) && (value_cid != nullability)) {
- if (ok_is_fall_through) {
- __ jmp(fail);
- }
+ __ jmp(fail);
} else if (field_has_length && (value_cid == field_cid)) {
ASSERT(value_cid_reg != kNoRegister);
if ((field_cid == kArrayCid) || (field_cid == kImmutableArrayCid)) {
@@ -1561,31 +1571,12 @@
FieldAddress(value_reg, TypedData::length_offset()));
}
__ cmpl(value_cid_reg, Immediate(Smi::RawValue(field_length)));
- if (ok_is_fall_through) {
- __ j(NOT_EQUAL, fail);
- }
+ __ j(NOT_EQUAL, fail);
} else {
- // Nothing to emit.
- ASSERT(!compiler->is_optimizing());
- return;
+ UNREACHABLE();
}
}
}
-
- if (deopt == NULL) {
- ASSERT(!compiler->is_optimizing());
- __ Bind(fail);
-
- __ cmpl(FieldAddress(field_reg, Field::guarded_cid_offset()),
- Immediate(kDynamicCid));
- __ j(EQUAL, &ok);
-
- __ pushl(field_reg);
- __ pushl(value_reg);
- __ CallRuntime(kUpdateFieldCidRuntimeEntry, 2);
- __ Drop(2); // Drop the field and the value.
- }
-
__ Bind(&ok);
}
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698