OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <memory> | 9 #include <memory> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 11074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11085 cons_string = ConsString::cast(string); | 11085 cons_string = ConsString::cast(string); |
11086 PushRight(cons_string); | 11086 PushRight(cons_string); |
11087 // Need to traverse all the way left. | 11087 // Need to traverse all the way left. |
11088 while (true) { | 11088 while (true) { |
11089 // Continue left. | 11089 // Continue left. |
11090 string = cons_string->first(); | 11090 string = cons_string->first(); |
11091 type = string->map()->instance_type(); | 11091 type = string->map()->instance_type(); |
11092 if ((type & kStringRepresentationMask) != kConsStringTag) { | 11092 if ((type & kStringRepresentationMask) != kConsStringTag) { |
11093 AdjustMaximumDepth(); | 11093 AdjustMaximumDepth(); |
11094 int length = string->length(); | 11094 int length = string->length(); |
11095 DCHECK(length != 0); | 11095 if (length == 0) break; // Skip empty left-hand sides of ConsStrings. |
11096 consumed_ += length; | 11096 consumed_ += length; |
11097 return string; | 11097 return string; |
11098 } | 11098 } |
11099 cons_string = ConsString::cast(string); | 11099 cons_string = ConsString::cast(string); |
11100 PushLeft(cons_string); | 11100 PushLeft(cons_string); |
11101 } | 11101 } |
11102 } | 11102 } |
11103 UNREACHABLE(); | 11103 UNREACHABLE(); |
11104 return NULL; | 11104 return NULL; |
11105 } | 11105 } |
(...skipping 8789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19895 .is_null()) { | 19895 .is_null()) { |
19896 return false; | 19896 return false; |
19897 } | 19897 } |
19898 } | 19898 } |
19899 | 19899 |
19900 return true; | 19900 return true; |
19901 } | 19901 } |
19902 | 19902 |
19903 } // namespace internal | 19903 } // namespace internal |
19904 } // namespace v8 | 19904 } // namespace v8 |
OLD | NEW |