Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: src/objects.h

Issue 6075005: Change scanner buffers to not use utf-8. (Closed)
Patch Set: Fixed linto. Created 9 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap-inl.h ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 2309 matching lines...) Expand 10 before | Expand all | Expand 10 after
2320 // 2320 //
2321 // No special elements in the prefix and the element size is 1 2321 // No special elements in the prefix and the element size is 1
2322 // because only the symbol itself (the key) needs to be stored. 2322 // because only the symbol itself (the key) needs to be stored.
2323 class SymbolTable: public HashTable<SymbolTableShape, HashTableKey*> { 2323 class SymbolTable: public HashTable<SymbolTableShape, HashTableKey*> {
2324 public: 2324 public:
2325 // Find symbol in the symbol table. If it is not there yet, it is 2325 // Find symbol in the symbol table. If it is not there yet, it is
2326 // added. The return value is the symbol table which might have 2326 // added. The return value is the symbol table which might have
2327 // been enlarged. If the return value is not a failure, the symbol 2327 // been enlarged. If the return value is not a failure, the symbol
2328 // pointer *s is set to the symbol found. 2328 // pointer *s is set to the symbol found.
2329 MUST_USE_RESULT MaybeObject* LookupSymbol(Vector<const char> str, Object** s); 2329 MUST_USE_RESULT MaybeObject* LookupSymbol(Vector<const char> str, Object** s);
2330 MUST_USE_RESULT MaybeObject* LookupAsciiSymbol(Vector<const char> str,
2331 Object** s);
2332 MUST_USE_RESULT MaybeObject* LookupTwoByteSymbol(Vector<const uc16> str,
2333 Object** s);
2330 MUST_USE_RESULT MaybeObject* LookupString(String* key, Object** s); 2334 MUST_USE_RESULT MaybeObject* LookupString(String* key, Object** s);
2331 2335
2332 // Looks up a symbol that is equal to the given string and returns 2336 // Looks up a symbol that is equal to the given string and returns
2333 // true if it is found, assigning the symbol to the given output 2337 // true if it is found, assigning the symbol to the given output
2334 // parameter. 2338 // parameter.
2335 bool LookupSymbolIfExists(String* str, String** symbol); 2339 bool LookupSymbolIfExists(String* str, String** symbol);
2336 bool LookupTwoCharsSymbolIfExists(uint32_t c1, uint32_t c2, String** symbol); 2340 bool LookupTwoCharsSymbolIfExists(uint32_t c1, uint32_t c2, String** symbol);
2337 2341
2338 // Casting. 2342 // Casting.
2339 static inline SymbolTable* cast(Object* obj); 2343 static inline SymbolTable* cast(Object* obj);
(...skipping 2727 matching lines...) Expand 10 before | Expand all | Expand 10 after
5067 bool MarkAsUndetectable(); 5071 bool MarkAsUndetectable();
5068 5072
5069 // Return a substring. 5073 // Return a substring.
5070 MUST_USE_RESULT MaybeObject* SubString(int from, 5074 MUST_USE_RESULT MaybeObject* SubString(int from,
5071 int to, 5075 int to,
5072 PretenureFlag pretenure = NOT_TENURED); 5076 PretenureFlag pretenure = NOT_TENURED);
5073 5077
5074 // String equality operations. 5078 // String equality operations.
5075 inline bool Equals(String* other); 5079 inline bool Equals(String* other);
5076 bool IsEqualTo(Vector<const char> str); 5080 bool IsEqualTo(Vector<const char> str);
5081 bool IsAsciiEqualTo(Vector<const char> str);
5082 bool IsTwoByteEqualTo(Vector<const uc16> str);
5077 5083
5078 // Return a UTF8 representation of the string. The string is null 5084 // Return a UTF8 representation of the string. The string is null
5079 // terminated but may optionally contain nulls. Length is returned 5085 // terminated but may optionally contain nulls. Length is returned
5080 // in length_output if length_output is not a null pointer The string 5086 // in length_output if length_output is not a null pointer The string
5081 // should be nearly flat, otherwise the performance of this method may 5087 // should be nearly flat, otherwise the performance of this method may
5082 // be very slow (quadratic in the length). Setting robustness_flag to 5088 // be very slow (quadratic in the length). Setting robustness_flag to
5083 // ROBUST_STRING_TRAVERSAL invokes behaviour that is robust This means it 5089 // ROBUST_STRING_TRAVERSAL invokes behaviour that is robust This means it
5084 // handles unexpected data without causing assert failures and it does not 5090 // handles unexpected data without causing assert failures and it does not
5085 // do any heap allocations. This is useful when printing stack traces. 5091 // do any heap allocations. This is useful when printing stack traces.
5086 SmartPointer<char> ToCString(AllowNullsFlag allow_nulls, 5092 SmartPointer<char> ToCString(AllowNullsFlag allow_nulls,
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after
6376 } else { 6382 } else {
6377 value &= ~(1 << bit_position); 6383 value &= ~(1 << bit_position);
6378 } 6384 }
6379 return value; 6385 return value;
6380 } 6386 }
6381 }; 6387 };
6382 6388
6383 } } // namespace v8::internal 6389 } } // namespace v8::internal
6384 6390
6385 #endif // V8_OBJECTS_H_ 6391 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/heap-inl.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698