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

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 2893553002: More compact string representation on 64 bit. (Closed)
Patch Set: Slava feedback Created 3 years, 7 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_arm64.cc ('k') | runtime/vm/intrinsifier_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_x64.cc
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index 930ace149f1a5932f7b5b079eedd06f45c075df2..a43db626df7386a9aff9c823f83cac42de9747db 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -1498,7 +1498,7 @@ LocationSummary* GuardFieldClassInstr::MakeLocationSummary(Zone* zone,
void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- ASSERT(sizeof(classid_t) == kInt32Size);
+ ASSERT(sizeof(classid_t) == kInt16Size);
const intptr_t value_cid = value()->Type()->ToCid();
const intptr_t field_cid = field().guarded_cid();
const intptr_t nullability = field().is_nullable() ? kNullCid : kIllegalCid;
@@ -1550,13 +1550,13 @@ void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
if (value_cid == kDynamicCid) {
LoadValueCid(compiler, value_cid_reg, value_reg);
- __ cmpl(value_cid_reg, field_cid_operand);
+ __ cmpw(value_cid_reg, field_cid_operand);
__ j(EQUAL, &ok);
- __ cmpl(value_cid_reg, field_nullability_operand);
+ __ cmpw(value_cid_reg, field_nullability_operand);
} else if (value_cid == kNullCid) {
- __ cmpl(field_nullability_operand, Immediate(value_cid));
+ __ cmpw(field_nullability_operand, Immediate(value_cid));
} else {
- __ cmpl(field_cid_operand, Immediate(value_cid));
+ __ cmpw(field_cid_operand, Immediate(value_cid));
}
__ j(EQUAL, &ok);
@@ -1567,16 +1567,16 @@ void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
if (!field().needs_length_check()) {
// Uninitialized field can be handled inline. Check if the
// field is still unitialized.
- __ cmpl(field_cid_operand, Immediate(kIllegalCid));
+ __ cmpw(field_cid_operand, Immediate(kIllegalCid));
__ j(NOT_EQUAL, fail);
if (value_cid == kDynamicCid) {
- __ movl(field_cid_operand, value_cid_reg);
- __ movl(field_nullability_operand, value_cid_reg);
+ __ movw(field_cid_operand, value_cid_reg);
+ __ movw(field_nullability_operand, value_cid_reg);
} else {
ASSERT(field_reg != kNoRegister);
- __ movl(field_cid_operand, Immediate(value_cid));
- __ movl(field_nullability_operand, Immediate(value_cid));
+ __ movw(field_cid_operand, Immediate(value_cid));
+ __ movw(field_nullability_operand, Immediate(value_cid));
}
if (deopt == NULL) {
@@ -1589,7 +1589,7 @@ void GuardFieldClassInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
ASSERT(!compiler->is_optimizing());
__ Bind(fail);
- __ cmpl(FieldAddress(field_reg, Field::guarded_cid_offset()),
+ __ cmpw(FieldAddress(field_reg, Field::guarded_cid_offset()),
Immediate(kDynamicCid));
__ j(EQUAL, &ok);
@@ -1832,7 +1832,7 @@ static void EnsureMutableBox(FlowGraphCompiler* compiler,
void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- ASSERT(sizeof(classid_t) == kInt32Size);
+ ASSERT(sizeof(classid_t) == kInt16Size);
Label skip_store;
Register instance_reg = locs()->in(0).reg();
@@ -1904,7 +1904,7 @@ void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ LoadObject(temp, Field::ZoneHandle(Z, field().Original()));
- __ cmpl(FieldAddress(temp, Field::is_nullable_offset()),
+ __ cmpw(FieldAddress(temp, Field::is_nullable_offset()),
Immediate(kNullCid));
__ j(EQUAL, &store_pointer);
@@ -1912,15 +1912,15 @@ void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ testq(temp2, Immediate(1 << Field::kUnboxingCandidateBit));
__ j(ZERO, &store_pointer);
- __ cmpl(FieldAddress(temp, Field::guarded_cid_offset()),
+ __ cmpw(FieldAddress(temp, Field::guarded_cid_offset()),
Immediate(kDoubleCid));
__ j(EQUAL, &store_double);
- __ cmpl(FieldAddress(temp, Field::guarded_cid_offset()),
+ __ cmpw(FieldAddress(temp, Field::guarded_cid_offset()),
Immediate(kFloat32x4Cid));
__ j(EQUAL, &store_float32x4);
- __ cmpl(FieldAddress(temp, Field::guarded_cid_offset()),
+ __ cmpw(FieldAddress(temp, Field::guarded_cid_offset()),
Immediate(kFloat64x2Cid));
__ j(EQUAL, &store_float64x2);
@@ -2190,7 +2190,7 @@ LocationSummary* LoadFieldInstr::MakeLocationSummary(Zone* zone,
void LoadFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- ASSERT(sizeof(classid_t) == kInt32Size);
+ ASSERT(sizeof(classid_t) == kInt16Size);
Register instance_reg = locs()->in(0).reg();
if (IsUnboxedLoad() && compiler->is_optimizing()) {
XmmRegister result = locs()->out(0).fpu_reg();
@@ -2229,20 +2229,19 @@ void LoadFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ LoadObject(result, Field::ZoneHandle(field()->Original()));
- __ cmpl(FieldAddress(result, Field::is_nullable_offset()),
- Immediate(kNullCid));
+ FieldAddress field_cid_operand(result, Field::guarded_cid_offset());
+ FieldAddress field_nullability_operand(result, Field::is_nullable_offset());
+
+ __ cmpw(field_nullability_operand, Immediate(kNullCid));
__ j(EQUAL, &load_pointer);
- __ cmpl(FieldAddress(result, Field::guarded_cid_offset()),
- Immediate(kDoubleCid));
+ __ cmpw(field_cid_operand, Immediate(kDoubleCid));
__ j(EQUAL, &load_double);
- __ cmpl(FieldAddress(result, Field::guarded_cid_offset()),
- Immediate(kFloat32x4Cid));
+ __ cmpw(field_cid_operand, Immediate(kFloat32x4Cid));
__ j(EQUAL, &load_float32x4);
- __ cmpl(FieldAddress(result, Field::guarded_cid_offset()),
- Immediate(kFloat64x2Cid));
+ __ cmpw(field_cid_operand, Immediate(kFloat64x2Cid));
__ j(EQUAL, &load_float64x2);
// Fall through.
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/intrinsifier_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698