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

Side by Side Diff: runtime/vm/intermediate_language_mips.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_ia32.cc ('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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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 1868 matching lines...) Expand 10 before | Expand all | Expand 10 after
1879 1879
1880 1880
1881 void LoadFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1881 void LoadFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1882 Register instance_reg = locs()->in(0).reg(); 1882 Register instance_reg = locs()->in(0).reg();
1883 Register result_reg = locs()->out().reg(); 1883 Register result_reg = locs()->out().reg();
1884 1884
1885 __ lw(result_reg, Address(instance_reg, offset_in_bytes() - kHeapObjectTag)); 1885 __ lw(result_reg, Address(instance_reg, offset_in_bytes() - kHeapObjectTag));
1886 } 1886 }
1887 1887
1888 1888
1889 LocationSummary* InstantiateTypeInstr::MakeLocationSummary() const {
1890 const intptr_t kNumInputs = 1;
1891 const intptr_t kNumTemps = 0;
1892 LocationSummary* locs =
1893 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
1894 locs->set_in(0, Location::RegisterLocation(T0));
1895 locs->set_out(Location::RegisterLocation(T0));
1896 return locs;
1897 }
1898
1899
1900 void InstantiateTypeInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1901 __ TraceSimMsg("InstantiateTypeInstr");
1902 Register instantiator_reg = locs()->in(0).reg();
1903 Register result_reg = locs()->out().reg();
1904
1905 // 'instantiator_reg' is the instantiator AbstractTypeArguments object
1906 // (or null).
1907 // A runtime call to instantiate the type is required.
1908 __ addiu(SP, SP, Immediate(-3 * kWordSize));
1909 __ LoadObject(TMP1, Object::ZoneHandle());
1910 __ sw(TMP1, Address(SP, 2 * kWordSize)); // Make room for the result.
1911 __ LoadObject(TMP1, type());
1912 __ sw(TMP1, Address(SP, 1 * kWordSize));
1913 // Push instantiator type arguments.
1914 __ sw(instantiator_reg, Address(SP, 0 * kWordSize));
1915
1916 compiler->GenerateCallRuntime(token_pos(),
1917 deopt_id(),
1918 kInstantiateTypeRuntimeEntry,
1919 locs());
1920 // Pop instantiated type.
1921 __ lw(result_reg, Address(SP, 2 * kWordSize));
1922 // Drop instantiator and uninstantiated type.
1923 __ addiu(SP, SP, Immediate(3 * kWordSize));
1924 ASSERT(instantiator_reg == result_reg);
1925 }
1926
1927
1889 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary() const { 1928 LocationSummary* InstantiateTypeArgumentsInstr::MakeLocationSummary() const {
1890 const intptr_t kNumInputs = 1; 1929 const intptr_t kNumInputs = 1;
1891 const intptr_t kNumTemps = 0; 1930 const intptr_t kNumTemps = 0;
1892 LocationSummary* locs = 1931 LocationSummary* locs =
1893 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); 1932 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
1894 locs->set_in(0, Location::RegisterLocation(T0)); 1933 locs->set_in(0, Location::RegisterLocation(T0));
1895 locs->set_out(Location::RegisterLocation(T0)); 1934 locs->set_out(Location::RegisterLocation(T0));
1896 return locs; 1935 return locs;
1897 } 1936 }
1898 1937
(...skipping 1834 matching lines...) Expand 10 before | Expand all | Expand 10 after
3733 compiler->GenerateCall(token_pos(), 3772 compiler->GenerateCall(token_pos(),
3734 &label, 3773 &label,
3735 PcDescriptors::kOther, 3774 PcDescriptors::kOther,
3736 locs()); 3775 locs());
3737 __ Drop(2); // Discard type arguments and receiver. 3776 __ Drop(2); // Discard type arguments and receiver.
3738 } 3777 }
3739 3778
3740 } // namespace dart 3779 } // namespace dart
3741 3780
3742 #endif // defined TARGET_ARCH_MIPS 3781 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698