OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 2715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2726 if ( (length == -1) || (length > str->length() - start) ) | 2726 if ( (length == -1) || (length > str->length() - start) ) |
2727 end = str->length() - start; | 2727 end = str->length() - start; |
2728 if (end < 0) return 0; | 2728 if (end < 0) return 0; |
2729 i::String::WriteToFlat(*str, buffer, start, end); | 2729 i::String::WriteToFlat(*str, buffer, start, end); |
2730 if (length == -1 || end < length) | 2730 if (length == -1 || end < length) |
2731 buffer[end] = '\0'; | 2731 buffer[end] = '\0'; |
2732 return end; | 2732 return end; |
2733 } | 2733 } |
2734 | 2734 |
2735 | 2735 |
| 2736 void v8::String::Flatten() { |
| 2737 if (IsDeadCheck("v8::String::Flatten()")) return; |
| 2738 i::Handle<i::String> str = Utils::OpenHandle(this); |
| 2739 i::FlattenString(str); |
| 2740 } |
| 2741 |
| 2742 |
2736 bool v8::String::IsExternal() const { | 2743 bool v8::String::IsExternal() const { |
2737 EnsureInitialized("v8::String::IsExternal()"); | 2744 EnsureInitialized("v8::String::IsExternal()"); |
2738 i::Handle<i::String> str = Utils::OpenHandle(this); | 2745 i::Handle<i::String> str = Utils::OpenHandle(this); |
2739 return i::StringShape(*str).IsExternalTwoByte(); | 2746 return i::StringShape(*str).IsExternalTwoByte(); |
2740 } | 2747 } |
2741 | 2748 |
2742 | 2749 |
2743 bool v8::String::IsExternalAscii() const { | 2750 bool v8::String::IsExternalAscii() const { |
2744 EnsureInitialized("v8::String::IsExternalAscii()"); | 2751 EnsureInitialized("v8::String::IsExternalAscii()"); |
2745 i::Handle<i::String> str = Utils::OpenHandle(this); | 2752 i::Handle<i::String> str = Utils::OpenHandle(this); |
(...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4206 | 4213 |
4207 | 4214 |
4208 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 4215 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
4209 HandleScopeImplementer* thread_local = | 4216 HandleScopeImplementer* thread_local = |
4210 reinterpret_cast<HandleScopeImplementer*>(storage); | 4217 reinterpret_cast<HandleScopeImplementer*>(storage); |
4211 thread_local->IterateThis(v); | 4218 thread_local->IterateThis(v); |
4212 return storage + ArchiveSpacePerThread(); | 4219 return storage + ArchiveSpacePerThread(); |
4213 } | 4220 } |
4214 | 4221 |
4215 } } // namespace v8::internal | 4222 } } // namespace v8::internal |
OLD | NEW |