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

Side by Side Diff: runtime/vm/intermediate_language_x64.cc

Issue 132163005: Version 1.1.0-dev.5.7 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/dart/
Patch Set: Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 Register field_reg = needs_field_temp_reg ? 1203 Register field_reg = needs_field_temp_reg ?
1204 locs()->temp(locs()->temp_count() - 1).reg() : kNoRegister; 1204 locs()->temp(locs()->temp_count() - 1).reg() : kNoRegister;
1205 1205
1206 Label ok, fail_label; 1206 Label ok, fail_label;
1207 1207
1208 Label* deopt = compiler->is_optimizing() ? 1208 Label* deopt = compiler->is_optimizing() ?
1209 compiler->AddDeoptStub(deopt_id(), kDeoptGuardField) : NULL; 1209 compiler->AddDeoptStub(deopt_id(), kDeoptGuardField) : NULL;
1210 1210
1211 Label* fail = (deopt != NULL) ? deopt : &fail_label; 1211 Label* fail = (deopt != NULL) ? deopt : &fail_label;
1212 1212
1213 const bool ok_is_fall_through = (deopt != NULL);
1214
1215 if (!compiler->is_optimizing() || (field_cid == kIllegalCid)) { 1213 if (!compiler->is_optimizing() || (field_cid == kIllegalCid)) {
1216 if (!compiler->is_optimizing() && (field_reg == kNoRegister)) { 1214 if (!compiler->is_optimizing() && (field_reg == kNoRegister)) {
1217 // Currently we can't have different location summaries for optimized 1215 // Currently we can't have different location summaries for optimized
1218 // and non-optimized code. So instead we manually pick up a register 1216 // and non-optimized code. So instead we manually pick up a register
1219 // that is known to be free because we know how non-optimizing compiler 1217 // that is known to be free because we know how non-optimizing compiler
1220 // allocates registers. 1218 // allocates registers.
1221 field_reg = RBX; 1219 field_reg = RBX;
1222 ASSERT((field_reg != value_reg) && (field_reg != value_cid_reg)); 1220 ASSERT((field_reg != value_reg) && (field_reg != value_cid_reg));
1223 } 1221 }
1224 1222
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 // Destroy value_cid_reg (safe because we are finished with it). 1400 // Destroy value_cid_reg (safe because we are finished with it).
1403 __ movq(value_cid_reg, 1401 __ movq(value_cid_reg,
1404 FieldAddress(value_reg, TypedData::length_offset())); 1402 FieldAddress(value_reg, TypedData::length_offset()));
1405 __ movq(field_length_operand, value_cid_reg); 1403 __ movq(field_length_operand, value_cid_reg);
1406 } else { 1404 } else {
1407 __ LoadImmediate(field_length_operand, 1405 __ LoadImmediate(field_length_operand,
1408 Immediate(Smi::RawValue(Field::kNoFixedLength)), PP); 1406 Immediate(Smi::RawValue(Field::kNoFixedLength)), PP);
1409 } 1407 }
1410 } 1408 }
1411 } 1409 }
1412 if (!ok_is_fall_through) {
1413 __ jmp(&ok);
1414 }
1415 1410
1416 if (deopt == NULL) { 1411 if (deopt == NULL) {
1417 ASSERT(!compiler->is_optimizing()); 1412 ASSERT(!compiler->is_optimizing());
1413 __ jmp(&ok);
1418 __ Bind(fail); 1414 __ Bind(fail);
1419 1415
1420 __ CompareImmediate(FieldAddress(field_reg, Field::guarded_cid_offset()), 1416 __ CompareImmediate(FieldAddress(field_reg, Field::guarded_cid_offset()),
1421 Immediate(kDynamicCid), PP); 1417 Immediate(kDynamicCid), PP);
1422 __ j(EQUAL, &ok); 1418 __ j(EQUAL, &ok);
1423 1419
1424 __ pushq(field_reg); 1420 __ pushq(field_reg);
1425 __ pushq(value_reg); 1421 __ pushq(value_reg);
1426 __ CallRuntime(kUpdateFieldCidRuntimeEntry, 2); 1422 __ CallRuntime(kUpdateFieldCidRuntimeEntry, 2);
1427 __ Drop(2); // Drop the field and the value. 1423 __ Drop(2); // Drop the field and the value.
1428 } 1424 }
1429 } else { 1425 } else {
1430 ASSERT(compiler->is_optimizing()); 1426 ASSERT(compiler->is_optimizing());
1431 ASSERT(deopt != NULL); 1427 ASSERT(deopt != NULL);
1432 ASSERT(ok_is_fall_through);
1433 // Field guard class has been initialized and is known. 1428 // Field guard class has been initialized and is known.
1434 if (field_reg != kNoRegister) { 1429 if (field_reg != kNoRegister) {
1435 __ LoadObject(field_reg, Field::ZoneHandle(field().raw()), PP); 1430 __ LoadObject(field_reg, Field::ZoneHandle(field().raw()), PP);
1436 } 1431 }
1437 1432
1438 if (value_cid == kDynamicCid) { 1433 if (value_cid == kDynamicCid) {
1439 // Field's guarded class id is fixed but value's class id is not known. 1434 // Field's guarded class id is fixed but value's class id is not known.
1440 __ testq(value_reg, Immediate(kSmiTagMask)); 1435 __ testq(value_reg, Immediate(kSmiTagMask));
1441 1436
1442 if (field_cid != kSmiCid) { 1437 if (field_cid != kSmiCid) {
(...skipping 3518 matching lines...) Expand 10 before | Expand all | Expand 10 after
4961 PcDescriptors::kOther, 4956 PcDescriptors::kOther,
4962 locs()); 4957 locs());
4963 __ Drop(2); // Discard type arguments and receiver. 4958 __ Drop(2); // Discard type arguments and receiver.
4964 } 4959 }
4965 4960
4966 } // namespace dart 4961 } // namespace dart
4967 4962
4968 #undef __ 4963 #undef __
4969 4964
4970 #endif // defined TARGET_ARCH_X64 4965 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698