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

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

Issue 11358052: Various little cleanups to avoid excessive allocation of handles. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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/object.cc » ('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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 __ LoadClassId(temp, left); 446 __ LoadClassId(temp, left);
447 __ Bind(&done); 447 __ Bind(&done);
448 } else { 448 } else {
449 __ j(ZERO, deopt); // Smi deopts. 449 __ j(ZERO, deopt); // Smi deopts.
450 __ LoadClassId(temp, left); 450 __ LoadClassId(temp, left);
451 } 451 }
452 // 'temp' contains class-id of the left argument. 452 // 'temp' contains class-id of the left argument.
453 ObjectStore* object_store = Isolate::Current()->object_store(); 453 ObjectStore* object_store = Isolate::Current()->object_store();
454 Condition cond = TokenKindToSmiCondition(kind); 454 Condition cond = TokenKindToSmiCondition(kind);
455 Label done; 455 Label done;
456 for (intptr_t i = 0; i < ic_data.NumberOfChecks(); i++) { 456 const intptr_t len = ic_data.NumberOfChecks();
457 for (intptr_t i = 0; i < len; i++) {
457 // Assert that the Smi is at position 0, if at all. 458 // Assert that the Smi is at position 0, if at all.
458 ASSERT((ic_data.GetReceiverClassIdAt(i) != kSmiCid) || (i == 0)); 459 ASSERT((ic_data.GetReceiverClassIdAt(i) != kSmiCid) || (i == 0));
459 Label next_test; 460 Label next_test;
460 __ cmpq(temp, Immediate(ic_data.GetReceiverClassIdAt(i))); 461 __ cmpq(temp, Immediate(ic_data.GetReceiverClassIdAt(i)));
461 __ j(NOT_EQUAL, &next_test); 462 __ j(NOT_EQUAL, &next_test);
462 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(i)); 463 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(i));
463 if (target.Owner() == object_store->object_class()) { 464 if (target.Owner() == object_store->object_class()) {
464 // Object.== is same as ===. 465 // Object.== is same as ===.
465 __ Drop(2); 466 __ Drop(2);
466 __ cmpq(left, right); 467 __ cmpq(left, right);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 // 'left' is not Smi. 531 // 'left' is not Smi.
531 const Immediate raw_null = 532 const Immediate raw_null =
532 Immediate(reinterpret_cast<intptr_t>(Object::null())); 533 Immediate(reinterpret_cast<intptr_t>(Object::null()));
533 Label identity_compare; 534 Label identity_compare;
534 __ cmpq(right, raw_null); 535 __ cmpq(right, raw_null);
535 __ j(EQUAL, &identity_compare); 536 __ j(EQUAL, &identity_compare);
536 __ cmpq(left, raw_null); 537 __ cmpq(left, raw_null);
537 __ j(EQUAL, &identity_compare); 538 __ j(EQUAL, &identity_compare);
538 539
539 __ LoadClassId(temp, left); 540 __ LoadClassId(temp, left);
540 for (intptr_t i = 0; i < ic_data.NumberOfChecks(); i++) { 541 const intptr_t len = ic_data.NumberOfChecks();
542 for (intptr_t i = 0; i < len; i++) {
541 __ cmpq(temp, Immediate(ic_data.GetReceiverClassIdAt(i))); 543 __ cmpq(temp, Immediate(ic_data.GetReceiverClassIdAt(i)));
542 if (i == (ic_data.NumberOfChecks() - 1)) { 544 if (i == (len - 1)) {
543 __ j(NOT_EQUAL, deopt); 545 __ j(NOT_EQUAL, deopt);
544 } else { 546 } else {
545 __ j(EQUAL, &identity_compare); 547 __ j(EQUAL, &identity_compare);
546 } 548 }
547 } 549 }
548 __ Bind(&identity_compare); 550 __ Bind(&identity_compare);
549 __ cmpq(left, right); 551 __ cmpq(left, right);
550 if (branch == NULL) { 552 if (branch == NULL) {
551 Label done, is_equal; 553 Label done, is_equal;
552 Register result = locs.out().reg(); 554 Register result = locs.out().reg();
(...skipping 1808 matching lines...) Expand 10 before | Expand all | Expand 10 after
2361 2363
2362 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2364 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2363 UNIMPLEMENTED(); 2365 UNIMPLEMENTED();
2364 } 2366 }
2365 2367
2366 } // namespace dart 2368 } // namespace dart
2367 2369
2368 #undef __ 2370 #undef __
2369 2371
2370 #endif // defined TARGET_ARCH_X64 2372 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698