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

Unified Diff: runtime/vm/assembler_x64.cc

Issue 552303005: Fix StoreIndexedInstr input representation requirements for Int32/Uint32 arrays. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix typo Created 6 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
Index: runtime/vm/assembler_x64.cc
diff --git a/runtime/vm/assembler_x64.cc b/runtime/vm/assembler_x64.cc
index 3d4e9ff8240c9dbfc15ba15c7ccf2a5e8c30f82c..2c63e6bb2a54d66f3e4138ddb982d4da7194a9b6 100644
--- a/runtime/vm/assembler_x64.cc
+++ b/runtime/vm/assembler_x64.cc
@@ -3432,6 +3432,25 @@ void Assembler::CompareClassId(Register object, intptr_t class_id) {
}
+void Assembler::SmiUntagOrCheckClass(Register object,
+ intptr_t class_id,
+ Label* is_smi) {
+ ASSERT(kSmiTagShift == 1);
+ ASSERT(RawObject::kClassIdTagPos == 16);
+ ASSERT(RawObject::kClassIdTagSize == 16);
+ const intptr_t class_id_offset = Object::tags_offset() +
+ RawObject::kClassIdTagPos / kBitsPerByte;
+
+ // Untag optimistically. Tag bit is shifted into the CARRY.
+ SmiUntag(object);
+ j(NOT_CARRY, is_smi, kNearJump);
+ // Load cid: can't use LoadClassId, object is untagged. Use TIMES_2 scale
+ // factor in the addressing mode to compensate for this.
+ movzxw(TMP, Address(object, TIMES_2, class_id_offset));
+ cmpl(TMP, Immediate(class_id));
+}
+
+
void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) {
ASSERT(result != object);

Powered by Google App Engine
This is Rietveld 408576698