| 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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 intptr_t deopt_id, | 346 intptr_t deopt_id, |
| 347 intptr_t token_pos, | 347 intptr_t token_pos, |
| 348 Token::Kind kind, | 348 Token::Kind kind, |
| 349 LocationSummary* locs, | 349 LocationSummary* locs, |
| 350 const ICData& original_ic_data) { | 350 const ICData& original_ic_data) { |
| 351 if (!compiler->is_optimizing()) { | 351 if (!compiler->is_optimizing()) { |
| 352 compiler->AddCurrentDescriptor(PcDescriptors::kDeoptBefore, | 352 compiler->AddCurrentDescriptor(PcDescriptors::kDeoptBefore, |
| 353 deopt_id, | 353 deopt_id, |
| 354 token_pos); | 354 token_pos); |
| 355 } | 355 } |
| 356 const String& operator_name = String::ZoneHandle(Symbols::EqualOperator()); | |
| 357 const int kNumberOfArguments = 2; | 356 const int kNumberOfArguments = 2; |
| 358 const Array& kNoArgumentNames = Array::Handle(); | 357 const Array& kNoArgumentNames = Array::Handle(); |
| 359 const int kNumArgumentsChecked = 2; | 358 const int kNumArgumentsChecked = 2; |
| 360 | 359 |
| 361 const Immediate raw_null = | 360 const Immediate raw_null = |
| 362 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 361 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
| 363 Label check_identity; | 362 Label check_identity; |
| 364 __ cmpl(Address(ESP, 0 * kWordSize), raw_null); | 363 __ cmpl(Address(ESP, 0 * kWordSize), raw_null); |
| 365 __ j(EQUAL, &check_identity); | 364 __ j(EQUAL, &check_identity); |
| 366 __ cmpl(Address(ESP, 1 * kWordSize), raw_null); | 365 __ cmpl(Address(ESP, 1 * kWordSize), raw_null); |
| 367 __ j(EQUAL, &check_identity); | 366 __ j(EQUAL, &check_identity); |
| 368 | 367 |
| 369 ICData& equality_ic_data = ICData::ZoneHandle(); | 368 ICData& equality_ic_data = ICData::ZoneHandle(); |
| 370 if (compiler->is_optimizing() && FLAG_propagate_ic_data) { | 369 if (compiler->is_optimizing() && FLAG_propagate_ic_data) { |
| 371 ASSERT(!original_ic_data.IsNull()); | 370 ASSERT(!original_ic_data.IsNull()); |
| 372 if (original_ic_data.NumberOfChecks() == 0) { | 371 if (original_ic_data.NumberOfChecks() == 0) { |
| 373 // IC call for reoptimization populates original ICData. | 372 // IC call for reoptimization populates original ICData. |
| 374 equality_ic_data = original_ic_data.raw(); | 373 equality_ic_data = original_ic_data.raw(); |
| 375 } else { | 374 } else { |
| 376 // Megamorphic call. | 375 // Megamorphic call. |
| 377 equality_ic_data = original_ic_data.AsUnaryClassChecks(); | 376 equality_ic_data = original_ic_data.AsUnaryClassChecks(); |
| 378 } | 377 } |
| 379 } else { | 378 } else { |
| 380 equality_ic_data = ICData::New(compiler->parsed_function().function(), | 379 equality_ic_data = ICData::New(compiler->parsed_function().function(), |
| 381 operator_name, | 380 Symbols::EqualOperatorHandle(), |
| 382 deopt_id, | 381 deopt_id, |
| 383 kNumArgumentsChecked); | 382 kNumArgumentsChecked); |
| 384 } | 383 } |
| 385 compiler->GenerateInstanceCall(deopt_id, | 384 compiler->GenerateInstanceCall(deopt_id, |
| 386 token_pos, | 385 token_pos, |
| 387 kNumberOfArguments, | 386 kNumberOfArguments, |
| 388 kNoArgumentNames, | 387 kNoArgumentNames, |
| 389 locs, | 388 locs, |
| 390 equality_ic_data); | 389 equality_ic_data); |
| 391 Label check_ne; | 390 Label check_ne; |
| (...skipping 2401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2793 __ pcmpeqq(XMM0, XMM0); // Generate all 1's. | 2792 __ pcmpeqq(XMM0, XMM0); // Generate all 1's. |
| 2794 __ pxor(value, XMM0); | 2793 __ pxor(value, XMM0); |
| 2795 } | 2794 } |
| 2796 | 2795 |
| 2797 | 2796 |
| 2798 } // namespace dart | 2797 } // namespace dart |
| 2799 | 2798 |
| 2800 #undef __ | 2799 #undef __ |
| 2801 | 2800 |
| 2802 #endif // defined TARGET_ARCH_X64 | 2801 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |