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

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: sync and work in progress 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 kTypeArgsLen = 0;
943 const int kNumberOfArguments = 1; 944 const int kNumberOfArguments = 1;
944 const Array& kNoArgumentNames = Object::null_array(); 945 const Array& kNoArgumentNames = Object::null_array();
946 ArgumentsInfo args_info(kTypeArgsLen, kNumberOfArguments, kNoArgumentNames);
945 compiler->GenerateStaticCall(deopt_id(), token_pos(), CallFunction(), 947 compiler->GenerateStaticCall(deopt_id(), token_pos(), CallFunction(),
946 kNumberOfArguments, kNoArgumentNames, locs(), 948 args_info, locs(), ICData::Handle());
947 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 4416 matching lines...) Expand 10 before | Expand all | Expand 10 after
5374 __ cmpl(result, Immediate(0xC0000000)); 5375 __ cmpl(result, Immediate(0xC0000000));
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 const int kTypeArgsLen = 0;
5385 const intptr_t kNumberOfArguments = 1; 5386 const int kNumberOfArguments = 1;
5387 const Array& kNoArgumentNames = Object::null_array();
5388 ArgumentsInfo args_info(kTypeArgsLen, kNumberOfArguments, kNoArgumentNames);
5386 compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), target, 5389 compiler->GenerateStaticCall(deopt_id(), instance_call()->token_pos(), target,
5387 kNumberOfArguments, 5390 args_info, locs(), ICData::Handle());
5388 Object::null_array(), // No argument names.
5389 locs(), ICData::Handle());
5390 __ Bind(&done); 5391 __ Bind(&done);
5391 } 5392 }
5392 5393
5393 5394
5394 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Zone* zone, 5395 LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Zone* zone,
5395 bool opt) const { 5396 bool opt) const {
5396 const intptr_t kNumInputs = 1; 5397 const intptr_t kNumInputs = 1;
5397 const intptr_t kNumTemps = 0; 5398 const intptr_t kNumTemps = 0;
5398 LocationSummary* result = new (zone) 5399 LocationSummary* result = new (zone)
5399 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); 5400 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
(...skipping 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after
6849 const intptr_t kNumTemps = 0; 6850 const intptr_t kNumTemps = 0;
6850 LocationSummary* summary = new (zone) 6851 LocationSummary* summary = new (zone)
6851 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall); 6852 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall);
6852 summary->set_in(0, Location::RegisterLocation(EAX)); // Function. 6853 summary->set_in(0, Location::RegisterLocation(EAX)); // Function.
6853 summary->set_out(0, Location::RegisterLocation(EAX)); 6854 summary->set_out(0, Location::RegisterLocation(EAX));
6854 return summary; 6855 return summary;
6855 } 6856 }
6856 6857
6857 6858
6858 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 6859 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
6859 // Load arguments descriptors. 6860 // Load arguments descriptor.
6860 intptr_t argument_count = ArgumentCount(); 6861 const intptr_t argument_count = ArgumentCount(); // Includes type args.
6861 const Array& arguments_descriptor = Array::ZoneHandle( 6862 const Array& arguments_descriptor = GetArgumentsDescriptor(Z);
6862 ArgumentsDescriptor::New(argument_count, argument_names()));
6863 __ LoadObject(EDX, arguments_descriptor); 6863 __ LoadObject(EDX, arguments_descriptor);
6864 6864
6865 // EBX: Code (compiled code or lazy compile stub). 6865 // EBX: Code (compiled code or lazy compile stub).
6866 ASSERT(locs()->in(0).reg() == EAX); 6866 ASSERT(locs()->in(0).reg() == EAX);
6867 __ movl(EBX, FieldAddress(EAX, Function::entry_point_offset())); 6867 __ movl(EBX, FieldAddress(EAX, Function::entry_point_offset()));
6868 6868
6869 // EAX: Function. 6869 // EAX: Function.
6870 // EDX: Arguments descriptor array. 6870 // EDX: Arguments descriptor array.
6871 // ECX: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). 6871 // ECX: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value).
6872 __ xorl(ECX, ECX); 6872 __ xorl(ECX, ECX);
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
6953 __ Drop(1); 6953 __ Drop(1);
6954 __ popl(result); 6954 __ popl(result);
6955 } 6955 }
6956 6956
6957 6957
6958 } // namespace dart 6958 } // namespace dart
6959 6959
6960 #undef __ 6960 #undef __
6961 6961
6962 #endif // defined TARGET_ARCH_IA32 6962 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698