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

Side by Side Diff: src/objects.cc

Issue 9536011: Inline one level of recursive call of WriteToFlat for the common case of cons string list. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6844 matching lines...) Expand 10 before | Expand all | Expand 10 after
6855 from = 0; 6855 from = 0;
6856 } else { 6856 } else {
6857 from -= boundary; 6857 from -= boundary;
6858 } 6858 }
6859 to -= boundary; 6859 to -= boundary;
6860 source = cons_string->second(); 6860 source = cons_string->second();
6861 } else { 6861 } else {
6862 // Left hand side is longer. Recurse over right. 6862 // Left hand side is longer. Recurse over right.
6863 if (to > boundary) { 6863 if (to > boundary) {
6864 String* second = cons_string->second(); 6864 String* second = cons_string->second();
6865 WriteToFlat(second, 6865 // When repeatedly appending to a string, we get a cons string that
6866 sink + boundary - from, 6866 // is unbalanced to the left, a list, essentially. We inline the
6867 0, 6867 // common case of sequential ascii right child.
6868 if (to - boundary == 1) {
6869 sink[boundary - from] = static_cast<sinkchar>(second->Get(0));
piscisaureus 2012/05/08 00:00:09 MSVC refuses to inline the Get(0) call. My benchma
6870 } else if (second->IsSeqAsciiString()) {
6871 CopyChars(sink + boundary - from,
piscisaureus 2012/05/08 00:00:09 Ditto.
6872 SeqAsciiString::cast(second)->GetChars(),
6868 to - boundary); 6873 to - boundary);
6874 } else {
6875 WriteToFlat(second,
6876 sink + boundary - from,
6877 0,
6878 to - boundary);
6879 }
6869 to = boundary; 6880 to = boundary;
6870 } 6881 }
6871 source = first; 6882 source = first;
6872 } 6883 }
6873 break; 6884 break;
6874 } 6885 }
6875 case kAsciiStringTag | kSlicedStringTag: 6886 case kAsciiStringTag | kSlicedStringTag:
6876 case kTwoByteStringTag | kSlicedStringTag: { 6887 case kTwoByteStringTag | kSlicedStringTag: {
6877 SlicedString* slice = SlicedString::cast(source); 6888 SlicedString* slice = SlicedString::cast(source);
6878 unsigned offset = slice->offset(); 6889 unsigned offset = slice->offset();
(...skipping 6279 matching lines...) Expand 10 before | Expand all | Expand 10 after
13158 if (break_point_objects()->IsUndefined()) return 0; 13169 if (break_point_objects()->IsUndefined()) return 0;
13159 // Single break point. 13170 // Single break point.
13160 if (!break_point_objects()->IsFixedArray()) return 1; 13171 if (!break_point_objects()->IsFixedArray()) return 1;
13161 // Multiple break points. 13172 // Multiple break points.
13162 return FixedArray::cast(break_point_objects())->length(); 13173 return FixedArray::cast(break_point_objects())->length();
13163 } 13174 }
13164 #endif // ENABLE_DEBUGGER_SUPPORT 13175 #endif // ENABLE_DEBUGGER_SUPPORT
13165 13176
13166 13177
13167 } } // namespace v8::internal 13178 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698