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

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

Issue 10800037: New linear scan allocator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address Kevin's comments Created 8 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/locations.h » ('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) 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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 EmitEqualityAsInstanceCall(compiler, this); 495 EmitEqualityAsInstanceCall(compiler, this);
496 } 496 }
497 } 497 }
498 498
499 499
500 LocationSummary* RelationalOpComp::MakeLocationSummary() const { 500 LocationSummary* RelationalOpComp::MakeLocationSummary() const {
501 if (operands_class_id() == kSmi || operands_class_id() == kDouble) { 501 if (operands_class_id() == kSmi || operands_class_id() == kDouble) {
502 const intptr_t kNumInputs = 2; 502 const intptr_t kNumInputs = 2;
503 const intptr_t kNumTemps = 1; 503 const intptr_t kNumTemps = 1;
504 LocationSummary* summary = new LocationSummary(kNumInputs, 504 LocationSummary* summary = new LocationSummary(kNumInputs,
505 kNumTemps, 505 kNumTemps);
506 LocationSummary::kCall);
507 summary->set_in(0, Location::RequiresRegister()); 506 summary->set_in(0, Location::RequiresRegister());
508 summary->set_in(1, Location::RequiresRegister()); 507 summary->set_in(1, Location::RequiresRegister());
509 summary->set_out(Location::RequiresRegister()); 508 summary->set_out(Location::RequiresRegister());
510 summary->set_temp(0, Location::RequiresRegister()); 509 summary->set_temp(0, Location::RequiresRegister());
511 return summary; 510 return summary;
512 } 511 }
513 ASSERT(operands_class_id() == kObject); 512 ASSERT(operands_class_id() == kObject);
514 return MakeCallSummary(); 513 return MakeCallSummary();
515 } 514 }
516 515
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 656
658 LocationSummary* NativeCallComp::MakeLocationSummary() const { 657 LocationSummary* NativeCallComp::MakeLocationSummary() const {
659 const intptr_t kNumInputs = 0; 658 const intptr_t kNumInputs = 0;
660 const intptr_t kNumTemps = 3; 659 const intptr_t kNumTemps = 3;
661 LocationSummary* locs = new LocationSummary(kNumInputs, 660 LocationSummary* locs = new LocationSummary(kNumInputs,
662 kNumTemps, 661 kNumTemps,
663 LocationSummary::kCall); 662 LocationSummary::kCall);
664 locs->set_temp(0, Location::RegisterLocation(RAX)); 663 locs->set_temp(0, Location::RegisterLocation(RAX));
665 locs->set_temp(1, Location::RegisterLocation(RBX)); 664 locs->set_temp(1, Location::RegisterLocation(RBX));
666 locs->set_temp(2, Location::RegisterLocation(R10)); 665 locs->set_temp(2, Location::RegisterLocation(R10));
667 locs->set_out(Location::RequiresRegister()); 666 locs->set_out(Location::RegisterLocation(RAX));
668 return locs; 667 return locs;
669 } 668 }
670 669
671 670
672 void NativeCallComp::EmitNativeCode(FlowGraphCompiler* compiler) { 671 void NativeCallComp::EmitNativeCode(FlowGraphCompiler* compiler) {
673 ASSERT(locs()->temp(0).reg() == RAX); 672 ASSERT(locs()->temp(0).reg() == RAX);
674 ASSERT(locs()->temp(1).reg() == RBX); 673 ASSERT(locs()->temp(1).reg() == RBX);
675 ASSERT(locs()->temp(2).reg() == R10); 674 ASSERT(locs()->temp(2).reg() == R10);
676 Register result = locs()->out().reg(); 675 Register result = locs()->out().reg();
677 676
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 const ExternalLabel label("alloc_context", 1396 const ExternalLabel label("alloc_context",
1398 StubCode::AllocateContextEntryPoint()); 1397 StubCode::AllocateContextEntryPoint());
1399 compiler->GenerateCall(token_pos(), 1398 compiler->GenerateCall(token_pos(),
1400 try_index(), 1399 try_index(),
1401 &label, 1400 &label,
1402 PcDescriptors::kOther); 1401 PcDescriptors::kOther);
1403 } 1402 }
1404 1403
1405 1404
1406 LocationSummary* CloneContextComp::MakeLocationSummary() const { 1405 LocationSummary* CloneContextComp::MakeLocationSummary() const {
1407 return LocationSummary::Make(1, 1406 const intptr_t kNumInputs = 1;
1408 Location::RequiresRegister(), 1407 const intptr_t kNumTemps = 0;
1409 LocationSummary::kCall); 1408 LocationSummary* locs = new LocationSummary(kNumInputs,
1409 kNumTemps,
1410 LocationSummary::kCall);
1411 locs->set_in(0, Location::RegisterLocation(RAX));
1412 locs->set_out(Location::RegisterLocation(RAX));
1413 return locs;
1410 } 1414 }
1411 1415
1412 1416
1413 void CloneContextComp::EmitNativeCode(FlowGraphCompiler* compiler) { 1417 void CloneContextComp::EmitNativeCode(FlowGraphCompiler* compiler) {
1414 Register context_value = locs()->in(0).reg(); 1418 Register context_value = locs()->in(0).reg();
1415 Register result = locs()->out().reg(); 1419 Register result = locs()->out().reg();
1416 1420
1417 __ PushObject(Object::ZoneHandle()); // Make room for the result. 1421 __ PushObject(Object::ZoneHandle()); // Make room for the result.
1418 __ pushq(context_value); 1422 __ pushq(context_value);
1419 compiler->GenerateCallRuntime(cid(), 1423 compiler->GenerateCallRuntime(cid(),
(...skipping 30 matching lines...) Expand all
1450 } 1454 }
1451 1455
1452 1456
1453 LocationSummary* CheckStackOverflowComp::MakeLocationSummary() const { 1457 LocationSummary* CheckStackOverflowComp::MakeLocationSummary() const {
1454 const intptr_t kNumInputs = 0; 1458 const intptr_t kNumInputs = 0;
1455 const intptr_t kNumTemps = 1; 1459 const intptr_t kNumTemps = 1;
1456 // TODO(vegorov): spilling is required only on an infrequently executed path. 1460 // TODO(vegorov): spilling is required only on an infrequently executed path.
1457 LocationSummary* summary = new LocationSummary(kNumInputs, 1461 LocationSummary* summary = new LocationSummary(kNumInputs,
1458 kNumTemps, 1462 kNumTemps,
1459 LocationSummary::kCall); 1463 LocationSummary::kCall);
1460 summary->set_temp(0, Location::RequiresRegister()); 1464 // All registers are blocked for a call. Instructions marked at calls can use
1465 // only fixed register temps.
1466 summary->set_temp(0, Location::RegisterLocation(RAX));
1461 return summary; 1467 return summary;
1462 } 1468 }
1463 1469
1464 1470
1465 void CheckStackOverflowComp::EmitNativeCode(FlowGraphCompiler* compiler) { 1471 void CheckStackOverflowComp::EmitNativeCode(FlowGraphCompiler* compiler) {
1466 Register temp = locs()->temp(0).reg(); 1472 Register temp = locs()->temp(0).reg();
1467 // Generate stack overflow check. 1473 // Generate stack overflow check.
1468 __ movq(temp, Immediate(Isolate::Current()->stack_limit_address())); 1474 __ movq(temp, Immediate(Isolate::Current()->stack_limit_address()));
1469 __ cmpq(RSP, Address(temp, 0)); 1475 __ cmpq(RSP, Address(temp, 0));
1470 Label no_stack_overflow; 1476 Label no_stack_overflow;
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
2171 ASSERT(locs()->out().reg() == RAX); 2177 ASSERT(locs()->out().reg() == RAX);
2172 __ CompareObject(locs()->out().reg(), compiler->bool_true()); 2178 __ CompareObject(locs()->out().reg(), compiler->bool_true());
2173 EmitBranchOnCondition(compiler, branch_condition); 2179 EmitBranchOnCondition(compiler, branch_condition);
2174 } 2180 }
2175 2181
2176 } // namespace dart 2182 } // namespace dart
2177 2183
2178 #undef __ 2184 #undef __
2179 2185
2180 #endif // defined TARGET_ARCH_X64 2186 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/locations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698