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

Unified Diff: src/hydrogen-instructions.h

Issue 132373011: A64: Synchronize with r17635. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 66050f1398c1da307365f11854be912f3a39afc3..d2ae9750766cfba4d1ff8c86eb8248b541a59590 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -159,6 +159,7 @@ class LChunkBuilder;
V(Return) \
V(Ror) \
V(Sar) \
+ V(SeqStringGetChar) \
V(SeqStringSetChar) \
V(Shl) \
V(Shr) \
@@ -3258,9 +3259,6 @@ class HDematerializedObject : public HInstruction {
// List of values tracked by this marker.
ZoneList<HValue*> values_;
-
- private:
- virtual bool IsDeletable() const V8_FINAL V8_OVERRIDE { return true; }
};
@@ -3288,6 +3286,8 @@ class HArgumentsObject V8_FINAL : public HDematerializedObject {
set_representation(Representation::Tagged());
SetFlag(kIsArguments);
}
+
+ virtual bool IsDeletable() const V8_FINAL V8_OVERRIDE { return true; }
};
@@ -3324,6 +3324,11 @@ class HCapturedObject V8_FINAL : public HDematerializedObject {
private:
int capture_id_;
+
+ // Note that we cannot DCE captured objects as they are used to replay
+ // the environment. This method is here as an explicit reminder.
+ // TODO(mstarzinger): Turn HSimulates into full snapshots maybe?
+ virtual bool IsDeletable() const V8_FINAL V8_OVERRIDE { return false; }
};
@@ -5803,6 +5808,12 @@ class HObjectAccess V8_FINAL {
FLAG_track_fields ? Representation::Smi() : Representation::Tagged());
}
+ static HObjectAccess ForStringHashField() {
+ return HObjectAccess(kInobject,
+ String::kHashFieldOffset,
+ Representation::Integer32());
+ }
+
static HObjectAccess ForStringLength() {
STATIC_ASSERT(String::kMaxLength <= Smi::kMaxValue);
return HObjectAccess(
@@ -5811,6 +5822,14 @@ class HObjectAccess V8_FINAL {
FLAG_track_fields ? Representation::Smi() : Representation::Tagged());
}
+ static HObjectAccess ForConsStringFirst() {
+ return HObjectAccess(kInobject, ConsString::kFirstOffset);
+ }
+
+ static HObjectAccess ForConsStringSecond() {
+ return HObjectAccess(kInobject, ConsString::kSecondOffset);
+ }
+
static HObjectAccess ForPropertiesPointer() {
return HObjectAccess(kInobject, JSObject::kPropertiesOffset);
}
@@ -5855,7 +5874,13 @@ class HObjectAccess V8_FINAL {
static HObjectAccess ForMapInstanceSize() {
return HObjectAccess(kInobject,
Map::kInstanceSizeOffset,
- Representation::Byte());
+ Representation::UInteger8());
+ }
+
+ static HObjectAccess ForMapInstanceType() {
+ return HObjectAccess(kInobject,
+ Map::kInstanceTypeOffset,
+ Representation::UInteger8());
}
static HObjectAccess ForPropertyCellValue() {
@@ -5933,8 +5958,8 @@ class HObjectAccess V8_FINAL {
}
class PortionField : public BitField<Portion, 0, 3> {};
- class RepresentationField : public BitField<Representation::Kind, 3, 3> {};
- class OffsetField : public BitField<int, 6, 26> {};
+ class RepresentationField : public BitField<Representation::Kind, 3, 4> {};
+ class OffsetField : public BitField<int, 7, 25> {};
uint32_t value_; // encodes portion, representation, and offset
Handle<String> name_;
@@ -5987,7 +6012,10 @@ class HLoadNamedField V8_FINAL : public HTemplateInstruction<1> {
SetOperandAt(0, object);
Representation representation = access.representation();
- if (representation.IsByte()) {
+ if (representation.IsInteger8() ||
+ representation.IsUInteger8() ||
+ representation.IsInteger16() ||
+ representation.IsUInteger16()) {
set_representation(Representation::Integer32());
} else if (representation.IsSmi()) {
set_type(HType::Smi());
@@ -6297,7 +6325,10 @@ class HStoreNamedField V8_FINAL : public HTemplateInstruction<3> {
// object must be external in case of external memory access
return Representation::External();
} else if (index == 1) {
- if (field_representation().IsByte() ||
+ if (field_representation().IsInteger8() ||
+ field_representation().IsUInteger8() ||
+ field_representation().IsInteger16() ||
+ field_representation().IsUInteger16() ||
field_representation().IsInteger32()) {
return Representation::Integer32();
} else if (field_representation().IsDouble() ||
@@ -7023,6 +7054,56 @@ class HDateField V8_FINAL : public HUnaryOperation {
};
+class HSeqStringGetChar V8_FINAL : public HTemplateInstruction<2> {
+ public:
+ static HInstruction* New(Zone* zone,
+ HValue* context,
+ String::Encoding encoding,
+ HValue* string,
+ HValue* index);
+
+ virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
+ return (index == 0) ? Representation::Tagged()
+ : Representation::Integer32();
+ }
+
+ String::Encoding encoding() const { return encoding_; }
+ HValue* string() const { return OperandAt(0); }
+ HValue* index() const { return OperandAt(1); }
+
+ DECLARE_CONCRETE_INSTRUCTION(SeqStringGetChar)
+
+ protected:
+ virtual bool DataEquals(HValue* other) V8_OVERRIDE {
+ return encoding() == HSeqStringGetChar::cast(other)->encoding();
+ }
+
+ virtual Range* InferRange(Zone* zone) V8_OVERRIDE {
+ if (encoding() == String::ONE_BYTE_ENCODING) {
+ return new(zone) Range(0, String::kMaxOneByteCharCode);
+ } else {
+ ASSERT_EQ(String::TWO_BYTE_ENCODING, encoding());
+ return new(zone) Range(0, String::kMaxUtf16CodeUnit);
+ }
+ }
+
+ private:
+ HSeqStringGetChar(String::Encoding encoding,
+ HValue* string,
+ HValue* index) : encoding_(encoding) {
+ SetOperandAt(0, string);
+ SetOperandAt(1, index);
+ set_representation(Representation::Integer32());
+ SetFlag(kUseGVN);
+ SetGVNFlag(kDependsOnStringChars);
+ }
+
+ virtual bool IsDeletable() const V8_OVERRIDE { return true; }
+
+ String::Encoding encoding_;
+};
+
+
class HSeqStringSetChar V8_FINAL : public HTemplateInstruction<3> {
public:
DECLARE_INSTRUCTION_FACTORY_P4(HSeqStringSetChar, String::Encoding,
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698