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

Side by Side Diff: src/runtime.cc

Issue 8195006: Fix string whitespace trimming of byte order marks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | test/test262/test262.status » ('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 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
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
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
OLDNEW
« no previous file with comments | « no previous file | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698