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

Unified Diff: src/compiler/simplified-operator.h

Issue 439223004: Add support for untagged LoadField, StoreField, LoadElement, and StoreElement simplfied operators. … (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/simplified-lowering.cc ('k') | test/cctest/compiler/test-simplified-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-operator.h
diff --git a/src/compiler/simplified-operator.h b/src/compiler/simplified-operator.h
index 6410f2f66daa218dff0a480c0a5444009310bd35..73278cb657cca78f912d637052f7bd30a201106b 100644
--- a/src/compiler/simplified-operator.h
+++ b/src/compiler/simplified-operator.h
@@ -13,22 +13,33 @@ namespace v8 {
namespace internal {
namespace compiler {
-// An access descriptor for loads/stores from/to fixed structures
-// like field accesses of heap objects.
+enum BaseTaggedness { kUntaggedBase, kTaggedBase };
+
+// An access descriptor for loads/stores of fixed structures like field
+// accesses of heap objects. Accesses from either tagged or untagged base
+// pointers are supported; untagging is done automatically during lowering.
struct FieldAccess {
- int offset;
- Handle<Name> name; // debug only.
- Type* type;
- MachineRepresentation representation;
+ BaseTaggedness base_is_tagged; // specifies if the base pointer is tagged.
+ int offset; // offset of the field, without tag.
+ Handle<Name> name; // debugging only.
+ Type* type; // type of the field.
+ MachineRepresentation representation; // machine representation of field.
+
+ int tag() const { return base_is_tagged == kTaggedBase ? kHeapObjectTag : 0; }
};
-// An access descriptor for loads/stores of indexed structures
-// like characters in strings or off-heap backing stores.
+// An access descriptor for loads/stores of indexed structures like characters
+// in strings or off-heap backing stores. Accesses from either tagged or
+// untagged base pointers are supported; untagging is done automatically during
+// lowering.
struct ElementAccess {
- int header_size;
- Type* type;
- MachineRepresentation representation;
+ BaseTaggedness base_is_tagged; // specifies if the base pointer is tagged.
+ int header_size; // size of the header, without tag.
+ Type* type; // type of the element.
+ MachineRepresentation representation; // machine representation of element.
+
+ int tag() const { return base_is_tagged == kTaggedBase ? kHeapObjectTag : 0; }
};
@@ -46,8 +57,8 @@ struct StaticParameterTraits<const FieldAccess> {
return (val.offset < 16) | (val.representation & 0xffff);
}
static bool Equals(const FieldAccess& a, const FieldAccess& b) {
- return a.offset == b.offset && a.representation == b.representation &&
- a.type->Is(b.type);
+ return a.base_is_tagged == b.base_is_tagged && a.offset == b.offset &&
+ a.representation == b.representation && a.type->Is(b.type);
}
};
@@ -62,7 +73,8 @@ struct StaticParameterTraits<const ElementAccess> {
return (val.header_size < 16) | (val.representation & 0xffff);
}
static bool Equals(const ElementAccess& a, const ElementAccess& b) {
- return a.header_size == b.header_size &&
+ return a.base_is_tagged == b.base_is_tagged &&
+ a.header_size == b.header_size &&
a.representation == b.representation && a.type->Is(b.type);
}
};
« no previous file with comments | « src/compiler/simplified-lowering.cc ('k') | test/cctest/compiler/test-simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698