OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/deoptimizer.h" | 8 #include "src/deoptimizer.h" |
9 #include "src/lookup.h" | 9 #include "src/lookup.h" |
10 #include "src/lookup-inl.h" | 10 #include "src/lookup-inl.h" |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 DCHECK_EQ(v8::internal::CONSTANT, property_details_.type()); | 307 DCHECK_EQ(v8::internal::CONSTANT, property_details_.type()); |
308 } | 308 } |
309 } | 309 } |
310 | 310 |
311 | 311 |
312 bool LookupIterator::IsSpecialNumericIndex() const { | 312 bool LookupIterator::IsSpecialNumericIndex() const { |
313 if (GetStoreTarget()->IsJSTypedArray() && name()->IsString()) { | 313 if (GetStoreTarget()->IsJSTypedArray() && name()->IsString()) { |
314 Handle<String> name_string = Handle<String>::cast(name()); | 314 Handle<String> name_string = Handle<String>::cast(name()); |
315 if (name_string->length() > 0) { | 315 if (name_string->length() > 0) { |
316 double d = | 316 double d = |
317 StringToDouble(isolate()->unicode_cache(), *name_string, NO_FLAGS); | 317 StringToDouble(isolate()->unicode_cache(), name_string, NO_FLAGS); |
318 if (!std::isnan(d)) { | 318 if (!std::isnan(d)) { |
319 if (String::Equals(isolate()->factory()->minus_zero_string(), | 319 if (String::Equals(isolate()->factory()->minus_zero_string(), |
320 name_string)) | 320 name_string)) |
321 return true; | 321 return true; |
322 | 322 |
323 Factory* factory = isolate()->factory(); | 323 Factory* factory = isolate()->factory(); |
324 Handle<Object> num = factory->NewNumber(d); | 324 Handle<Object> num = factory->NewNumber(d); |
325 Handle<String> roundtrip_string = factory->NumberToString(num); | 325 Handle<String> roundtrip_string = factory->NumberToString(num); |
326 if (String::Equals(name_string, roundtrip_string)) return true; | 326 if (String::Equals(name_string, roundtrip_string)) return true; |
327 } | 327 } |
328 } | 328 } |
329 } | 329 } |
330 return false; | 330 return false; |
331 } | 331 } |
332 | 332 |
333 | 333 |
334 void LookupIterator::InternalizeName() { | 334 void LookupIterator::InternalizeName() { |
335 if (name_->IsUniqueName()) return; | 335 if (name_->IsUniqueName()) return; |
336 name_ = factory()->InternalizeString(Handle<String>::cast(name_)); | 336 name_ = factory()->InternalizeString(Handle<String>::cast(name_)); |
337 } | 337 } |
338 } } // namespace v8::internal | 338 } } // namespace v8::internal |
OLD | NEW |