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_XXX. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX. |
6 | 6 |
7 #include "vm/flow_graph_compiler.h" | 7 #include "vm/flow_graph_compiler.h" |
8 | 8 |
9 #include "vm/debugger.h" | 9 #include "vm/debugger.h" |
10 #include "vm/il_printer.h" | 10 #include "vm/il_printer.h" |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 GenerateInstanceCall(comp->cid(), | 397 GenerateInstanceCall(comp->cid(), |
398 comp->token_index(), | 398 comp->token_index(), |
399 comp->try_index(), | 399 comp->try_index(), |
400 function_name, | 400 function_name, |
401 kNumArguments, | 401 kNumArguments, |
402 Array::ZoneHandle(), // No optional arguments. | 402 Array::ZoneHandle(), // No optional arguments. |
403 kNumArgsChecked); | 403 kNumArgsChecked); |
404 } | 404 } |
405 | 405 |
406 | 406 |
| 407 void FlowGraphCompiler::EmitTestAndCall(const ICData& ic_data, |
| 408 Register class_id_reg, |
| 409 intptr_t arg_count, |
| 410 const Array& arg_names, |
| 411 Label* deopt, |
| 412 Label* done, |
| 413 intptr_t cid, |
| 414 intptr_t token_index, |
| 415 intptr_t try_index) { |
| 416 // TODO(srdjan): better loop please! |
| 417 for (intptr_t i = 0; i < ic_data.NumberOfChecks(); i++) { |
| 418 Label next_test; |
| 419 assembler()->cmpl(class_id_reg, Immediate(ic_data.GetReceiverClassIdAt(i))); |
| 420 assembler()->j(NOT_EQUAL, &next_test); |
| 421 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(i)); |
| 422 GenerateStaticCall(cid, |
| 423 token_index, |
| 424 try_index, |
| 425 target, |
| 426 arg_count, |
| 427 arg_names); |
| 428 assembler()->jmp(done); |
| 429 assembler()->Bind(&next_test); |
| 430 } |
| 431 assembler()->jmp(deopt); |
| 432 } |
| 433 |
| 434 |
| 435 |
| 436 |
| 437 |
407 Register FrameRegisterAllocator::AllocateFreeRegister(bool* blocked_registers) { | 438 Register FrameRegisterAllocator::AllocateFreeRegister(bool* blocked_registers) { |
408 for (intptr_t regno = 0; regno < kNumberOfCpuRegisters; regno++) { | 439 for (intptr_t regno = 0; regno < kNumberOfCpuRegisters; regno++) { |
409 if (!blocked_registers[regno] && (registers_[regno] == NULL)) { | 440 if (!blocked_registers[regno] && (registers_[regno] == NULL)) { |
410 blocked_registers[regno] = true; | 441 blocked_registers[regno] = true; |
411 return static_cast<Register>(regno); | 442 return static_cast<Register>(regno); |
412 } | 443 } |
413 } | 444 } |
414 return SpillFirst(); | 445 return SpillFirst(); |
415 } | 446 } |
416 | 447 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 | 609 |
579 | 610 |
580 void FrameRegisterAllocator::SpillInDeoptStub(DeoptimizationStub* stub) { | 611 void FrameRegisterAllocator::SpillInDeoptStub(DeoptimizationStub* stub) { |
581 for (int i = 0; i < stack_.length(); i++) { | 612 for (int i = 0; i < stack_.length(); i++) { |
582 stub->Push(stack_[i]); | 613 stub->Push(stack_[i]); |
583 } | 614 } |
584 } | 615 } |
585 | 616 |
586 | 617 |
587 } // namespace dart | 618 } // namespace dart |
OLD | NEW |