diff --git a/src/factory.cc b/src/factory.cc index d3a69744d2..d4909a7c1b 100644 --- a/src/factory.cc +++ b/src/factory.cc @@ -287,6 +287,14 @@ MaybeHandle Factory::NewRawTwoByteString( } +Handle Factory::LookupSingleCharacterStringFromCode(uint32_t index) { + CALL_HEAP_FUNCTION( + isolate(), + isolate()->heap()->LookupSingleCharacterStringFromCode(index), + String); +} + + // Returns true for a character in a range. Both limits are inclusive. static inline bool Between(uint32_t character, uint32_t from, uint32_t to) { // This makes uses of the the unsigned wraparound. @@ -469,7 +477,7 @@ Handle Factory::NewProperSubString(Handle str, int length = end - begin; if (length <= 0) return empty_string(); if (length == 1) { - return LookupSingleCharacterStringFromCode(isolate(), str->Get(begin)); + return LookupSingleCharacterStringFromCode(str->Get(begin)); } if (length == 2) { // Optimization for 2-byte strings often used as keys in a decompression diff --git a/src/factory.h b/src/factory.h index c1b7ba7251..53f55d3aac 100644 --- a/src/factory.h +++ b/src/factory.h @@ -142,6 +142,8 @@ class Factory V8_FINAL { int length, PretenureFlag pretenure = NOT_TENURED); + Handle LookupSingleCharacterStringFromCode(uint32_t index); + // Create a new cons string object which consists of a pair of strings. MUST_USE_RESULT MaybeHandle NewConsString(Handle left, Handle right); diff --git a/src/handles.cc b/src/handles.cc index b3052ad6a8..7ed7c8e80f 100644 --- a/src/handles.cc +++ b/src/handles.cc @@ -179,15 +179,6 @@ Handle GetProperty(Handle obj, } -Handle LookupSingleCharacterStringFromCode(Isolate* isolate, - uint32_t index) { - CALL_HEAP_FUNCTION( - isolate, - isolate->heap()->LookupSingleCharacterStringFromCode(index), - String); -} - - // Wrappers for scripts are kept alive and cached in weak global // handles referred from foreign objects held by the scripts as long as // they are used. When they are not used anymore, the garbage diff --git a/src/handles.h b/src/handles.h index 3f60404212..edeb27b510 100644 --- a/src/handles.h +++ b/src/handles.h @@ -302,9 +302,6 @@ Handle HasProperty(Handle obj, Handle key); Handle GetProperty(Handle obj, const char* name); -Handle LookupSingleCharacterStringFromCode(Isolate* isolate, - uint32_t index); - // Get the JS object corresponding to the given script; create it // if none exists. Handle GetScriptWrapper(Handle