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

Side by Side Diff: src/runtime/runtime-i18n.cc

Issue 2452543003: Don't wrap roots in Handle just to dereference immediately. (Closed)
Patch Set: Created 4 years, 1 month 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/runtime/runtime-debug.cc ('k') | src/snapshot/code-serializer.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 #ifdef V8_I18N_SUPPORT 6 #ifdef V8_I18N_SUPPORT
7 #include "src/runtime/runtime-utils.h" 7 #include "src/runtime/runtime-utils.h"
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 if (!break_iterator) return isolate->ThrowIllegalOperation(); 919 if (!break_iterator) return isolate->ThrowIllegalOperation();
920 920
921 // TODO(cira): Remove cast once ICU fixes base BreakIterator class. 921 // TODO(cira): Remove cast once ICU fixes base BreakIterator class.
922 icu::RuleBasedBreakIterator* rule_based_iterator = 922 icu::RuleBasedBreakIterator* rule_based_iterator =
923 static_cast<icu::RuleBasedBreakIterator*>(break_iterator); 923 static_cast<icu::RuleBasedBreakIterator*>(break_iterator);
924 int32_t status = rule_based_iterator->getRuleStatus(); 924 int32_t status = rule_based_iterator->getRuleStatus();
925 // Keep return values in sync with JavaScript BreakType enum. 925 // Keep return values in sync with JavaScript BreakType enum.
926 if (status >= UBRK_WORD_NONE && status < UBRK_WORD_NONE_LIMIT) { 926 if (status >= UBRK_WORD_NONE && status < UBRK_WORD_NONE_LIMIT) {
927 return *isolate->factory()->NewStringFromStaticChars("none"); 927 return *isolate->factory()->NewStringFromStaticChars("none");
928 } else if (status >= UBRK_WORD_NUMBER && status < UBRK_WORD_NUMBER_LIMIT) { 928 } else if (status >= UBRK_WORD_NUMBER && status < UBRK_WORD_NUMBER_LIMIT) {
929 return *isolate->factory()->number_string(); 929 return isolate->heap()->number_string();
930 } else if (status >= UBRK_WORD_LETTER && status < UBRK_WORD_LETTER_LIMIT) { 930 } else if (status >= UBRK_WORD_LETTER && status < UBRK_WORD_LETTER_LIMIT) {
931 return *isolate->factory()->NewStringFromStaticChars("letter"); 931 return *isolate->factory()->NewStringFromStaticChars("letter");
932 } else if (status >= UBRK_WORD_KANA && status < UBRK_WORD_KANA_LIMIT) { 932 } else if (status >= UBRK_WORD_KANA && status < UBRK_WORD_KANA_LIMIT) {
933 return *isolate->factory()->NewStringFromStaticChars("kana"); 933 return *isolate->factory()->NewStringFromStaticChars("kana");
934 } else if (status >= UBRK_WORD_IDEO && status < UBRK_WORD_IDEO_LIMIT) { 934 } else if (status >= UBRK_WORD_IDEO && status < UBRK_WORD_IDEO_LIMIT) {
935 return *isolate->factory()->NewStringFromStaticChars("ideo"); 935 return *isolate->factory()->NewStringFromStaticChars("ideo");
936 } else { 936 } else {
937 return *isolate->factory()->NewStringFromStaticChars("unknown"); 937 return *isolate->factory()->NewStringFromStaticChars("unknown");
938 } 938 }
939 } 939 }
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
1290 Handle<FixedArray> date_cache_version = 1290 Handle<FixedArray> date_cache_version =
1291 Handle<FixedArray>::cast(isolate->eternal_handles()->GetSingleton( 1291 Handle<FixedArray>::cast(isolate->eternal_handles()->GetSingleton(
1292 EternalHandles::DATE_CACHE_VERSION)); 1292 EternalHandles::DATE_CACHE_VERSION));
1293 return date_cache_version->get(0); 1293 return date_cache_version->get(0);
1294 } 1294 }
1295 1295
1296 } // namespace internal 1296 } // namespace internal
1297 } // namespace v8 1297 } // namespace v8
1298 1298
1299 #endif // V8_I18N_SUPPORT 1299 #endif // V8_I18N_SUPPORT
OLDNEW
« no previous file with comments | « src/runtime/runtime-debug.cc ('k') | src/snapshot/code-serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698