OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 bool IsHeapNumber() const { | 401 bool IsHeapNumber() const { |
402 ASSERT(type_ != kUninitialized); | 402 ASSERT(type_ != kUninitialized); |
403 return ((type_ & kHeapNumber) == kHeapNumber); | 403 return ((type_ & kHeapNumber) == kHeapNumber); |
404 } | 404 } |
405 | 405 |
406 bool IsString() const { | 406 bool IsString() const { |
407 ASSERT(type_ != kUninitialized); | 407 ASSERT(type_ != kUninitialized); |
408 return ((type_ & kString) == kString); | 408 return ((type_ & kString) == kString); |
409 } | 409 } |
410 | 410 |
| 411 bool IsNonString() const { |
| 412 return IsTaggedPrimitive() || IsSmi() || IsHeapNumber() || |
| 413 IsBoolean() || IsJSArray(); |
| 414 } |
| 415 |
411 bool IsBoolean() const { | 416 bool IsBoolean() const { |
412 ASSERT(type_ != kUninitialized); | 417 ASSERT(type_ != kUninitialized); |
413 return ((type_ & kBoolean) == kBoolean); | 418 return ((type_ & kBoolean) == kBoolean); |
414 } | 419 } |
415 | 420 |
416 bool IsNonPrimitive() const { | 421 bool IsNonPrimitive() const { |
417 ASSERT(type_ != kUninitialized); | 422 ASSERT(type_ != kUninitialized); |
418 return ((type_ & kNonPrimitive) == kNonPrimitive); | 423 return ((type_ & kNonPrimitive) == kNonPrimitive); |
419 } | 424 } |
420 | 425 |
(...skipping 2923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3344 if (HasInteger32Value()) return Representation::Integer32(); | 3349 if (HasInteger32Value()) return Representation::Integer32(); |
3345 if (HasNumberValue()) return Representation::Double(); | 3350 if (HasNumberValue()) return Representation::Double(); |
3346 return Representation::Tagged(); | 3351 return Representation::Tagged(); |
3347 } | 3352 } |
3348 | 3353 |
3349 virtual bool EmitAtUses(); | 3354 virtual bool EmitAtUses(); |
3350 virtual void PrintDataTo(StringStream* stream); | 3355 virtual void PrintDataTo(StringStream* stream); |
3351 virtual HType CalculateInferredType(); | 3356 virtual HType CalculateInferredType(); |
3352 bool IsInteger() { return handle()->IsSmi(); } | 3357 bool IsInteger() { return handle()->IsSmi(); } |
3353 HConstant* CopyToRepresentation(Representation r, Zone* zone) const; | 3358 HConstant* CopyToRepresentation(Representation r, Zone* zone) const; |
3354 HConstant* CopyToTruncatedInt32(Zone* zone) const; | 3359 Maybe<HConstant*> CopyToTruncatedInt32(Zone* zone); |
| 3360 Maybe<HConstant*> CopyToTruncatedNumber(Zone* zone); |
3355 bool HasInteger32Value() const { return has_int32_value_; } | 3361 bool HasInteger32Value() const { return has_int32_value_; } |
3356 int32_t Integer32Value() const { | 3362 int32_t Integer32Value() const { |
3357 ASSERT(HasInteger32Value()); | 3363 ASSERT(HasInteger32Value()); |
3358 return int32_value_; | 3364 return int32_value_; |
3359 } | 3365 } |
3360 bool HasSmiValue() const { return has_smi_value_; } | 3366 bool HasSmiValue() const { return has_smi_value_; } |
3361 bool HasDoubleValue() const { return has_double_value_; } | 3367 bool HasDoubleValue() const { return has_double_value_; } |
3362 double DoubleValue() const { | 3368 double DoubleValue() const { |
3363 ASSERT(HasDoubleValue()); | 3369 ASSERT(HasDoubleValue()); |
3364 return double_value_; | 3370 return double_value_; |
(...skipping 3330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6695 virtual bool IsDeletable() const { return true; } | 6701 virtual bool IsDeletable() const { return true; } |
6696 }; | 6702 }; |
6697 | 6703 |
6698 | 6704 |
6699 #undef DECLARE_INSTRUCTION | 6705 #undef DECLARE_INSTRUCTION |
6700 #undef DECLARE_CONCRETE_INSTRUCTION | 6706 #undef DECLARE_CONCRETE_INSTRUCTION |
6701 | 6707 |
6702 } } // namespace v8::internal | 6708 } } // namespace v8::internal |
6703 | 6709 |
6704 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6710 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |