OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 void FullCodeGenerator::StackValueContext::Plug(Slot* slot) const { | 376 void FullCodeGenerator::StackValueContext::Plug(Slot* slot) const { |
377 codegen()->Move(result_register(), slot); | 377 codegen()->Move(result_register(), slot); |
378 __ push(result_register()); | 378 __ push(result_register()); |
379 } | 379 } |
380 | 380 |
381 | 381 |
382 void FullCodeGenerator::TestContext::Plug(Slot* slot) const { | 382 void FullCodeGenerator::TestContext::Plug(Slot* slot) const { |
383 // For simplicity we always test the accumulator register. | 383 // For simplicity we always test the accumulator register. |
384 codegen()->Move(result_register(), slot); | 384 codegen()->Move(result_register(), slot); |
385 codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL); | 385 codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL); |
386 codegen()->DoTest(true_label_, false_label_, fall_through_); | 386 codegen()->DoTest(this); |
387 } | 387 } |
388 | 388 |
389 | 389 |
390 void FullCodeGenerator::EffectContext::Plug(Heap::RootListIndex index) const { | 390 void FullCodeGenerator::EffectContext::Plug(Heap::RootListIndex index) const { |
391 } | 391 } |
392 | 392 |
393 | 393 |
394 void FullCodeGenerator::AccumulatorValueContext::Plug( | 394 void FullCodeGenerator::AccumulatorValueContext::Plug( |
395 Heap::RootListIndex index) const { | 395 Heap::RootListIndex index) const { |
396 __ LoadRoot(result_register(), index); | 396 __ LoadRoot(result_register(), index); |
(...skipping 13 matching lines...) Expand all Loading... |
410 true_label_, | 410 true_label_, |
411 false_label_); | 411 false_label_); |
412 if (index == Heap::kUndefinedValueRootIndex || | 412 if (index == Heap::kUndefinedValueRootIndex || |
413 index == Heap::kNullValueRootIndex || | 413 index == Heap::kNullValueRootIndex || |
414 index == Heap::kFalseValueRootIndex) { | 414 index == Heap::kFalseValueRootIndex) { |
415 if (false_label_ != fall_through_) __ b(false_label_); | 415 if (false_label_ != fall_through_) __ b(false_label_); |
416 } else if (index == Heap::kTrueValueRootIndex) { | 416 } else if (index == Heap::kTrueValueRootIndex) { |
417 if (true_label_ != fall_through_) __ b(true_label_); | 417 if (true_label_ != fall_through_) __ b(true_label_); |
418 } else { | 418 } else { |
419 __ LoadRoot(result_register(), index); | 419 __ LoadRoot(result_register(), index); |
420 codegen()->DoTest(true_label_, false_label_, fall_through_); | 420 codegen()->DoTest(this); |
421 } | 421 } |
422 } | 422 } |
423 | 423 |
424 | 424 |
425 void FullCodeGenerator::EffectContext::Plug(Handle<Object> lit) const { | 425 void FullCodeGenerator::EffectContext::Plug(Handle<Object> lit) const { |
426 } | 426 } |
427 | 427 |
428 | 428 |
429 void FullCodeGenerator::AccumulatorValueContext::Plug( | 429 void FullCodeGenerator::AccumulatorValueContext::Plug( |
430 Handle<Object> lit) const { | 430 Handle<Object> lit) const { |
(...skipping 26 matching lines...) Expand all Loading... |
457 } | 457 } |
458 } else if (lit->IsSmi()) { | 458 } else if (lit->IsSmi()) { |
459 if (Smi::cast(*lit)->value() == 0) { | 459 if (Smi::cast(*lit)->value() == 0) { |
460 if (false_label_ != fall_through_) __ b(false_label_); | 460 if (false_label_ != fall_through_) __ b(false_label_); |
461 } else { | 461 } else { |
462 if (true_label_ != fall_through_) __ b(true_label_); | 462 if (true_label_ != fall_through_) __ b(true_label_); |
463 } | 463 } |
464 } else { | 464 } else { |
465 // For simplicity we always test the accumulator register. | 465 // For simplicity we always test the accumulator register. |
466 __ mov(result_register(), Operand(lit)); | 466 __ mov(result_register(), Operand(lit)); |
467 codegen()->DoTest(true_label_, false_label_, fall_through_); | 467 codegen()->DoTest(this); |
468 } | 468 } |
469 } | 469 } |
470 | 470 |
471 | 471 |
472 void FullCodeGenerator::EffectContext::DropAndPlug(int count, | 472 void FullCodeGenerator::EffectContext::DropAndPlug(int count, |
473 Register reg) const { | 473 Register reg) const { |
474 ASSERT(count > 0); | 474 ASSERT(count > 0); |
475 __ Drop(count); | 475 __ Drop(count); |
476 } | 476 } |
477 | 477 |
(...skipping 15 matching lines...) Expand all Loading... |
493 } | 493 } |
494 | 494 |
495 | 495 |
496 void FullCodeGenerator::TestContext::DropAndPlug(int count, | 496 void FullCodeGenerator::TestContext::DropAndPlug(int count, |
497 Register reg) const { | 497 Register reg) const { |
498 ASSERT(count > 0); | 498 ASSERT(count > 0); |
499 // For simplicity we always test the accumulator register. | 499 // For simplicity we always test the accumulator register. |
500 __ Drop(count); | 500 __ Drop(count); |
501 __ Move(result_register(), reg); | 501 __ Move(result_register(), reg); |
502 codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL); | 502 codegen()->PrepareForBailoutBeforeSplit(TOS_REG, false, NULL, NULL); |
503 codegen()->DoTest(true_label_, false_label_, fall_through_); | 503 codegen()->DoTest(this); |
504 } | 504 } |
505 | 505 |
506 | 506 |
507 void FullCodeGenerator::EffectContext::Plug(Label* materialize_true, | 507 void FullCodeGenerator::EffectContext::Plug(Label* materialize_true, |
508 Label* materialize_false) const { | 508 Label* materialize_false) const { |
509 ASSERT(materialize_true == materialize_false); | 509 ASSERT(materialize_true == materialize_false); |
510 __ bind(materialize_true); | 510 __ bind(materialize_true); |
511 } | 511 } |
512 | 512 |
513 | 513 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 true_label_, | 571 true_label_, |
572 false_label_); | 572 false_label_); |
573 if (flag) { | 573 if (flag) { |
574 if (true_label_ != fall_through_) __ b(true_label_); | 574 if (true_label_ != fall_through_) __ b(true_label_); |
575 } else { | 575 } else { |
576 if (false_label_ != fall_through_) __ b(false_label_); | 576 if (false_label_ != fall_through_) __ b(false_label_); |
577 } | 577 } |
578 } | 578 } |
579 | 579 |
580 | 580 |
581 void FullCodeGenerator::DoTest(Label* if_true, | 581 void FullCodeGenerator::DoTest(Expression* condition, |
| 582 Label* if_true, |
582 Label* if_false, | 583 Label* if_false, |
583 Label* fall_through) { | 584 Label* fall_through) { |
584 if (CpuFeatures::IsSupported(VFP3)) { | 585 if (CpuFeatures::IsSupported(VFP3)) { |
585 ToBooleanStub stub(result_register()); | 586 ToBooleanStub stub(result_register()); |
586 __ CallStub(&stub); | 587 __ CallStub(&stub); |
587 __ tst(result_register(), result_register()); | 588 __ tst(result_register(), result_register()); |
588 } else { | 589 } else { |
589 // Call the runtime to find the boolean value of the source and then | 590 // Call the runtime to find the boolean value of the source and then |
590 // translate it into control flow to the pair of labels. | 591 // translate it into control flow to the pair of labels. |
591 __ push(result_register()); | 592 __ push(result_register()); |
(...skipping 3772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4364 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. | 4365 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. |
4365 __ add(pc, r1, Operand(masm_->CodeObject())); | 4366 __ add(pc, r1, Operand(masm_->CodeObject())); |
4366 } | 4367 } |
4367 | 4368 |
4368 | 4369 |
4369 #undef __ | 4370 #undef __ |
4370 | 4371 |
4371 } } // namespace v8::internal | 4372 } } // namespace v8::internal |
4372 | 4373 |
4373 #endif // V8_TARGET_ARCH_ARM | 4374 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |