| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 6116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6127 } | 6127 } |
| 6128 | 6128 |
| 6129 | 6129 |
| 6130 RUNTIME_FUNCTION(MaybeObject*, Runtime_StringToUpperCase) { | 6130 RUNTIME_FUNCTION(MaybeObject*, Runtime_StringToUpperCase) { |
| 6131 return ConvertCase<ToUpperTraits>( | 6131 return ConvertCase<ToUpperTraits>( |
| 6132 args, isolate, isolate->runtime_state()->to_upper_mapping()); | 6132 args, isolate, isolate->runtime_state()->to_upper_mapping()); |
| 6133 } | 6133 } |
| 6134 | 6134 |
| 6135 | 6135 |
| 6136 static inline bool IsTrimWhiteSpace(unibrow::uchar c) { | 6136 static inline bool IsTrimWhiteSpace(unibrow::uchar c) { |
| 6137 return unibrow::WhiteSpace::Is(c) || c == 0x200b || c == 0xfeff; | 6137 return (unibrow::WhiteSpace::Is(c) && c != 0x0085) || c == 0xfeff; |
| 6138 } | 6138 } |
| 6139 | 6139 |
| 6140 | 6140 |
| 6141 RUNTIME_FUNCTION(MaybeObject*, Runtime_StringTrim) { | 6141 RUNTIME_FUNCTION(MaybeObject*, Runtime_StringTrim) { |
| 6142 NoHandleAllocation ha; | 6142 NoHandleAllocation ha; |
| 6143 ASSERT(args.length() == 3); | 6143 ASSERT(args.length() == 3); |
| 6144 | 6144 |
| 6145 CONVERT_ARG_CHECKED(String, s, 0); | 6145 CONVERT_ARG_CHECKED(String, s, 0); |
| 6146 CONVERT_BOOLEAN_ARG_CHECKED(trimLeft, 1); | 6146 CONVERT_BOOLEAN_ARG_CHECKED(trimLeft, 1); |
| 6147 CONVERT_BOOLEAN_ARG_CHECKED(trimRight, 2); | 6147 CONVERT_BOOLEAN_ARG_CHECKED(trimRight, 2); |
| (...skipping 7169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13317 // Handle last resort GC and make sure to allow future allocations | 13317 // Handle last resort GC and make sure to allow future allocations |
| 13318 // to grow the heap without causing GCs (if possible). | 13318 // to grow the heap without causing GCs (if possible). |
| 13319 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13319 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13320 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13320 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 13321 "Runtime::PerformGC"); | 13321 "Runtime::PerformGC"); |
| 13322 } | 13322 } |
| 13323 } | 13323 } |
| 13324 | 13324 |
| 13325 | 13325 |
| 13326 } } // namespace v8::internal | 13326 } } // namespace v8::internal |
| OLD | NEW |