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 "factory.h" | 5 #include "factory.h" |
6 | 6 |
7 #include "isolate-inl.h" | 7 #include "isolate-inl.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 continue; | 522 continue; |
523 } | 523 } |
524 break; | 524 break; |
525 } | 525 } |
526 | 526 |
527 if (str->IsSlicedString()) { | 527 if (str->IsSlicedString()) { |
528 Handle<SlicedString> slice = Handle<SlicedString>::cast(str); | 528 Handle<SlicedString> slice = Handle<SlicedString>::cast(str); |
529 str = Handle<String>(slice->parent(), isolate()); | 529 str = Handle<String>(slice->parent(), isolate()); |
530 offset += slice->offset(); | 530 offset += slice->offset(); |
531 } else { | 531 } else { |
532 str = FlattenGetString(str); | 532 str = String::Flatten(str); |
533 } | 533 } |
534 | 534 |
535 ASSERT(str->IsSeqString() || str->IsExternalString()); | 535 ASSERT(str->IsSeqString() || str->IsExternalString()); |
536 Handle<SlicedString> slice = NewRawSlicedString( | 536 Handle<SlicedString> slice = NewRawSlicedString( |
537 str->IsOneByteRepresentation() ? String::ONE_BYTE_ENCODING | 537 str->IsOneByteRepresentation() ? String::ONE_BYTE_ENCODING |
538 : String::TWO_BYTE_ENCODING); | 538 : String::TWO_BYTE_ENCODING); |
539 | 539 |
540 slice->set_hash_field(String::kEmptyHashField); | 540 slice->set_hash_field(String::kEmptyHashField); |
541 slice->set_length(length); | 541 slice->set_length(length); |
542 slice->set_parent(*str); | 542 slice->set_parent(*str); |
(...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1987 if (name->Equals(h->infinity_string())) return infinity_value(); | 1987 if (name->Equals(h->infinity_string())) return infinity_value(); |
1988 return Handle<Object>::null(); | 1988 return Handle<Object>::null(); |
1989 } | 1989 } |
1990 | 1990 |
1991 | 1991 |
1992 Handle<Object> Factory::ToBoolean(bool value) { | 1992 Handle<Object> Factory::ToBoolean(bool value) { |
1993 return value ? true_value() : false_value(); | 1993 return value ? true_value() : false_value(); |
1994 } | 1994 } |
1995 | 1995 |
1996 } } // namespace v8::internal | 1996 } } // namespace v8::internal |
OLD | NEW |