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

Side by Side Diff: runtime/vm/intermediate_language_ia32.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_arm.cc ('k') | runtime/vm/intermediate_language_mips.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 1841 matching lines...) Expand 10 before | Expand all | Expand 10 after
1852 1852
1853 1853
1854 void LoadFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1854 void LoadFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1855 Register instance_reg = locs()->in(0).reg(); 1855 Register instance_reg = locs()->in(0).reg();
1856 Register result_reg = locs()->out().reg(); 1856 Register result_reg = locs()->out().reg();
1857 1857
1858 __ movl(result_reg, FieldAddress(instance_reg, offset_in_bytes())); 1858 __ movl(result_reg, FieldAddress(instance_reg, offset_in_bytes()));
1859 } 1859 }
1860 1860
1861 1861
1862 LocationSummary* InstantiateTypeInstr::MakeLocationSummary() const {
1863 const intptr_t kNumInputs = 1;
1864 const intptr_t kNumTemps = 0;
1865 LocationSummary* locs =
1866 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
1867 locs->set_in(0, Location::RegisterLocation(EAX));
1868 locs->set_out(Location::RegisterLocation(EAX));
1869 return locs;
1870 }
1871
1872
1873 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1874 Register instantiator_reg = locs()->in(0).reg();
1875 Register result_reg = locs()->out().reg();
1876
1877 // 'instantiator_reg' is the instantiator AbstractTypeArguments object
1878 // (or null).
1879 // A runtime call to instantiate the type is required.
1880 __ PushObject(Object::ZoneHandle()); // Make room for the result.
1881 __ PushObject(type());
1882 __ pushl(instantiator_reg); // Push instantiator type arguments.
1883 compiler->GenerateCallRuntime(token_pos(),
1884 deopt_id(),
1885 kInstantiateTypeRuntimeEntry,
1886 locs());
1887 __ Drop(2); // Drop instantiator and uninstantiated type.
1888 __ popl(result_reg); // Pop instantiated type.
1889 ASSERT(instantiator_reg == result_reg);
1890 }
1891
1892
1862 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary() const { 1893 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary() const {
1863 const intptr_t kNumInputs = 1; 1894 const intptr_t kNumInputs = 1;
1864 const intptr_t kNumTemps = 0; 1895 const intptr_t kNumTemps = 0;
1865 LocationSummary* locs = 1896 LocationSummary* locs =
1866 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 1897 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
1867 locs->set_in(0, Location::RegisterLocation(EAX)); 1898 locs->set_in(0, Location::RegisterLocation(EAX));
1868 locs->set_out(Location::RegisterLocation(EAX)); 1899 locs->set_out(Location::RegisterLocation(EAX));
1869 return locs; 1900 return locs;
1870 } 1901 }
1871 1902
(...skipping 2875 matching lines...) Expand 10 before | Expand all | Expand 10 after
4747 PcDescriptors::kOther, 4778 PcDescriptors::kOther,
4748 locs()); 4779 locs());
4749 __ Drop(2); // Discard type arguments and receiver. 4780 __ Drop(2); // Discard type arguments and receiver.
4750 } 4781 }
4751 4782
4752 } // namespace dart 4783 } // namespace dart
4753 4784
4754 #undef __ 4785 #undef __
4755 4786
4756 #endif // defined TARGET_ARCH_IA32 4787 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698