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

Side by Side Diff: runtime/vm/intermediate_language_ia32.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.h ('k') | runtime/vm/intermediate_language_x64.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_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
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 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 1582 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
1583 locs->set_in(0, Location::RegisterLocation(ECX)); 1583 locs->set_in(0, Location::RegisterLocation(ECX));
1584 locs->set_out(Location::RegisterLocation(EAX)); 1584 locs->set_out(Location::RegisterLocation(EAX));
1585 return locs; 1585 return locs;
1586 } 1586 }
1587 1587
1588 1588
1589 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1589 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1590 // Allocate the array. EDX = length, ECX = element type. 1590 // Allocate the array. EDX = length, ECX = element type.
1591 ASSERT(locs()->in(0).reg() == ECX); 1591 ASSERT(locs()->in(0).reg() == ECX);
1592 __ movl(EDX, Immediate(Smi::RawValue(ArgumentCount()))); 1592 __ movl(EDX, Immediate(Smi::RawValue(num_elements())));
1593 compiler->GenerateCall(token_pos(), 1593 compiler->GenerateCall(token_pos(),
1594 &StubCode::AllocateArrayLabel(), 1594 &StubCode::AllocateArrayLabel(),
1595 PcDescriptors::kOther, 1595 PcDescriptors::kOther,
1596 locs()); 1596 locs());
1597 ASSERT(locs()->out().reg() == EAX); 1597 ASSERT(locs()->out().reg() == EAX);
1598
1599 // Pop the element values from the stack into the array.
1600 __ leal(EDX, FieldAddress(EAX, Array::data_offset()));
1601 for (int i = ArgumentCount() - 1; i >= 0; --i) {
1602 __ popl(Address(EDX, i * kWordSize));
1603 }
1604 } 1598 }
1605 1599
1606 1600
1607 LocationSummary* 1601 LocationSummary*
1608 AllocateObjectWithBoundsCheckInstr::MakeLocationSummary() const { 1602 AllocateObjectWithBoundsCheckInstr::MakeLocationSummary() const {
1609 const intptr_t kNumInputs = 2; 1603 const intptr_t kNumInputs = 2;
1610 const intptr_t kNumTemps = 0; 1604 const intptr_t kNumTemps = 0;
1611 LocationSummary* locs = 1605 LocationSummary* locs =
1612 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 1606 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
1613 locs->set_in(0, Location::RegisterLocation(EAX)); 1607 locs->set_in(0, Location::RegisterLocation(EAX));
(...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after
3418 PcDescriptors::kOther, 3412 PcDescriptors::kOther,
3419 locs()); 3413 locs());
3420 __ Drop(2); // Discard type arguments and receiver. 3414 __ Drop(2); // Discard type arguments and receiver.
3421 } 3415 }
3422 3416
3423 } // namespace dart 3417 } // namespace dart
3424 3418
3425 #undef __ 3419 #undef __
3426 3420
3427 #endif // defined TARGET_ARCH_IA32 3421 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698