| 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 __ LoadClassId(temp, left); | 448 __ LoadClassId(temp, left); |
| 449 __ Bind(&done); | 449 __ Bind(&done); |
| 450 } else { | 450 } else { |
| 451 __ j(ZERO, deopt); // Smi deopts. | 451 __ j(ZERO, deopt); // Smi deopts. |
| 452 __ LoadClassId(temp, left); | 452 __ LoadClassId(temp, left); |
| 453 } | 453 } |
| 454 // 'temp' contains class-id of the left argument. | 454 // 'temp' contains class-id of the left argument. |
| 455 ObjectStore* object_store = Isolate::Current()->object_store(); | 455 ObjectStore* object_store = Isolate::Current()->object_store(); |
| 456 Condition cond = TokenKindToSmiCondition(kind); | 456 Condition cond = TokenKindToSmiCondition(kind); |
| 457 Label done; | 457 Label done; |
| 458 for (intptr_t i = 0; i < ic_data.NumberOfChecks(); i++) { | 458 const intptr_t len = ic_data.NumberOfChecks(); |
| 459 for (intptr_t i = 0; i < len; i++) { |
| 459 // Assert that the Smi is at position 0, if at all. | 460 // Assert that the Smi is at position 0, if at all. |
| 460 ASSERT((ic_data.GetReceiverClassIdAt(i) != kSmiCid) || (i == 0)); | 461 ASSERT((ic_data.GetReceiverClassIdAt(i) != kSmiCid) || (i == 0)); |
| 461 Label next_test; | 462 Label next_test; |
| 462 __ cmpl(temp, Immediate(ic_data.GetReceiverClassIdAt(i))); | 463 __ cmpl(temp, Immediate(ic_data.GetReceiverClassIdAt(i))); |
| 463 __ j(NOT_EQUAL, &next_test); | 464 __ j(NOT_EQUAL, &next_test); |
| 464 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(i)); | 465 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(i)); |
| 465 if (target.Owner() == object_store->object_class()) { | 466 if (target.Owner() == object_store->object_class()) { |
| 466 // Object.== is same as ===. | 467 // Object.== is same as ===. |
| 467 __ Drop(2); | 468 __ Drop(2); |
| 468 __ cmpl(left, right); | 469 __ cmpl(left, right); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 // 'left' is not Smi. | 532 // 'left' is not Smi. |
| 532 const Immediate raw_null = | 533 const Immediate raw_null = |
| 533 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 534 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
| 534 Label identity_compare; | 535 Label identity_compare; |
| 535 __ cmpl(right, raw_null); | 536 __ cmpl(right, raw_null); |
| 536 __ j(EQUAL, &identity_compare); | 537 __ j(EQUAL, &identity_compare); |
| 537 __ cmpl(left, raw_null); | 538 __ cmpl(left, raw_null); |
| 538 __ j(EQUAL, &identity_compare); | 539 __ j(EQUAL, &identity_compare); |
| 539 | 540 |
| 540 __ LoadClassId(temp, left); | 541 __ LoadClassId(temp, left); |
| 541 for (intptr_t i = 0; i < ic_data.NumberOfChecks(); i++) { | 542 const intptr_t len = ic_data.NumberOfChecks(); |
| 543 for (intptr_t i = 0; i < len; i++) { |
| 542 __ cmpl(temp, Immediate(ic_data.GetReceiverClassIdAt(i))); | 544 __ cmpl(temp, Immediate(ic_data.GetReceiverClassIdAt(i))); |
| 543 if (i == (ic_data.NumberOfChecks() - 1)) { | 545 if (i == (len - 1)) { |
| 544 __ j(NOT_EQUAL, deopt); | 546 __ j(NOT_EQUAL, deopt); |
| 545 } else { | 547 } else { |
| 546 __ j(EQUAL, &identity_compare); | 548 __ j(EQUAL, &identity_compare); |
| 547 } | 549 } |
| 548 } | 550 } |
| 549 __ Bind(&identity_compare); | 551 __ Bind(&identity_compare); |
| 550 __ cmpl(left, right); | 552 __ cmpl(left, right); |
| 551 if (branch == NULL) { | 553 if (branch == NULL) { |
| 552 Label done, is_equal; | 554 Label done, is_equal; |
| 553 Register result = locs.out().reg(); | 555 Register result = locs.out().reg(); |
| (...skipping 2173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2727 __ pcmpeqq(XMM0, XMM0); // Generate all 1's. | 2729 __ pcmpeqq(XMM0, XMM0); // Generate all 1's. |
| 2728 __ pxor(value, XMM0); | 2730 __ pxor(value, XMM0); |
| 2729 } | 2731 } |
| 2730 | 2732 |
| 2731 | 2733 |
| 2732 } // namespace dart | 2734 } // namespace dart |
| 2733 | 2735 |
| 2734 #undef __ | 2736 #undef __ |
| 2735 | 2737 |
| 2736 #endif // defined TARGET_ARCH_X64 | 2738 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |