| OLD | NEW | 
|     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 20 matching lines...) Expand all  Loading... | 
|    31 #include "api.h" |    31 #include "api.h" | 
|    32 #include "bootstrapper.h" |    32 #include "bootstrapper.h" | 
|    33 #include "codegen-inl.h" |    33 #include "codegen-inl.h" | 
|    34 #include "compilation-cache.h" |    34 #include "compilation-cache.h" | 
|    35 #include "debug.h" |    35 #include "debug.h" | 
|    36 #include "heap-profiler.h" |    36 #include "heap-profiler.h" | 
|    37 #include "global-handles.h" |    37 #include "global-handles.h" | 
|    38 #include "mark-compact.h" |    38 #include "mark-compact.h" | 
|    39 #include "natives.h" |    39 #include "natives.h" | 
|    40 #include "objects-visiting.h" |    40 #include "objects-visiting.h" | 
|    41 #include "scanner.h" |    41 #include "scanner-base.h" | 
|    42 #include "scopeinfo.h" |    42 #include "scopeinfo.h" | 
|    43 #include "snapshot.h" |    43 #include "snapshot.h" | 
|    44 #include "v8threads.h" |    44 #include "v8threads.h" | 
|    45 #if V8_TARGET_ARCH_ARM && !V8_INTERPRETED_REGEXP |    45 #if V8_TARGET_ARCH_ARM && !V8_INTERPRETED_REGEXP | 
|    46 #include "regexp-macro-assembler.h" |    46 #include "regexp-macro-assembler.h" | 
|    47 #include "arm/regexp-macro-assembler-arm.h" |    47 #include "arm/regexp-macro-assembler-arm.h" | 
|    48 #endif |    48 #endif | 
|    49  |    49  | 
|    50  |    50  | 
|    51 namespace v8 { |    51 namespace v8 { | 
| (...skipping 3190 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  3242   return result; |  3242   return result; | 
|  3243 } |  3243 } | 
|  3244  |  3244  | 
|  3245  |  3245  | 
|  3246 MaybeObject* Heap::AllocateStringFromUtf8(Vector<const char> string, |  3246 MaybeObject* Heap::AllocateStringFromUtf8(Vector<const char> string, | 
|  3247                                           PretenureFlag pretenure) { |  3247                                           PretenureFlag pretenure) { | 
|  3248   // V8 only supports characters in the Basic Multilingual Plane. |  3248   // V8 only supports characters in the Basic Multilingual Plane. | 
|  3249   const uc32 kMaxSupportedChar = 0xFFFF; |  3249   const uc32 kMaxSupportedChar = 0xFFFF; | 
|  3250   // Count the number of characters in the UTF-8 string and check if |  3250   // Count the number of characters in the UTF-8 string and check if | 
|  3251   // it is an ASCII string. |  3251   // it is an ASCII string. | 
|  3252   Access<Scanner::Utf8Decoder> decoder(Scanner::utf8_decoder()); |  3252   Access<ScannerConstants::Utf8Decoder> | 
 |  3253       decoder(ScannerConstants::utf8_decoder()); | 
|  3253   decoder->Reset(string.start(), string.length()); |  3254   decoder->Reset(string.start(), string.length()); | 
|  3254   int chars = 0; |  3255   int chars = 0; | 
|  3255   bool is_ascii = true; |  3256   bool is_ascii = true; | 
|  3256   while (decoder->has_more()) { |  3257   while (decoder->has_more()) { | 
|  3257     uc32 r = decoder->GetNext(); |  3258     uc32 r = decoder->GetNext(); | 
|  3258     if (r > String::kMaxAsciiCharCode) is_ascii = false; |  3259     if (r > String::kMaxAsciiCharCode) is_ascii = false; | 
|  3259     chars++; |  3260     chars++; | 
|  3260   } |  3261   } | 
|  3261  |  3262  | 
|  3262   // If the string is ascii, we do not need to convert the characters |  3263   // If the string is ascii, we do not need to convert the characters | 
| (...skipping 2110 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  5373 void ExternalStringTable::TearDown() { |  5374 void ExternalStringTable::TearDown() { | 
|  5374   new_space_strings_.Free(); |  5375   new_space_strings_.Free(); | 
|  5375   old_space_strings_.Free(); |  5376   old_space_strings_.Free(); | 
|  5376 } |  5377 } | 
|  5377  |  5378  | 
|  5378  |  5379  | 
|  5379 List<Object*> ExternalStringTable::new_space_strings_; |  5380 List<Object*> ExternalStringTable::new_space_strings_; | 
|  5380 List<Object*> ExternalStringTable::old_space_strings_; |  5381 List<Object*> ExternalStringTable::old_space_strings_; | 
|  5381  |  5382  | 
|  5382 } }  // namespace v8::internal |  5383 } }  // namespace v8::internal | 
| OLD | NEW |