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

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

Issue 2859673002: Pass type argument vector to generic functions (if --reify-generic-functions is (Closed)
Patch Set: Created 3 years, 7 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
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 "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall); 933 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
934 summary->set_in(0, Location::RegisterLocation(EAX)); 934 summary->set_in(0, Location::RegisterLocation(EAX));
935 summary->set_out(0, Location::RegisterLocation(EAX)); 935 summary->set_out(0, Location::RegisterLocation(EAX));
936 return summary; 936 return summary;
937 } 937 }
938 938
939 939
940 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 940 void StringInterpolateInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
941 Register array = locs()->in(0).reg(); 941 Register array = locs()->in(0).reg();
942 __ pushl(array); 942 __ pushl(array);
943 const int kNumberOfArguments = 1; 943 const intptr_t kTypeArgsLen = 0;
944 const intptr_t kNumberOfArguments = 1;
944 const Array& kNoArgumentNames = Object::null_array(); 945 const Array& kNoArgumentNames = Object::null_array();
945 compiler->GenerateStaticCall(deopt_id(), token_pos(), CallFunction(), 946 compiler->GenerateStaticCall(deopt_id(), token_pos(), CallFunction(),
946 kNumberOfArguments, kNoArgumentNames, locs(), 947 kTypeArgsLen, kNumberOfArguments,
947 ICData::Handle()); 948 kNoArgumentNames, locs(), ICData::Handle());
948 ASSERT(locs()->out(0).reg() == EAX); 949 ASSERT(locs()->out(0).reg() == EAX);
949 } 950 }
950 951
951 952
952 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Zone* zone, 953 LocationSummary* LoadUntaggedInstr::MakeLocationSummary(Zone* zone,
953 bool opt) const { 954 bool opt) const {
954 const intptr_t kNumInputs = 1; 955 const intptr_t kNumInputs = 1;
955 return LocationSummary::Make(zone, kNumInputs, Location::SameAsFirstInput(), 956 return LocationSummary::Make(zone, kNumInputs, Location::SameAsFirstInput(),
956 LocationSummary::kNoCall); 957 LocationSummary::kNoCall);
957 } 958 }
(...skipping 4417 matching lines...) Expand 10 before | Expand all | Expand 10 after
5375 __ j(NEGATIVE, &do_call, Assembler::kNearJump); 5376 __ j(NEGATIVE, &do_call, Assembler::kNearJump);
5376 __ SmiTag(result); 5377 __ SmiTag(result);
5377 __ jmp(&done); 5378 __ jmp(&done);
5378 __ Bind(&do_call); 5379 __ Bind(&do_call);
5379 __ pushl(value_obj); 5380 __ pushl(value_obj);
5380 ASSERT(instance_call()->HasICData()); 5381 ASSERT(instance_call()->HasICData());
5381 const ICData& ic_data = *instance_call()->ic_data(); 5382 const ICData& ic_data = *instance_call()->ic_data();
5382 ASSERT(ic_data.NumberOfChecksIs(1)); 5383 ASSERT(ic_data.NumberOfChecksIs(1));
5383 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0)); 5384 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0));
5384 5385
5386 const intptr_t kTypeArgsLen = 0;
5385 const intptr_t kNumberOfArguments = 1; 5387 const intptr_t kNumberOfArguments = 1;
5386 compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), target, 5388 compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), target,
5387 kNumberOfArguments, 5389 kTypeArgsLen, kNumberOfArguments,
5388 Object::null_array(), // No argument names. 5390 Object::null_array(), // No argument names.
5389 locs(), ICData::Handle()); 5391 locs(), ICData::Handle());
5390 __ Bind(&done); 5392 __ Bind(&done);
5391 } 5393 }
5392 5394
5393 5395
5394 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Zone* zone, 5396 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Zone* zone,
5395 bool opt) const { 5397 bool opt) const {
5396 const intptr_t kNumInputs = 1; 5398 const intptr_t kNumInputs = 1;
5397 const intptr_t kNumTemps = 0; 5399 const intptr_t kNumTemps = 0;
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after
6850 LocationSummary* summary = new (zone) 6852 LocationSummary* summary = new (zone)
6851 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall); 6853 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
6852 summary->set_in(0, Location::RegisterLocation(EAX)); // Function. 6854 summary->set_in(0, Location::RegisterLocation(EAX)); // Function.
6853 summary->set_out(0, Location::RegisterLocation(EAX)); 6855 summary->set_out(0, Location::RegisterLocation(EAX));
6854 return summary; 6856 return summary;
6855 } 6857 }
6856 6858
6857 6859
6858 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 6860 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
6859 // Load arguments descriptors. 6861 // Load arguments descriptors.
6860 intptr_t argument_count = ArgumentCount(); 6862 const intptr_t ta_len = type_args_len();
6861 const Array& arguments_descriptor = Array::ZoneHandle( 6863 const intptr_t argument_count = ArgumentCount(); // Includes type args.
6862 ArgumentsDescriptor::New(argument_count, argument_names())); 6864 const Array& arguments_descriptor =
6865 Array::ZoneHandle(ArgumentsDescriptor::New(
6866 ta_len, argument_count - (ta_len > 0 ? 1 : 0), argument_names()));
6863 __ LoadObject(EDX, arguments_descriptor); 6867 __ LoadObject(EDX, arguments_descriptor);
6864 6868
6865 // EBX: Code (compiled code or lazy compile stub). 6869 // EBX: Code (compiled code or lazy compile stub).
6866 ASSERT(locs()->in(0).reg() == EAX); 6870 ASSERT(locs()->in(0).reg() == EAX);
6867 __ movl(EBX, FieldAddress(EAX, Function::entry_point_offset())); 6871 __ movl(EBX, FieldAddress(EAX, Function::entry_point_offset()));
6868 6872
6869 // EAX: Function. 6873 // EAX: Function.
6870 // EDX: Arguments descriptor array. 6874 // EDX: Arguments descriptor array.
6871 // ECX: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). 6875 // ECX: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value).
6872 __ xorl(ECX, ECX); 6876 __ xorl(ECX, ECX);
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
6953 __ Drop(1); 6957 __ Drop(1);
6954 __ popl(result); 6958 __ popl(result);
6955 } 6959 }
6956 6960
6957 6961
6958 } // namespace dart 6962 } // namespace dart
6959 6963
6960 #undef __ 6964 #undef __
6961 6965
6962 #endif // defined TARGET_ARCH_IA32 6966 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698