OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 | 648 |
649 LocationSummary* NativeCallComp::MakeLocationSummary() const { | 649 LocationSummary* NativeCallComp::MakeLocationSummary() const { |
650 const intptr_t kNumInputs = 0; | 650 const intptr_t kNumInputs = 0; |
651 const intptr_t kNumTemps = 3; | 651 const intptr_t kNumTemps = 3; |
652 LocationSummary* locs = new LocationSummary(kNumInputs, | 652 LocationSummary* locs = new LocationSummary(kNumInputs, |
653 kNumTemps, | 653 kNumTemps, |
654 LocationSummary::kCall); | 654 LocationSummary::kCall); |
655 locs->set_temp(0, Location::RegisterLocation(EAX)); | 655 locs->set_temp(0, Location::RegisterLocation(EAX)); |
656 locs->set_temp(1, Location::RegisterLocation(ECX)); | 656 locs->set_temp(1, Location::RegisterLocation(ECX)); |
657 locs->set_temp(2, Location::RegisterLocation(EDX)); | 657 locs->set_temp(2, Location::RegisterLocation(EDX)); |
658 locs->set_out(Location::RequiresRegister()); | 658 locs->set_out(Location::RegisterLocation(EAX)); |
659 return locs; | 659 return locs; |
660 } | 660 } |
661 | 661 |
662 | 662 |
663 void NativeCallComp::EmitNativeCode(FlowGraphCompiler* compiler) { | 663 void NativeCallComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
664 ASSERT(locs()->temp(0).reg() == EAX); | 664 ASSERT(locs()->temp(0).reg() == EAX); |
665 ASSERT(locs()->temp(1).reg() == ECX); | 665 ASSERT(locs()->temp(1).reg() == ECX); |
666 ASSERT(locs()->temp(2).reg() == EDX); | 666 ASSERT(locs()->temp(2).reg() == EDX); |
667 Register result = locs()->out().reg(); | 667 Register result = locs()->out().reg(); |
668 | 668 |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1394 const ExternalLabel label("alloc_context", | 1394 const ExternalLabel label("alloc_context", |
1395 StubCode::AllocateContextEntryPoint()); | 1395 StubCode::AllocateContextEntryPoint()); |
1396 compiler->GenerateCall(token_pos(), | 1396 compiler->GenerateCall(token_pos(), |
1397 try_index(), | 1397 try_index(), |
1398 &label, | 1398 &label, |
1399 PcDescriptors::kOther); | 1399 PcDescriptors::kOther); |
1400 } | 1400 } |
1401 | 1401 |
1402 | 1402 |
1403 LocationSummary* CloneContextComp::MakeLocationSummary() const { | 1403 LocationSummary* CloneContextComp::MakeLocationSummary() const { |
1404 return LocationSummary::Make(1, | 1404 const intptr_t kNumInputs = 1; |
1405 Location::RequiresRegister(), | 1405 const intptr_t kNumTemps = 0; |
1406 LocationSummary::kCall); | 1406 LocationSummary* locs = new LocationSummary(kNumInputs, |
| 1407 kNumTemps, |
| 1408 LocationSummary::kCall); |
| 1409 locs->set_in(0, Location::RegisterLocation(EAX)); |
| 1410 locs->set_out(Location::RegisterLocation(EAX)); |
| 1411 return locs; |
1407 } | 1412 } |
1408 | 1413 |
1409 | 1414 |
1410 void CloneContextComp::EmitNativeCode(FlowGraphCompiler* compiler) { | 1415 void CloneContextComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
1411 Register context_value = locs()->in(0).reg(); | 1416 Register context_value = locs()->in(0).reg(); |
1412 Register result = locs()->out().reg(); | 1417 Register result = locs()->out().reg(); |
1413 | 1418 |
1414 __ PushObject(Object::ZoneHandle()); // Make room for the result. | 1419 __ PushObject(Object::ZoneHandle()); // Make room for the result. |
1415 __ pushl(context_value); | 1420 __ pushl(context_value); |
1416 compiler->GenerateCallRuntime(cid(), | 1421 compiler->GenerateCallRuntime(cid(), |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2166 ASSERT(locs()->out().reg() == EAX); | 2171 ASSERT(locs()->out().reg() == EAX); |
2167 __ CompareObject(locs()->out().reg(), compiler->bool_true()); | 2172 __ CompareObject(locs()->out().reg(), compiler->bool_true()); |
2168 EmitBranchOnCondition(compiler, branch_condition); | 2173 EmitBranchOnCondition(compiler, branch_condition); |
2169 } | 2174 } |
2170 | 2175 |
2171 } // namespace dart | 2176 } // namespace dart |
2172 | 2177 |
2173 #undef __ | 2178 #undef __ |
2174 | 2179 |
2175 #endif // defined TARGET_ARCH_X64 | 2180 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |