Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: src/factory.cc

Issue 228093004: Implement handlified String::Flatten. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: even shorter Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/api.cc ('k') | src/handles.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698