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

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

Issue 12212050: Fix allocation of array tables (use store barrier if needed, store values directly instead of via s… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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_ia32.cc ('k') | runtime/vm/parser.h » ('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 "lib/error.h" 10 #include "lib/error.h"
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after
1419 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 1419 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
1420 locs->set_in(0, Location::RegisterLocation(RBX)); 1420 locs->set_in(0, Location::RegisterLocation(RBX));
1421 locs->set_out(Location::RegisterLocation(RAX)); 1421 locs->set_out(Location::RegisterLocation(RAX));
1422 return locs; 1422 return locs;
1423 } 1423 }
1424 1424
1425 1425
1426 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1426 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1427 // Allocate the array. R10 = length, RBX = element type. 1427 // Allocate the array. R10 = length, RBX = element type.
1428 ASSERT(locs()->in(0).reg() == RBX); 1428 ASSERT(locs()->in(0).reg() == RBX);
1429 __ movq(R10, Immediate(Smi::RawValue(ArgumentCount()))); 1429 __ movq(R10, Immediate(Smi::RawValue(num_elements())));
1430 compiler->GenerateCall(token_pos(), 1430 compiler->GenerateCall(token_pos(),
1431 &StubCode::AllocateArrayLabel(), 1431 &StubCode::AllocateArrayLabel(),
1432 PcDescriptors::kOther, 1432 PcDescriptors::kOther,
1433 locs()); 1433 locs());
1434 ASSERT(locs()->out().reg() == RAX); 1434 ASSERT(locs()->out().reg() == RAX);
1435
1436 // Pop the element values from the stack into the array.
1437 __ leaq(R10, FieldAddress(RAX, Array::data_offset()));
1438 for (int i = ArgumentCount() - 1; i >= 0; --i) {
1439 __ popq(Address(R10, i * kWordSize));
1440 }
1441 } 1435 }
1442 1436
1443 1437
1444 LocationSummary* 1438 LocationSummary*
1445 AllocateObjectWithBoundsCheckInstr::MakeLocationSummary() const { 1439 AllocateObjectWithBoundsCheckInstr::MakeLocationSummary() const {
1446 const intptr_t kNumInputs = 2; 1440 const intptr_t kNumInputs = 2;
1447 const intptr_t kNumTemps = 0; 1441 const intptr_t kNumTemps = 0;
1448 LocationSummary* locs = 1442 LocationSummary* locs =
1449 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 1443 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
1450 locs->set_in(0, Location::RegisterLocation(RAX)); 1444 locs->set_in(0, Location::RegisterLocation(RAX));
(...skipping 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after
3045 PcDescriptors::kOther, 3039 PcDescriptors::kOther,
3046 locs()); 3040 locs());
3047 __ Drop(2); // Discard type arguments and receiver. 3041 __ Drop(2); // Discard type arguments and receiver.
3048 } 3042 }
3049 3043
3050 } // namespace dart 3044 } // namespace dart
3051 3045
3052 #undef __ 3046 #undef __
3053 3047
3054 #endif // defined TARGET_ARCH_X64 3048 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698