Chromium Code Reviews| 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 400 bool IsHeapNumber() const { | 400 bool IsHeapNumber() const { |
| 401 ASSERT(type_ != kUninitialized); | 401 ASSERT(type_ != kUninitialized); |
| 402 return ((type_ & kHeapNumber) == kHeapNumber); | 402 return ((type_ & kHeapNumber) == kHeapNumber); |
| 403 } | 403 } |
| 404 | 404 |
| 405 bool IsString() const { | 405 bool IsString() const { |
| 406 ASSERT(type_ != kUninitialized); | 406 ASSERT(type_ != kUninitialized); |
| 407 return ((type_ & kString) == kString); | 407 return ((type_ & kString) == kString); |
| 408 } | 408 } |
| 409 | 409 |
| 410 bool IsNoString() const { | |
|
Toon Verwaest
2013/07/22 08:30:21
Can we name this IsNonString, in line with IsNonPr
oliv
2013/07/22 13:56:43
Done.
| |
| 411 if (IsTaggedPrimitive() || IsSmi() || IsHeapNumber() || | |
|
Sven Panne
2013/07/22 07:06:36
o_O o_O o_O
return IsTaggedPrimitive() || IsSmi()
oliv
2013/07/22 07:34:30
lol, that's embarrassing
| |
| 412 IsBoolean() || IsJSArray()) { | |
| 413 return true; | |
| 414 } | |
| 415 return false; | |
| 416 } | |
| 417 | |
| 410 bool IsBoolean() const { | 418 bool IsBoolean() const { |
| 411 ASSERT(type_ != kUninitialized); | 419 ASSERT(type_ != kUninitialized); |
| 412 return ((type_ & kBoolean) == kBoolean); | 420 return ((type_ & kBoolean) == kBoolean); |
| 413 } | 421 } |
| 414 | 422 |
| 415 bool IsNonPrimitive() const { | 423 bool IsNonPrimitive() const { |
| 416 ASSERT(type_ != kUninitialized); | 424 ASSERT(type_ != kUninitialized); |
| 417 return ((type_ & kNonPrimitive) == kNonPrimitive); | 425 return ((type_ & kNonPrimitive) == kNonPrimitive); |
| 418 } | 426 } |
| 419 | 427 |
| (...skipping 2923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3343 if (HasInteger32Value()) return Representation::Integer32(); | 3351 if (HasInteger32Value()) return Representation::Integer32(); |
| 3344 if (HasNumberValue()) return Representation::Double(); | 3352 if (HasNumberValue()) return Representation::Double(); |
| 3345 return Representation::Tagged(); | 3353 return Representation::Tagged(); |
| 3346 } | 3354 } |
| 3347 | 3355 |
| 3348 virtual bool EmitAtUses(); | 3356 virtual bool EmitAtUses(); |
| 3349 virtual void PrintDataTo(StringStream* stream); | 3357 virtual void PrintDataTo(StringStream* stream); |
| 3350 virtual HType CalculateInferredType(); | 3358 virtual HType CalculateInferredType(); |
| 3351 bool IsInteger() { return handle()->IsSmi(); } | 3359 bool IsInteger() { return handle()->IsSmi(); } |
| 3352 HConstant* CopyToRepresentation(Representation r, Zone* zone) const; | 3360 HConstant* CopyToRepresentation(Representation r, Zone* zone) const; |
| 3353 HConstant* CopyToTruncatedInt32(Zone* zone) const; | 3361 HConstant* CopyToTruncatedInt32(Zone* zone); |
|
Toon Verwaest
2013/07/22 08:30:21
I guess you tried hard to keep this const? I'd pre
oliv
2013/07/22 13:56:43
the problem is deferred handle dereference in Trun
| |
| 3362 HConstant* CopyToTruncatedNumber(Zone* zone); | |
|
Jakob Kummerow
2013/07/22 07:43:47
This sounds more generic than it is. How about "Co
Toon Verwaest
2013/07/22 08:30:21
I think the original name is fine. CopyToTruncated
oliv
2013/07/22 13:56:43
How about returning Maybe<>, now it is clear, that
| |
| 3354 bool HasInteger32Value() const { return has_int32_value_; } | 3363 bool HasInteger32Value() const { return has_int32_value_; } |
| 3355 int32_t Integer32Value() const { | 3364 int32_t Integer32Value() const { |
| 3356 ASSERT(HasInteger32Value()); | 3365 ASSERT(HasInteger32Value()); |
| 3357 return int32_value_; | 3366 return int32_value_; |
| 3358 } | 3367 } |
| 3359 bool HasSmiValue() const { return has_smi_value_; } | 3368 bool HasSmiValue() const { return has_smi_value_; } |
| 3360 bool HasDoubleValue() const { return has_double_value_; } | 3369 bool HasDoubleValue() const { return has_double_value_; } |
| 3361 double DoubleValue() const { | 3370 double DoubleValue() const { |
| 3362 ASSERT(HasDoubleValue()); | 3371 ASSERT(HasDoubleValue()); |
| 3363 return double_value_; | 3372 return double_value_; |
| (...skipping 3317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6681 virtual bool IsDeletable() const { return true; } | 6690 virtual bool IsDeletable() const { return true; } |
| 6682 }; | 6691 }; |
| 6683 | 6692 |
| 6684 | 6693 |
| 6685 #undef DECLARE_INSTRUCTION | 6694 #undef DECLARE_INSTRUCTION |
| 6686 #undef DECLARE_CONCRETE_INSTRUCTION | 6695 #undef DECLARE_CONCRETE_INSTRUCTION |
| 6687 | 6696 |
| 6688 } } // namespace v8::internal | 6697 } } // namespace v8::internal |
| 6689 | 6698 |
| 6690 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6699 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |