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 <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 11521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11532 } | 11532 } |
11533 case kOneByteStringTag | kConsStringTag: | 11533 case kOneByteStringTag | kConsStringTag: |
11534 case kTwoByteStringTag | kConsStringTag: { | 11534 case kTwoByteStringTag | kConsStringTag: { |
11535 ConsString* cons_string = ConsString::cast(source); | 11535 ConsString* cons_string = ConsString::cast(source); |
11536 String* first = cons_string->first(); | 11536 String* first = cons_string->first(); |
11537 int boundary = first->length(); | 11537 int boundary = first->length(); |
11538 if (to - boundary >= boundary - from) { | 11538 if (to - boundary >= boundary - from) { |
11539 // Right hand side is longer. Recurse over left. | 11539 // Right hand side is longer. Recurse over left. |
11540 if (from < boundary) { | 11540 if (from < boundary) { |
11541 WriteToFlat(first, sink, from, boundary); | 11541 WriteToFlat(first, sink, from, boundary); |
| 11542 if (from == 0 && cons_string->second() == first) { |
| 11543 CopyChars(sink + boundary, sink, boundary); |
| 11544 return; |
| 11545 } |
11542 sink += boundary - from; | 11546 sink += boundary - from; |
11543 from = 0; | 11547 from = 0; |
11544 } else { | 11548 } else { |
11545 from -= boundary; | 11549 from -= boundary; |
11546 } | 11550 } |
11547 to -= boundary; | 11551 to -= boundary; |
11548 source = cons_string->second(); | 11552 source = cons_string->second(); |
11549 } else { | 11553 } else { |
11550 // Left hand side is longer. Recurse over right. | 11554 // Left hand side is longer. Recurse over right. |
11551 if (to > boundary) { | 11555 if (to > boundary) { |
(...skipping 8232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19784 if (cell->value() != *new_value) { | 19788 if (cell->value() != *new_value) { |
19785 cell->set_value(*new_value); | 19789 cell->set_value(*new_value); |
19786 Isolate* isolate = cell->GetIsolate(); | 19790 Isolate* isolate = cell->GetIsolate(); |
19787 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19791 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
19788 isolate, DependentCode::kPropertyCellChangedGroup); | 19792 isolate, DependentCode::kPropertyCellChangedGroup); |
19789 } | 19793 } |
19790 } | 19794 } |
19791 | 19795 |
19792 } // namespace internal | 19796 } // namespace internal |
19793 } // namespace v8 | 19797 } // namespace v8 |
OLD | NEW |