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

Unified Diff: src/hydrogen-instructions.h

Issue 11464027: Fix crashes in debug output of generated stubs (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix whitespace problems Created 8 years 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 | « no previous file | 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 161e6542d9a59e32934a18e2b5a739363557f630..d8f5dec0f7d90b4bc93c9da0da0e604dd0e65050 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -1937,7 +1937,7 @@ class HJSArrayLength: public HTemplateInstruction<2> {
// object. It is guaranteed to be 32 bit integer, but it can be
// represented as either a smi or heap number.
SetOperandAt(0, value);
- SetOperandAt(1, typecheck);
+ SetOperandAt(1, typecheck != NULL ? typecheck : value);
set_representation(Representation::Tagged());
SetFlag(kUseGVN);
SetGVNFlag(kDependsOnArrayLengths);
@@ -1951,7 +1951,11 @@ class HJSArrayLength: public HTemplateInstruction<2> {
virtual void PrintDataTo(StringStream* stream);
HValue* value() { return OperandAt(0); }
- HValue* typecheck() { return OperandAt(1); }
+ HValue* typecheck() {
+ ASSERT(HasTypeCheck());
+ return OperandAt(1);
+ }
+ bool HasTypeCheck() const { return OperandAt(0) != OperandAt(1); }
DECLARE_CONCRETE_INSTRUCTION(JSArrayLength)
@@ -2152,14 +2156,18 @@ class HLoadElements: public HTemplateInstruction<2> {
public:
HLoadElements(HValue* value, HValue* typecheck) {
SetOperandAt(0, value);
- SetOperandAt(1, typecheck);
+ SetOperandAt(1, typecheck != NULL ? typecheck : value);
set_representation(Representation::Tagged());
SetFlag(kUseGVN);
SetGVNFlag(kDependsOnElementsPointer);
}
HValue* value() { return OperandAt(0); }
- HValue* typecheck() { return OperandAt(1); }
+ HValue* typecheck() {
+ ASSERT(HasTypeCheck());
+ return OperandAt(1);
+ }
+ bool HasTypeCheck() const { return OperandAt(0) != OperandAt(1); }
virtual void PrintDataTo(StringStream* stream);
@@ -4366,7 +4374,7 @@ class HLoadKeyed
SetOperandAt(0, obj);
SetOperandAt(1, key);
- SetOperandAt(2, dependency);
+ SetOperandAt(2, dependency != NULL ? dependency : obj);
if (!is_external()) {
// I can detect the case between storing double (holey and fast) and
@@ -4407,7 +4415,11 @@ class HLoadKeyed
}
HValue* elements() { return OperandAt(0); }
HValue* key() { return OperandAt(1); }
- HValue* dependency() { return OperandAt(2); }
+ HValue* dependency() {
+ ASSERT(HasDependency());
+ return OperandAt(2);
+ }
+ bool HasDependency() const { return OperandAt(0) != OperandAt(2); }
uint32_t index_offset() { return IndexOffsetField::decode(bit_field_); }
void SetIndexOffset(uint32_t index_offset) {
bit_field_ = IndexOffsetField::update(bit_field_, index_offset);
« no previous file with comments | « no previous file | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698