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

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: refactored liveness computation 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
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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 EmitEqualityAsInstanceCall(compiler, this); 494 EmitEqualityAsInstanceCall(compiler, this);
495 } 495 }
496 } 496 }
497 497
498 498
499 LocationSummary* RelationalOpComp::MakeLocationSummary() const { 499 LocationSummary* RelationalOpComp::MakeLocationSummary() const {
500 if (operands_class_id() == kSmi || operands_class_id() == kDouble) { 500 if (operands_class_id() == kSmi || operands_class_id() == kDouble) {
501 const intptr_t kNumInputs = 2; 501 const intptr_t kNumInputs = 2;
502 const intptr_t kNumTemps = 1; 502 const intptr_t kNumTemps = 1;
503 LocationSummary* summary = new LocationSummary(kNumInputs, 503 LocationSummary* summary = new LocationSummary(kNumInputs,
504 kNumTemps, 504 kNumTemps);
505 LocationSummary::kCall);
506 summary->set_in(0, Location::RequiresRegister()); 505 summary->set_in(0, Location::RequiresRegister());
507 summary->set_in(1, Location::RequiresRegister()); 506 summary->set_in(1, Location::RequiresRegister());
508 summary->set_out(Location::RequiresRegister()); 507 summary->set_out(Location::RequiresRegister());
509 summary->set_temp(0, Location::RequiresRegister()); 508 summary->set_temp(0, Location::RequiresRegister());
510 return summary; 509 return summary;
511 } 510 }
512 ASSERT(operands_class_id() == kObject); 511 ASSERT(operands_class_id() == kObject);
513 return MakeCallSummary(); 512 return MakeCallSummary();
514 } 513 }
515 514
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
1449 } 1448 }
1450 1449
1451 1450
1452 LocationSummary* CheckStackOverflowComp::MakeLocationSummary() const { 1451 LocationSummary* CheckStackOverflowComp::MakeLocationSummary() const {
1453 const intptr_t kNumInputs = 0; 1452 const intptr_t kNumInputs = 0;
1454 const intptr_t kNumTemps = 1; 1453 const intptr_t kNumTemps = 1;
1455 // TODO(vegorov): spilling is required only on an infrequently executed path. 1454 // TODO(vegorov): spilling is required only on an infrequently executed path.
1456 LocationSummary* summary = new LocationSummary(kNumInputs, 1455 LocationSummary* summary = new LocationSummary(kNumInputs,
1457 kNumTemps, 1456 kNumTemps,
1458 LocationSummary::kCall); 1457 LocationSummary::kCall);
1459 summary->set_temp(0, Location::RequiresRegister()); 1458 summary->set_temp(0, Location::RegisterLocation(R10));
srdjan 2012/07/22 15:09:24 Why R10?
Vyacheslav Egorov (Google) 2012/07/24 12:26:42 It should be any fixed register. Replaced with RAX
1460 return summary; 1459 return summary;
1461 } 1460 }
1462 1461
1463 1462
1464 void CheckStackOverflowComp::EmitNativeCode(FlowGraphCompiler* compiler) { 1463 void CheckStackOverflowComp::EmitNativeCode(FlowGraphCompiler* compiler) {
1465 Register temp = locs()->temp(0).reg(); 1464 Register temp = locs()->temp(0).reg();
1466 // Generate stack overflow check. 1465 // Generate stack overflow check.
1467 __ movq(temp, Immediate(Isolate::Current()->stack_limit_address())); 1466 __ movq(temp, Immediate(Isolate::Current()->stack_limit_address()));
1468 __ cmpq(RSP, Address(temp, 0)); 1467 __ cmpq(RSP, Address(temp, 0));
1469 Label no_stack_overflow; 1468 Label no_stack_overflow;
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
2170 ASSERT(locs()->out().reg() == RAX); 2169 ASSERT(locs()->out().reg() == RAX);
2171 __ CompareObject(locs()->out().reg(), compiler->bool_true()); 2170 __ CompareObject(locs()->out().reg(), compiler->bool_true());
2172 EmitBranchOnCondition(compiler, branch_condition); 2171 EmitBranchOnCondition(compiler, branch_condition);
2173 } 2172 }
2174 2173
2175 } // namespace dart 2174 } // namespace dart
2176 2175
2177 #undef __ 2176 #undef __
2178 2177
2179 #endif // defined TARGET_ARCH_X64 2178 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698