| 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_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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 return locs; | 433 return locs; |
| 434 } else if (receiver_type() == kArray || receiver_type() == kImmutableArray) { | 434 } else if (receiver_type() == kArray || receiver_type() == kImmutableArray) { |
| 435 return LocationSummary::Make(kNumInputs, Location::RequiresRegister()); | 435 return LocationSummary::Make(kNumInputs, Location::RequiresRegister()); |
| 436 } else { | 436 } else { |
| 437 ASSERT(receiver_type() == kIllegalObjectKind); | 437 ASSERT(receiver_type() == kIllegalObjectKind); |
| 438 return MakeCallSummary(); | 438 return MakeCallSummary(); |
| 439 } | 439 } |
| 440 } | 440 } |
| 441 | 441 |
| 442 | 442 |
| 443 static void EmitLoadIndexedGeneric(FlowGraphCompiler* compiler, | |
| 444 LoadIndexedComp* comp) { | |
| 445 const String& function_name = | |
| 446 String::ZoneHandle(String::NewSymbol(Token::Str(Token::kINDEX))); | |
| 447 | |
| 448 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | |
| 449 comp->cid(), | |
| 450 comp->token_index(), | |
| 451 comp->try_index()); | |
| 452 | |
| 453 const intptr_t kNumArguments = 2; | |
| 454 const intptr_t kNumArgsChecked = 1; // Type-feedback. | |
| 455 compiler->GenerateInstanceCall(comp->cid(), | |
| 456 comp->token_index(), | |
| 457 comp->try_index(), | |
| 458 function_name, | |
| 459 kNumArguments, | |
| 460 Array::ZoneHandle(), // No optional arguments. | |
| 461 kNumArgsChecked); | |
| 462 ASSERT(comp->locs()->out().reg() == RAX); | |
| 463 } | |
| 464 | |
| 465 | |
| 466 void LoadIndexedComp::EmitNativeCode(FlowGraphCompiler* compiler) { | 443 void LoadIndexedComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 467 if (receiver_type() == kIllegalObjectKind) { | 444 if (receiver_type() == kIllegalObjectKind) { |
| 468 EmitLoadIndexedGeneric(compiler, this); | 445 compiler->EmitLoadIndexedGeneric(this); |
| 446 ASSERT(locs()->out().reg() == RAX); |
| 469 return; | 447 return; |
| 470 } | 448 } |
| 471 | 449 |
| 472 Register receiver = locs()->in(0).reg(); | 450 Register receiver = locs()->in(0).reg(); |
| 473 Register index = locs()->in(1).reg(); | 451 Register index = locs()->in(1).reg(); |
| 474 Register result = locs()->out().reg(); | 452 Register result = locs()->out().reg(); |
| 475 | 453 |
| 476 const Class& receiver_class = | 454 const Class& receiver_class = |
| 477 Class::ZoneHandle(Isolate::Current()->class_table()->At( | 455 Class::ZoneHandle(Isolate::Current()->class_table()->At( |
| 478 receiver_type())); | 456 receiver_type())); |
| (...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1389 } else { | 1367 } else { |
| 1390 UNREACHABLE(); | 1368 UNREACHABLE(); |
| 1391 } | 1369 } |
| 1392 } | 1370 } |
| 1393 | 1371 |
| 1394 } // namespace dart | 1372 } // namespace dart |
| 1395 | 1373 |
| 1396 #undef __ | 1374 #undef __ |
| 1397 | 1375 |
| 1398 #endif // defined TARGET_ARCH_X64 | 1376 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |