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

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

Issue 6850031: Make HConstant a bit more compact. (Closed)
Patch Set: Created 9 years, 8 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
« 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 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 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 1010
1011 1011
1012 void HEnterInlined::PrintDataTo(StringStream* stream) { 1012 void HEnterInlined::PrintDataTo(StringStream* stream) {
1013 SmartPointer<char> name = function()->debug_name()->ToCString(); 1013 SmartPointer<char> name = function()->debug_name()->ToCString();
1014 stream->Add("%s, id=%d", *name, function()->id()); 1014 stream->Add("%s, id=%d", *name, function()->id());
1015 } 1015 }
1016 1016
1017 1017
1018 HConstant::HConstant(Handle<Object> handle, Representation r) 1018 HConstant::HConstant(Handle<Object> handle, Representation r)
1019 : handle_(handle), 1019 : handle_(handle),
1020 constant_type_(HType::TypeFromValue(handle)),
1021 has_int32_value_(false), 1020 has_int32_value_(false),
1021 has_double_value_(false),
1022 int32_value_(0), 1022 int32_value_(0),
1023 has_double_value_(false),
1024 double_value_(0) { 1023 double_value_(0) {
1025 set_representation(r); 1024 set_representation(r);
1026 SetFlag(kUseGVN); 1025 SetFlag(kUseGVN);
1027 if (handle_->IsNumber()) { 1026 if (handle_->IsNumber()) {
1028 double n = handle_->Number(); 1027 double n = handle_->Number();
1029 double roundtrip_value = static_cast<double>(static_cast<int32_t>(n)); 1028 double roundtrip_value = static_cast<double>(static_cast<int32_t>(n));
1030 has_int32_value_ = BitCast<int64_t>(roundtrip_value) == BitCast<int64_t>(n); 1029 has_int32_value_ = BitCast<int64_t>(roundtrip_value) == BitCast<int64_t>(n);
1031 if (has_int32_value_) int32_value_ = static_cast<int32_t>(n); 1030 if (has_int32_value_) int32_value_ = static_cast<int32_t>(n);
1032 double_value_ = n; 1031 double_value_ = n;
1033 has_double_value_ = true; 1032 has_double_value_ = true;
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 HType result = HType::Uninitialized(); 1427 HType result = HType::Uninitialized();
1429 for (int i = 0; i < OperandCount(); ++i) { 1428 for (int i = 0; i < OperandCount(); ++i) {
1430 HType current = OperandAt(i)->type(); 1429 HType current = OperandAt(i)->type();
1431 result = result.Combine(current); 1430 result = result.Combine(current);
1432 } 1431 }
1433 return result; 1432 return result;
1434 } 1433 }
1435 1434
1436 1435
1437 HType HConstant::CalculateInferredType() { 1436 HType HConstant::CalculateInferredType() {
1438 return constant_type_; 1437 return HType::TypeFromValue(handle_);
1439 } 1438 }
1440 1439
1441 1440
1442 HType HCompare::CalculateInferredType() { 1441 HType HCompare::CalculateInferredType() {
1443 return HType::Boolean(); 1442 return HType::Boolean();
1444 } 1443 }
1445 1444
1446 1445
1447 HType HCompareJSObjectEq::CalculateInferredType() { 1446 HType HCompareJSObjectEq::CalculateInferredType() {
1448 return HType::Boolean(); 1447 return HType::Boolean();
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1647 1646
1648 1647
1649 void HCheckPrototypeMaps::Verify() { 1648 void HCheckPrototypeMaps::Verify() {
1650 HInstruction::Verify(); 1649 HInstruction::Verify();
1651 ASSERT(HasNoUses()); 1650 ASSERT(HasNoUses());
1652 } 1651 }
1653 1652
1654 #endif 1653 #endif
1655 1654
1656 } } // namespace v8::internal 1655 } } // 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