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

Side by Side Diff: src/hydrogen-instructions.h

Issue 565183004: Fix the IsTheHole bug. (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@bleeding_edge
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_
6 #define V8_HYDROGEN_INSTRUCTIONS_H_ 6 #define V8_HYDROGEN_INSTRUCTIONS_H_
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 3575 matching lines...) Expand 10 before | Expand all | Expand 10 after
3586 bool HasSmiValue() const { return has_smi_value_; } 3586 bool HasSmiValue() const { return has_smi_value_; }
3587 bool HasDoubleValue() const { return has_double_value_; } 3587 bool HasDoubleValue() const { return has_double_value_; }
3588 double DoubleValue() const { 3588 double DoubleValue() const {
3589 DCHECK(HasDoubleValue()); 3589 DCHECK(HasDoubleValue());
3590 return double_value_; 3590 return double_value_;
3591 } 3591 }
3592 bool IsTheHole() const { 3592 bool IsTheHole() const {
3593 if (HasDoubleValue() && FixedDoubleArray::is_the_hole_nan(double_value_)) { 3593 if (HasDoubleValue() && FixedDoubleArray::is_the_hole_nan(double_value_)) {
3594 return true; 3594 return true;
3595 } 3595 }
3596 return object_.IsKnownGlobal(isolate()->heap()->the_hole_value()); 3596 return object_.IsInitialized() &&
3597 object_.IsKnownGlobal(isolate()->heap()->the_hole_value());
3597 } 3598 }
3598 bool HasNumberValue() const { return has_double_value_; } 3599 bool HasNumberValue() const { return has_double_value_; }
3599 int32_t NumberValueAsInteger32() const { 3600 int32_t NumberValueAsInteger32() const {
3600 DCHECK(HasNumberValue()); 3601 DCHECK(HasNumberValue());
3601 // Irrespective of whether a numeric HConstant can be safely 3602 // Irrespective of whether a numeric HConstant can be safely
3602 // represented as an int32, we store the (in some cases lossy) 3603 // represented as an int32, we store the (in some cases lossy)
3603 // representation of the number in int32_value_. 3604 // representation of the number in int32_value_.
3604 return int32_value_; 3605 return int32_value_;
3605 } 3606 }
3606 bool HasStringValue() const { 3607 bool HasStringValue() const {
(...skipping 4287 matching lines...) Expand 10 before | Expand all | Expand 10 after
7894 }; 7895 };
7895 7896
7896 7897
7897 7898
7898 #undef DECLARE_INSTRUCTION 7899 #undef DECLARE_INSTRUCTION
7899 #undef DECLARE_CONCRETE_INSTRUCTION 7900 #undef DECLARE_CONCRETE_INSTRUCTION
7900 7901
7901 } } // namespace v8::internal 7902 } } // namespace v8::internal
7902 7903
7903 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7904 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698