V8 Project
v8::internal::BreakIterator Class Reference

#include <i18n.h>

+ Collaboration diagram for v8::internal::BreakIterator:

Static Public Member Functions

static icu::BreakIterator * InitializeBreakIterator (Isolate *isolate, Handle< String > locale, Handle< JSObject > options, Handle< JSObject > resolved)
 
static icu::BreakIterator * UnpackBreakIterator (Isolate *isolate, Handle< JSObject > obj)
 
static void DeleteBreakIterator (const v8::WeakCallbackData< v8::Value, void > &data)
 

Private Member Functions

 BreakIterator ()
 

Detailed Description

Definition at line 105 of file i18n.h.

Constructor & Destructor Documentation

◆ BreakIterator()

v8::internal::BreakIterator::BreakIterator ( )
private

Member Function Documentation

◆ DeleteBreakIterator()

void v8::internal::BreakIterator::DeleteBreakIterator ( const v8::WeakCallbackData< v8::Value, void > &  data)
static

Definition at line 925 of file i18n.cc.

926  {
927  DeleteNativeObjectAt<icu::BreakIterator>(data, 0);
928  DeleteNativeObjectAt<icu::UnicodeString>(data, 1);
929  DestroyGlobalHandle(data);
930 }
static void DestroyGlobalHandle(const v8::WeakCallbackData< v8::Value, void > &data)
Definition: i18n.cc:740

References v8::internal::DestroyGlobalHandle().

+ Here is the call graph for this function:

◆ InitializeBreakIterator()

icu::BreakIterator * v8::internal::BreakIterator::InitializeBreakIterator ( Isolate isolate,
Handle< String locale,
Handle< JSObject options,
Handle< JSObject resolved 
)
static

Definition at line 871 of file i18n.cc.

875  {
876  // Convert BCP47 into ICU locale format.
877  UErrorCode status = U_ZERO_ERROR;
878  icu::Locale icu_locale;
879  char icu_result[ULOC_FULLNAME_CAPACITY];
880  int icu_length = 0;
881  v8::String::Utf8Value bcp47_locale(v8::Utils::ToLocal(locale));
882  if (bcp47_locale.length() != 0) {
883  uloc_forLanguageTag(*bcp47_locale, icu_result, ULOC_FULLNAME_CAPACITY,
884  &icu_length, &status);
885  if (U_FAILURE(status) || icu_length == 0) {
886  return NULL;
887  }
888  icu_locale = icu::Locale(icu_result);
889  }
890 
891  icu::BreakIterator* break_iterator = CreateICUBreakIterator(
892  isolate, icu_locale, options);
893  if (!break_iterator) {
894  // Remove extensions and try again.
895  icu::Locale no_extension_locale(icu_locale.getBaseName());
896  break_iterator = CreateICUBreakIterator(
897  isolate, no_extension_locale, options);
898 
899  // Set resolved settings (locale).
901  isolate, no_extension_locale, break_iterator, resolved);
902  } else {
904  isolate, icu_locale, break_iterator, resolved);
905  }
906 
907  return break_iterator;
908 }
Converts an object to a UTF-8-encoded character array.
Definition: v8.h:2048
static Local< Context > ToLocal(v8::internal::Handle< v8::internal::Context > obj)
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
void SetResolvedBreakIteratorSettings(Isolate *isolate, const icu::Locale &icu_locale, icu::BreakIterator *break_iterator, Handle< JSObject > resolved)
Definition: i18n.cc:638
icu::BreakIterator * CreateICUBreakIterator(Isolate *isolate, const icu::Locale &icu_locale, Handle< JSObject > options)
Definition: i18n.cc:605

References v8::internal::anonymous_namespace{i18n.cc}::CreateICUBreakIterator(), v8::String::Utf8Value::length(), NULL, v8::internal::anonymous_namespace{i18n.cc}::SetResolvedBreakIteratorSettings(), and v8::Utils::ToLocal().

+ Here is the call graph for this function:

◆ UnpackBreakIterator()

icu::BreakIterator * v8::internal::BreakIterator::UnpackBreakIterator ( Isolate isolate,
Handle< JSObject obj 
)
static

Definition at line 911 of file i18n.cc.

912  {
913  Handle<String> key =
914  isolate->factory()->NewStringFromStaticChars("breakIterator");
915  Maybe<bool> maybe = JSReceiver::HasOwnProperty(obj, key);
916  CHECK(maybe.has_value);
917  if (maybe.value) {
918  return reinterpret_cast<icu::BreakIterator*>(obj->GetInternalField(0));
919  }
920 
921  return NULL;
922 }
static MUST_USE_RESULT Maybe< bool > HasOwnProperty(Handle< JSReceiver >, Handle< Name > name)
Definition: objects-inl.h:6658
#define CHECK(condition)
Definition: logging.h:36
Maybe< T > maybe(T t)
Definition: v8.h:902

References CHECK, v8::internal::Isolate::factory(), v8::internal::JSReceiver::HasOwnProperty(), v8::maybe(), and NULL.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: