| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6828 const intptr_t kNumTemps = 0; | 6829 const intptr_t kNumTemps = 0; |
| 6829 LocationSummary* summary = new (zone) | 6830 LocationSummary* summary = new (zone) |
| 6830 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall); | 6831 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
| 6831 summary->set_in(0, Location::RegisterLocation(EAX)); // Function. | 6832 summary->set_in(0, Location::RegisterLocation(EAX)); // Function. |
| 6832 summary->set_out(0, Location::RegisterLocation(EAX)); | 6833 summary->set_out(0, Location::RegisterLocation(EAX)); |
| 6833 return summary; | 6834 return summary; |
| 6834 } | 6835 } |
| 6835 | 6836 |
| 6836 | 6837 |
| 6837 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6838 void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 6838 // Load arguments descriptors. | 6839 // Load arguments descriptor. |
| 6839 intptr_t argument_count = ArgumentCount(); | 6840 const intptr_t argument_count = ArgumentCount(); // Includes type args. |
| 6840 const Array& arguments_descriptor = Array::ZoneHandle( | 6841 const Array& arguments_descriptor = |
| 6841 ArgumentsDescriptor::New(argument_count, argument_names())); | 6842 Array::ZoneHandle(Z, GetArgumentsDescriptor()); |
| 6842 __ LoadObject(EDX, arguments_descriptor); | 6843 __ LoadObject(EDX, arguments_descriptor); |
| 6843 | 6844 |
| 6844 // EBX: Code (compiled code or lazy compile stub). | 6845 // EBX: Code (compiled code or lazy compile stub). |
| 6845 ASSERT(locs()->in(0).reg() == EAX); | 6846 ASSERT(locs()->in(0).reg() == EAX); |
| 6846 __ movl(EBX, FieldAddress(EAX, Function::entry_point_offset())); | 6847 __ movl(EBX, FieldAddress(EAX, Function::entry_point_offset())); |
| 6847 | 6848 |
| 6848 // EAX: Function. | 6849 // EAX: Function. |
| 6849 // EDX: Arguments descriptor array. | 6850 // EDX: Arguments descriptor array. |
| 6850 // ECX: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). | 6851 // ECX: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). |
| 6851 __ xorl(ECX, ECX); | 6852 __ xorl(ECX, ECX); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6932 __ Drop(1); | 6933 __ Drop(1); |
| 6933 __ popl(result); | 6934 __ popl(result); |
| 6934 } | 6935 } |
| 6935 | 6936 |
| 6936 | 6937 |
| 6937 } // namespace dart | 6938 } // namespace dart |
| 6938 | 6939 |
| 6939 #undef __ | 6940 #undef __ |
| 6940 | 6941 |
| 6941 #endif // defined TARGET_ARCH_IA32 | 6942 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |