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

Unified Diff: src/hydrogen-instructions.h

Issue 25696004: Add support to load/store byte fields. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Also adjust HLoadNamedField::InferRange. Created 7 years, 2 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
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 1bd350efbaf30b79ab5006af93db446dbfdacfc0..a51d67f3e090553b6c3c8dbd334f4b100a1043ac 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -5934,7 +5934,9 @@ class HLoadNamedField V8_FINAL : public HTemplateInstruction<1> {
SetOperandAt(0, object);
Representation representation = access.representation();
- if (representation.IsSmi()) {
+ if (representation.IsByte()) {
+ set_representation(Representation::Integer32());
+ } else if (representation.IsSmi()) {
set_type(HType::Smi());
set_representation(representation);
} else if (representation.IsDouble() ||
@@ -6232,11 +6234,14 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> {
if (index == 0 && access().IsExternalMemory()) {
// object must be external in case of external memory access
return Representation::External();
- } else if (index == 1 &&
- (field_representation().IsDouble() ||
- field_representation().IsSmi() ||
- field_representation().IsInteger32())) {
- return field_representation();
+ } else if (index == 1) {
+ if (field_representation().IsByte() ||
+ field_representation().IsInteger32()) {
+ return Representation::Integer32();
+ } else if (field_representation().IsDouble() ||
+ field_representation().IsSmi()) {
+ return field_representation();
+ }
}
return Representation::Tagged();
}

Powered by Google App Engine
This is Rietveld 408576698