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

Unified Diff: src/hydrogen-instructions.cc

Issue 21348002: Avoid the use of set_type() in instruction constructors. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 87dad6ff67135976dc382f8810087c786bc3acc5..be1abf66c0a7d6cc953ce59546401792d23a1796 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -2640,7 +2640,8 @@ static bool IsInteger32(double value) {
HConstant::HConstant(Handle<Object> handle, Representation r)
- : handle_(handle),
+ : HTemplateInstruction<0>(HType::TypeFromValue(handle)),
+ handle_(handle),
unique_id_(),
has_smi_value_(false),
has_int32_value_(false),
@@ -2650,8 +2651,6 @@ HConstant::HConstant(Handle<Object> handle, Representation r)
is_not_in_new_space_(true),
is_cell_(false),
boolean_value_(handle->BooleanValue()) {
- set_type(HType::TypeFromValue(handle));
-
if (handle_->IsHeapObject()) {
Heap* heap = Handle<HeapObject>::cast(handle)->GetHeap();
is_not_in_new_space_ = !heap->InNewSpace(*handle);
@@ -2681,7 +2680,8 @@ HConstant::HConstant(Handle<Object> handle,
bool is_not_in_new_space,
bool is_cell,
bool boolean_value)
- : handle_(handle),
+ : HTemplateInstruction<0>(type),
+ handle_(handle),
unique_id_(unique_id),
has_smi_value_(false),
has_int32_value_(false),
@@ -2693,7 +2693,6 @@ HConstant::HConstant(Handle<Object> handle,
boolean_value_(boolean_value) {
ASSERT(!handle.is_null());
ASSERT(!type.IsTaggedNumber());
- set_type(type);
Initialize(r);
}
« no previous file with comments | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698