Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/hydrogen.cc

Issue 10699052: Don't actually create Handles for the constant hole. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review II Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/hydrogen.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 Handle<Object> value) {
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(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_, Handle<Smi>(Smi::FromInt(1)));
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_, Handle<Smi>(Smi::FromInt(-1)));
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()->factory()->true_value());
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()->factory()->false_value());
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 return GetConstant(&constant_hole_, isolate()->factory()->the_hole_value());
604 } 604 }
605 605
606 606
607 HGraphBuilder::HGraphBuilder(CompilationInfo* info, 607 HGraphBuilder::HGraphBuilder(CompilationInfo* info,
608 TypeFeedbackOracle* oracle) 608 TypeFeedbackOracle* oracle)
609 : function_state_(NULL), 609 : function_state_(NULL),
610 initial_function_state_(this, info, oracle, NORMAL_RETURN), 610 initial_function_state_(this, info, oracle, NORMAL_RETURN),
611 ast_context_(NULL), 611 ast_context_(NULL),
612 break_scope_(NULL), 612 break_scope_(NULL),
613 graph_(NULL), 613 graph_(NULL),
(...skipping 8904 matching lines...) Expand 10 before | Expand all | Expand 10 after
9518 } 9518 }
9519 } 9519 }
9520 9520
9521 #ifdef DEBUG 9521 #ifdef DEBUG
9522 if (graph_ != NULL) graph_->Verify(false); // No full verify. 9522 if (graph_ != NULL) graph_->Verify(false); // No full verify.
9523 if (allocator_ != NULL) allocator_->Verify(); 9523 if (allocator_ != NULL) allocator_->Verify();
9524 #endif 9524 #endif
9525 } 9525 }
9526 9526
9527 } } // namespace v8::internal 9527 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698