| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 switch (type_) { | 149 switch (type_) { |
| 150 case STRING: | 150 case STRING: |
| 151 DCHECK(string_ != NULL); | 151 DCHECK(string_ != NULL); |
| 152 return !string_->IsEmpty(); | 152 return !string_->IsEmpty(); |
| 153 case SYMBOL: | 153 case SYMBOL: |
| 154 UNREACHABLE(); | 154 UNREACHABLE(); |
| 155 break; | 155 break; |
| 156 case NUMBER_WITH_DOT: | 156 case NUMBER_WITH_DOT: |
| 157 case NUMBER: | 157 case NUMBER: |
| 158 return DoubleToBoolean(number_); | 158 return DoubleToBoolean(number_); |
| 159 case SMI_WITH_DOT: |
| 159 case SMI: | 160 case SMI: |
| 160 return smi_ != 0; | 161 return smi_ != 0; |
| 161 case BOOLEAN: | 162 case BOOLEAN: |
| 162 return bool_; | 163 return bool_; |
| 163 case NULL_TYPE: | 164 case NULL_TYPE: |
| 164 return false; | 165 return false; |
| 165 case THE_HOLE: | 166 case THE_HOLE: |
| 166 UNREACHABLE(); | 167 UNREACHABLE(); |
| 167 break; | 168 break; |
| 168 case UNDEFINED: | 169 case UNDEFINED: |
| (...skipping 19 matching lines...) Expand all Loading... |
| 188 value_ = isolate->factory()->has_instance_symbol(); | 189 value_ = isolate->factory()->has_instance_symbol(); |
| 189 } else { | 190 } else { |
| 190 DCHECK_EQ(0, strcmp(symbol_name_, "home_object_symbol")); | 191 DCHECK_EQ(0, strcmp(symbol_name_, "home_object_symbol")); |
| 191 value_ = isolate->factory()->home_object_symbol(); | 192 value_ = isolate->factory()->home_object_symbol(); |
| 192 } | 193 } |
| 193 break; | 194 break; |
| 194 case NUMBER_WITH_DOT: | 195 case NUMBER_WITH_DOT: |
| 195 case NUMBER: | 196 case NUMBER: |
| 196 value_ = isolate->factory()->NewNumber(number_, TENURED); | 197 value_ = isolate->factory()->NewNumber(number_, TENURED); |
| 197 break; | 198 break; |
| 199 case SMI_WITH_DOT: |
| 198 case SMI: | 200 case SMI: |
| 199 value_ = handle(Smi::FromInt(smi_), isolate); | 201 value_ = handle(Smi::FromInt(smi_), isolate); |
| 200 break; | 202 break; |
| 201 case BOOLEAN: | 203 case BOOLEAN: |
| 202 if (bool_) { | 204 if (bool_) { |
| 203 value_ = isolate->factory()->true_value(); | 205 value_ = isolate->factory()->true_value(); |
| 204 } else { | 206 } else { |
| 205 value_ = isolate->factory()->false_value(); | 207 value_ = isolate->factory()->false_value(); |
| 206 } | 208 } |
| 207 break; | 209 break; |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 length) == 0; | 407 length) == 0; |
| 406 } else { | 408 } else { |
| 407 return CompareCharsUnsigned(reinterpret_cast<const uint16_t*>(l), | 409 return CompareCharsUnsigned(reinterpret_cast<const uint16_t*>(l), |
| 408 reinterpret_cast<const uint16_t*>(r), | 410 reinterpret_cast<const uint16_t*>(r), |
| 409 length) == 0; | 411 length) == 0; |
| 410 } | 412 } |
| 411 } | 413 } |
| 412 } | 414 } |
| 413 } // namespace internal | 415 } // namespace internal |
| 414 } // namespace v8 | 416 } // namespace v8 |
| OLD | NEW |