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

Side by Side Diff: src/hydrogen-instructions.cc

Issue 21317004: Fix HType handling for HConstant with external references. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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-instructions.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 2723 matching lines...) Expand 10 before | Expand all | Expand 10 after
2734 boolean_value_(double_value != 0 && !std::isnan(double_value)), 2734 boolean_value_(double_value != 0 && !std::isnan(double_value)),
2735 int32_value_(DoubleToInt32(double_value)), 2735 int32_value_(DoubleToInt32(double_value)),
2736 double_value_(double_value) { 2736 double_value_(double_value) {
2737 has_smi_value_ = has_int32_value_ && Smi::IsValid(int32_value_); 2737 has_smi_value_ = has_int32_value_ && Smi::IsValid(int32_value_);
2738 set_type(has_smi_value_ ? HType::Smi() : HType::TaggedNumber()); 2738 set_type(has_smi_value_ ? HType::Smi() : HType::TaggedNumber());
2739 Initialize(r); 2739 Initialize(r);
2740 } 2740 }
2741 2741
2742 2742
2743 HConstant::HConstant(ExternalReference reference) 2743 HConstant::HConstant(ExternalReference reference)
2744 : has_smi_value_(false), 2744 : HTemplateInstruction(HType::None()),
2745 has_smi_value_(false),
2745 has_int32_value_(false), 2746 has_int32_value_(false),
2746 has_double_value_(false), 2747 has_double_value_(false),
2747 has_external_reference_value_(true), 2748 has_external_reference_value_(true),
2748 is_internalized_string_(false), 2749 is_internalized_string_(false),
2749 is_not_in_new_space_(true), 2750 is_not_in_new_space_(true),
2750 is_cell_(false), 2751 is_cell_(false),
2751 boolean_value_(true), 2752 boolean_value_(true),
2752 external_reference_value_(reference) { 2753 external_reference_value_(reference) {
2753 set_type(HType::None());
2754 Initialize(Representation::External()); 2754 Initialize(Representation::External());
2755 } 2755 }
2756 2756
2757 2757
2758 void HConstant::Initialize(Representation r) { 2758 void HConstant::Initialize(Representation r) {
2759 if (r.IsNone()) { 2759 if (r.IsNone()) {
2760 if (has_smi_value_ && kSmiValueSize == 31) { 2760 if (has_smi_value_ && kSmiValueSize == 31) {
2761 r = Representation::Smi(); 2761 r = Representation::Smi();
2762 } else if (has_int32_value_) { 2762 } else if (has_int32_value_) {
2763 r = Representation::Integer32(); 2763 r = Representation::Integer32();
(...skipping 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after
4570 break; 4570 break;
4571 case kExternalMemory: 4571 case kExternalMemory:
4572 stream->Add("[external-memory]"); 4572 stream->Add("[external-memory]");
4573 break; 4573 break;
4574 } 4574 }
4575 4575
4576 stream->Add("@%d", offset()); 4576 stream->Add("@%d", offset());
4577 } 4577 }
4578 4578
4579 } } // namespace v8::internal 4579 } } // namespace v8::internal
OLDNEW
« 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