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

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

Issue 18801007: Support type parameters and classes as expression in the vm. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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.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 1823 matching lines...) Expand 10 before | Expand all | Expand 10 after
1834 1834
1835 1835
1836 void LoadFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1836 void LoadFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1837 Register instance_reg = locs()->in(0).reg(); 1837 Register instance_reg = locs()->in(0).reg();
1838 Register result_reg = locs()->out().reg(); 1838 Register result_reg = locs()->out().reg();
1839 1839
1840 __ movq(result_reg, FieldAddress(instance_reg, offset_in_bytes())); 1840 __ movq(result_reg, FieldAddress(instance_reg, offset_in_bytes()));
1841 } 1841 }
1842 1842
1843 1843
1844 LocationSummary* InstantiateTypeInstr::MakeLocationSummary() const {
1845 const intptr_t kNumInputs = 1;
1846 const intptr_t kNumTemps = 0;
1847 LocationSummary* locs =
1848 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
1849 locs->set_in(0, Location::RegisterLocation(RAX));
1850 locs->set_out(Location::RegisterLocation(RAX));
1851 return locs;
1852 }
1853
1854
1855 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1856 Register instantiator_reg = locs()->in(0).reg();
1857 Register result_reg = locs()->out().reg();
1858
1859 // 'instantiator_reg' is the instantiator AbstractTypeArguments object
1860 // (or null).
1861 // A runtime call to instantiate the type is required.
1862 __ PushObject(Object::ZoneHandle()); // Make room for the result.
1863 __ PushObject(type());
1864 __ pushq(instantiator_reg); // Push instantiator type arguments.
1865 compiler->GenerateCallRuntime(token_pos(),
1866 deopt_id(),
1867 kInstantiateTypeRuntimeEntry,
1868 locs());
1869 __ Drop(2); // Drop instantiator and uninstantiated type.
1870 __ popq(result_reg); // Pop instantiated type.
1871 ASSERT(instantiator_reg == result_reg);
1872 }
1873
1874
1844 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary() const { 1875 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary() const {
1845 const intptr_t kNumInputs = 1; 1876 const intptr_t kNumInputs = 1;
1846 const intptr_t kNumTemps = 0; 1877 const intptr_t kNumTemps = 0;
1847 LocationSummary* locs = 1878 LocationSummary* locs =
1848 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 1879 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
1849 locs->set_in(0, Location::RegisterLocation(RAX)); 1880 locs->set_in(0, Location::RegisterLocation(RAX));
1850 locs->set_out(Location::RegisterLocation(RAX)); 1881 locs->set_out(Location::RegisterLocation(RAX));
1851 return locs; 1882 return locs;
1852 } 1883 }
1853 1884
(...skipping 2563 matching lines...) Expand 10 before | Expand all | Expand 10 after
4417 PcDescriptors::kOther, 4448 PcDescriptors::kOther,
4418 locs()); 4449 locs());
4419 __ Drop(2); // Discard type arguments and receiver. 4450 __ Drop(2); // Discard type arguments and receiver.
4420 } 4451 }
4421 4452
4422 } // namespace dart 4453 } // namespace dart
4423 4454
4424 #undef __ 4455 #undef __
4425 4456
4426 #endif // defined TARGET_ARCH_X64 4457 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698