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

Unified Diff: src/hydrogen-instructions.h

Issue 22831003: Pass checked values to HLoadNamedField, removing the need for extra type-check field. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen-escape-analysis.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 b4fc65635f47b6db2396208e73b0b3b9e124f996..060066de4809fcbc049aadab68ef1976b4b8aa46 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -1359,6 +1359,9 @@ class HCompareMap: public HUnaryControlInstruction {
DECLARE_CONCRETE_INSTRUCTION(CompareMap)
+ protected:
+ virtual int RedefinedOperandIndex() { return 0; }
+
private:
Handle<Map> map_;
};
@@ -2598,6 +2601,8 @@ class HCheckMaps: public HTemplateInstruction<2> {
return true;
}
+ virtual int RedefinedOperandIndex() { return 0; }
+
private:
// Clients should use one of the static New* methods above.
HCheckMaps(HValue* value, Zone *zone, HValue* typecheck)
@@ -2714,6 +2719,8 @@ class HCheckInstanceType: public HUnaryOperation {
return check_ == b->check_;
}
+ virtual int RedefinedOperandIndex() { return 0; }
+
private:
enum Check {
IS_SPEC_OBJECT,
@@ -5555,20 +5562,13 @@ class HObjectAccess {
};
-class HLoadNamedField: public HTemplateInstruction<2> {
+class HLoadNamedField: public HTemplateInstruction<1> {
public:
DECLARE_INSTRUCTION_FACTORY_P2(HLoadNamedField, HValue*, HObjectAccess);
- DECLARE_INSTRUCTION_FACTORY_P3(HLoadNamedField, HValue*, HObjectAccess,
- HValue*);
HValue* object() { return OperandAt(0); }
- HValue* typecheck() {
- ASSERT(HasTypeCheck());
- return OperandAt(1);
- }
-
- bool HasTypeCheck() const { return OperandAt(0) != OperandAt(1); }
- void ClearTypeCheck() { SetOperandAt(1, object()); }
+ bool HasTypeCheck() { return object()->IsCheckMaps(); }
+ void ClearTypeCheck() { SetOperandAt(0, object()->ActualValue()); }
HObjectAccess access() const { return access_; }
Representation field_representation() const {
return access_.representation();
@@ -5594,13 +5594,9 @@ class HLoadNamedField: public HTemplateInstruction<2> {
}
private:
- HLoadNamedField(HValue* object,
- HObjectAccess access,
- HValue* typecheck = NULL)
- : access_(access) {
+ HLoadNamedField(HValue* object, HObjectAccess access) : access_(access) {
ASSERT(object != NULL);
SetOperandAt(0, object);
- SetOperandAt(1, typecheck != NULL ? typecheck : object);
Representation representation = access.representation();
if (representation.IsSmi()) {
« no previous file with comments | « src/hydrogen-escape-analysis.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698