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 "src/string-builder.h" | 5 #include "src/string-builder.h" |
6 | 6 |
| 7 #include "src/isolate-inl.h" |
7 #include "src/objects-inl.h" | 8 #include "src/objects-inl.h" |
8 | 9 |
9 namespace v8 { | 10 namespace v8 { |
10 namespace internal { | 11 namespace internal { |
11 | 12 |
12 MaybeHandle<String> ReplacementStringBuilder::ToString() { | 13 MaybeHandle<String> ReplacementStringBuilder::ToString() { |
13 Isolate* isolate = heap_->isolate(); | 14 Isolate* isolate = heap_->isolate(); |
14 if (array_builder_.length() == 0) { | 15 if (array_builder_.length() == 0) { |
15 return isolate->factory()->empty_string(); | 16 return isolate->factory()->empty_string(); |
16 } | 17 } |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 101 |
101 | 102 |
102 void IncrementalStringBuilder::AppendString(Handle<String> string) { | 103 void IncrementalStringBuilder::AppendString(Handle<String> string) { |
103 ShrinkCurrentPart(); | 104 ShrinkCurrentPart(); |
104 part_length_ = kInitialPartLength; // Allocate conservatively. | 105 part_length_ = kInitialPartLength; // Allocate conservatively. |
105 Extend(); // Attach current part and allocate new part. | 106 Extend(); // Attach current part and allocate new part. |
106 Accumulate(string); | 107 Accumulate(string); |
107 } | 108 } |
108 } // namespace internal | 109 } // namespace internal |
109 } // namespace v8 | 110 } // namespace v8 |
OLD | NEW |