OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 4152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4163 if (!maybe_new_table->ToObject(&new_table)) return maybe_new_table; | 4163 if (!maybe_new_table->ToObject(&new_table)) return maybe_new_table; |
4164 } | 4164 } |
4165 // Can't use set_symbol_table because SymbolTable::cast knows that | 4165 // Can't use set_symbol_table because SymbolTable::cast knows that |
4166 // SymbolTable is a singleton and checks for identity. | 4166 // SymbolTable is a singleton and checks for identity. |
4167 roots_[kSymbolTableRootIndex] = new_table; | 4167 roots_[kSymbolTableRootIndex] = new_table; |
4168 ASSERT(symbol != NULL); | 4168 ASSERT(symbol != NULL); |
4169 return symbol; | 4169 return symbol; |
4170 } | 4170 } |
4171 | 4171 |
4172 | 4172 |
| 4173 MaybeObject* Heap::LookupAsciiSymbol(Handle<SeqAsciiString> string, |
| 4174 int from, |
| 4175 int length) { |
| 4176 Object* symbol = NULL; |
| 4177 Object* new_table; |
| 4178 { MaybeObject* maybe_new_table = |
| 4179 symbol_table()->LookupSubStringAsciiSymbol(string, |
| 4180 from, |
| 4181 length, |
| 4182 &symbol); |
| 4183 if (!maybe_new_table->ToObject(&new_table)) return maybe_new_table; |
| 4184 } |
| 4185 // Can't use set_symbol_table because SymbolTable::cast knows that |
| 4186 // SymbolTable is a singleton and checks for identity. |
| 4187 roots_[kSymbolTableRootIndex] = new_table; |
| 4188 ASSERT(symbol != NULL); |
| 4189 return symbol; |
| 4190 } |
| 4191 |
| 4192 |
4173 MaybeObject* Heap::LookupTwoByteSymbol(Vector<const uc16> string) { | 4193 MaybeObject* Heap::LookupTwoByteSymbol(Vector<const uc16> string) { |
4174 Object* symbol = NULL; | 4194 Object* symbol = NULL; |
4175 Object* new_table; | 4195 Object* new_table; |
4176 { MaybeObject* maybe_new_table = | 4196 { MaybeObject* maybe_new_table = |
4177 symbol_table()->LookupTwoByteSymbol(string, &symbol); | 4197 symbol_table()->LookupTwoByteSymbol(string, &symbol); |
4178 if (!maybe_new_table->ToObject(&new_table)) return maybe_new_table; | 4198 if (!maybe_new_table->ToObject(&new_table)) return maybe_new_table; |
4179 } | 4199 } |
4180 // Can't use set_symbol_table because SymbolTable::cast knows that | 4200 // Can't use set_symbol_table because SymbolTable::cast knows that |
4181 // SymbolTable is a singleton and checks for identity. | 4201 // SymbolTable is a singleton and checks for identity. |
4182 roots_[kSymbolTableRootIndex] = new_table; | 4202 roots_[kSymbolTableRootIndex] = new_table; |
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5883 } | 5903 } |
5884 | 5904 |
5885 | 5905 |
5886 void ExternalStringTable::TearDown() { | 5906 void ExternalStringTable::TearDown() { |
5887 new_space_strings_.Free(); | 5907 new_space_strings_.Free(); |
5888 old_space_strings_.Free(); | 5908 old_space_strings_.Free(); |
5889 } | 5909 } |
5890 | 5910 |
5891 | 5911 |
5892 } } // namespace v8::internal | 5912 } } // namespace v8::internal |
OLD | NEW |