OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
561 ASSERT(!dominator_analyzer.reachable()->Contains(block->block_id())); | 561 ASSERT(!dominator_analyzer.reachable()->Contains(block->block_id())); |
562 } | 562 } |
563 } | 563 } |
564 } | 564 } |
565 } | 565 } |
566 | 566 |
567 #endif | 567 #endif |
568 | 568 |
569 | 569 |
570 HConstant* HGraph::GetConstant(SetOncePointer<HConstant>* pointer, | 570 HConstant* HGraph::GetConstant(SetOncePointer<HConstant>* pointer, |
571 Object* value) { | 571 Object* value) { |
Michael Starzinger
2012/07/02 20:11:20
Turn the second parameter into "Handle<Object> val
sanjoy
2012/07/03 09:05:52
Done.
| |
572 if (!pointer->is_set()) { | 572 if (!pointer->is_set()) { |
573 HConstant* constant = new(zone()) HConstant(Handle<Object>(value), | 573 HConstant* constant = new(zone()) HConstant(Handle<Object>(value), |
574 Representation::Tagged()); | 574 Representation::Tagged()); |
575 constant->InsertAfter(GetConstantUndefined()); | 575 constant->InsertAfter(GetConstantUndefined()); |
576 pointer->set(constant); | 576 pointer->set(constant); |
577 } | 577 } |
578 return pointer->get(); | 578 return pointer->get(); |
579 } | 579 } |
580 | 580 |
581 | 581 |
582 HConstant* HGraph::GetConstant1() { | 582 HConstant* HGraph::GetConstant1() { |
583 return GetConstant(&constant_1_, Smi::FromInt(1)); | 583 return GetConstant(&constant_1_, Smi::FromInt(1)); |
Michael Starzinger
2012/07/02 20:11:20
Use "Handle<Smi>(Smi::FromInt(1))" here.
sanjoy
2012/07/03 09:05:52
Done.
| |
584 } | 584 } |
585 | 585 |
586 | 586 |
587 HConstant* HGraph::GetConstantMinus1() { | 587 HConstant* HGraph::GetConstantMinus1() { |
588 return GetConstant(&constant_minus1_, Smi::FromInt(-1)); | 588 return GetConstant(&constant_minus1_, Smi::FromInt(-1)); |
Michael Starzinger
2012/07/02 20:11:20
Likewise.
sanjoy
2012/07/03 09:05:52
Done.
| |
589 } | 589 } |
590 | 590 |
591 | 591 |
592 HConstant* HGraph::GetConstantTrue() { | 592 HConstant* HGraph::GetConstantTrue() { |
593 return GetConstant(&constant_true_, isolate()->heap()->true_value()); | 593 return GetConstant(&constant_true_, isolate()->heap()->true_value()); |
Michael Starzinger
2012/07/02 20:11:20
Use "isolate->factory()->true_value()" here.
sanjoy
2012/07/03 09:05:52
Done.
| |
594 } | 594 } |
595 | 595 |
596 | 596 |
597 HConstant* HGraph::GetConstantFalse() { | 597 HConstant* HGraph::GetConstantFalse() { |
598 return GetConstant(&constant_false_, isolate()->heap()->false_value()); | 598 return GetConstant(&constant_false_, isolate()->heap()->false_value()); |
Michael Starzinger
2012/07/02 20:11:20
Likewise.
sanjoy
2012/07/03 09:05:52
Done.
| |
599 } | 599 } |
600 | 600 |
601 | 601 |
602 HConstant* HGraph::GetConstantHole() { | 602 HConstant* HGraph::GetConstantHole() { |
603 return GetConstant(&constant_hole_, isolate()->heap()->the_hole_value()); | 603 if (!constant_hole_.is_set()) { |
604 Handle<Object> hole_value = Handle<Object>( | |
605 &isolate()->heap()->roots_array_start()[Heap::kTheHoleValueRootIndex]); | |
Michael Starzinger
2012/07/02 20:11:20
Likewise.
sanjoy
2012/07/03 09:05:52
Done.
| |
606 HConstant* constant = new(zone()) HConstant(hole_value, | |
607 Representation::Tagged()); | |
608 constant->InsertAfter(GetConstantUndefined()); | |
609 constant_hole_.set(constant); | |
610 } | |
611 return constant_hole_.get(); | |
604 } | 612 } |
605 | 613 |
606 | 614 |
607 HGraphBuilder::HGraphBuilder(CompilationInfo* info, | 615 HGraphBuilder::HGraphBuilder(CompilationInfo* info, |
608 TypeFeedbackOracle* oracle) | 616 TypeFeedbackOracle* oracle) |
609 : function_state_(NULL), | 617 : function_state_(NULL), |
610 initial_function_state_(this, info, oracle, NORMAL_RETURN), | 618 initial_function_state_(this, info, oracle, NORMAL_RETURN), |
611 ast_context_(NULL), | 619 ast_context_(NULL), |
612 break_scope_(NULL), | 620 break_scope_(NULL), |
613 graph_(NULL), | 621 graph_(NULL), |
(...skipping 8904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9518 } | 9526 } |
9519 } | 9527 } |
9520 | 9528 |
9521 #ifdef DEBUG | 9529 #ifdef DEBUG |
9522 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 9530 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
9523 if (allocator_ != NULL) allocator_->Verify(); | 9531 if (allocator_ != NULL) allocator_->Verify(); |
9524 #endif | 9532 #endif |
9525 } | 9533 } |
9526 | 9534 |
9527 } } // namespace v8::internal | 9535 } } // namespace v8::internal |
OLD | NEW |