| 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 6096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6107 } | 6107 } |
| 6108 | 6108 |
| 6109 | 6109 |
| 6110 RUNTIME_FUNCTION(MaybeObject*, Runtime_StringToUpperCase) { | 6110 RUNTIME_FUNCTION(MaybeObject*, Runtime_StringToUpperCase) { |
| 6111 return ConvertCase<ToUpperTraits>( | 6111 return ConvertCase<ToUpperTraits>( |
| 6112 args, isolate, isolate->runtime_state()->to_upper_mapping()); | 6112 args, isolate, isolate->runtime_state()->to_upper_mapping()); |
| 6113 } | 6113 } |
| 6114 | 6114 |
| 6115 | 6115 |
| 6116 static inline bool IsTrimWhiteSpace(unibrow::uchar c) { | 6116 static inline bool IsTrimWhiteSpace(unibrow::uchar c) { |
| 6117 return unibrow::WhiteSpace::Is(c) || c == 0x200b; | 6117 return unibrow::WhiteSpace::Is(c) || c == 0x200b || c == 0xfeff; |
| 6118 } | 6118 } |
| 6119 | 6119 |
| 6120 | 6120 |
| 6121 RUNTIME_FUNCTION(MaybeObject*, Runtime_StringTrim) { | 6121 RUNTIME_FUNCTION(MaybeObject*, Runtime_StringTrim) { |
| 6122 NoHandleAllocation ha; | 6122 NoHandleAllocation ha; |
| 6123 ASSERT(args.length() == 3); | 6123 ASSERT(args.length() == 3); |
| 6124 | 6124 |
| 6125 CONVERT_CHECKED(String, s, args[0]); | 6125 CONVERT_CHECKED(String, s, args[0]); |
| 6126 CONVERT_BOOLEAN_CHECKED(trimLeft, args[1]); | 6126 CONVERT_BOOLEAN_CHECKED(trimLeft, args[1]); |
| 6127 CONVERT_BOOLEAN_CHECKED(trimRight, args[2]); | 6127 CONVERT_BOOLEAN_CHECKED(trimRight, args[2]); |
| (...skipping 7115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13243 } else { | 13243 } else { |
| 13244 // Handle last resort GC and make sure to allow future allocations | 13244 // Handle last resort GC and make sure to allow future allocations |
| 13245 // to grow the heap without causing GCs (if possible). | 13245 // to grow the heap without causing GCs (if possible). |
| 13246 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13246 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13247 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); | 13247 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); |
| 13248 } | 13248 } |
| 13249 } | 13249 } |
| 13250 | 13250 |
| 13251 | 13251 |
| 13252 } } // namespace v8::internal | 13252 } } // namespace v8::internal |
| OLD | NEW |