summaryrefslogtreecommitdiffstats
path: root/runtime/entrypoints
diff options
context:
space:
mode:
authorJeff Hao <jeffhao@google.com>2014-01-15 13:49:50 -0800
committerJeff Hao <jeffhao@google.com>2015-04-27 18:54:52 -0700
commit848f70a3d73833fc1bf3032a9ff6812e429661d9 (patch)
treeb0349b3a40aab5a915af491b100659a5ca9fbbf6 /runtime/entrypoints
parentd14438f0c5071962be7fab572b54687d32d9d087 (diff)
downloadart-848f70a3d73833fc1bf3032a9ff6812e429661d9.tar.gz
art-848f70a3d73833fc1bf3032a9ff6812e429661d9.tar.bz2
art-848f70a3d73833fc1bf3032a9ff6812e429661d9.zip
Replace String CharArray with internal uint16_t array.
Summary of high level changes: - Adds compiler inliner support to identify string init methods - Adds compiler support (quick & optimizing) with new invoke code path that calls method off the thread pointer - Adds thread entrypoints for all string init methods - Adds map to verifier to log when receiver of string init has been copied to other registers. used by compiler and interpreter Change-Id: I797b992a8feb566f9ad73060011ab6f51eb7ce01
Diffstat (limited to 'runtime/entrypoints')
-rw-r--r--runtime/entrypoints/quick/quick_alloc_entrypoints.cc38
-rw-r--r--runtime/entrypoints/quick/quick_entrypoints_list.h23
2 files changed, 59 insertions, 2 deletions
diff --git a/runtime/entrypoints/quick/quick_alloc_entrypoints.cc b/runtime/entrypoints/quick/quick_alloc_entrypoints.cc
index c049e3d355..fa129afd39 100644
--- a/runtime/entrypoints/quick/quick_alloc_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_alloc_entrypoints.cc
@@ -153,6 +153,32 @@ extern "C" mirror::Array* artCheckAndAllocArrayFromCodeWithAccessCheck##suffix##
} else { \
return CheckAndAllocArrayFromCodeInstrumented(type_idx, component_count, method, self, true, allocator_type); \
} \
+} \
+extern "C" mirror::String* artAllocStringFromBytesFromCode##suffix##suffix2( \
+ mirror::ByteArray* byte_array, int32_t high, int32_t offset, int32_t byte_count, \
+ Thread* self) \
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { \
+ ScopedQuickEntrypointChecks sqec(self); \
+ StackHandleScope<1> hs(self); \
+ Handle<mirror::ByteArray> handle_array(hs.NewHandle(byte_array)); \
+ return mirror::String::AllocFromByteArray<instrumented_bool>(self, byte_count, handle_array, \
+ offset, high, allocator_type); \
+} \
+extern "C" mirror::String* artAllocStringFromCharsFromCode##suffix##suffix2( \
+ int32_t offset, int32_t char_count, mirror::CharArray* char_array, Thread* self) \
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { \
+ StackHandleScope<1> hs(self); \
+ Handle<mirror::CharArray> handle_array(hs.NewHandle(char_array)); \
+ return mirror::String::AllocFromCharArray<instrumented_bool>(self, char_count, handle_array, \
+ offset, allocator_type); \
+} \
+extern "C" mirror::String* artAllocStringFromStringFromCode##suffix##suffix2( \
+ mirror::String* string, Thread* self) \
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { \
+ StackHandleScope<1> hs(self); \
+ Handle<mirror::String> handle_string(hs.NewHandle(string)); \
+ return mirror::String::AllocFromString<instrumented_bool>(self, handle_string->GetLength(), \
+ handle_string, 0, allocator_type); \
}
#define GENERATE_ENTRYPOINTS_FOR_ALLOCATOR(suffix, allocator_type) \
@@ -176,6 +202,9 @@ extern "C" void* art_quick_alloc_object_initialized##suffix(mirror::Class* klass
extern "C" void* art_quick_alloc_object_with_access_check##suffix(uint32_t type_idx, mirror::ArtMethod* ref); \
extern "C" void* art_quick_check_and_alloc_array##suffix(uint32_t, int32_t, mirror::ArtMethod* ref); \
extern "C" void* art_quick_check_and_alloc_array_with_access_check##suffix(uint32_t, int32_t, mirror::ArtMethod* ref); \
+extern "C" void* art_quick_alloc_string_from_bytes##suffix(void*, int32_t, int32_t, int32_t); \
+extern "C" void* art_quick_alloc_string_from_chars##suffix(int32_t, int32_t, void*); \
+extern "C" void* art_quick_alloc_string_from_string##suffix(void*); \
extern "C" void* art_quick_alloc_array##suffix##_instrumented(uint32_t, int32_t, mirror::ArtMethod* ref); \
extern "C" void* art_quick_alloc_array_resolved##suffix##_instrumented(mirror::Class* klass, int32_t, mirror::ArtMethod* ref); \
extern "C" void* art_quick_alloc_array_with_access_check##suffix##_instrumented(uint32_t, int32_t, mirror::ArtMethod* ref); \
@@ -185,6 +214,9 @@ extern "C" void* art_quick_alloc_object_initialized##suffix##_instrumented(mirro
extern "C" void* art_quick_alloc_object_with_access_check##suffix##_instrumented(uint32_t type_idx, mirror::ArtMethod* ref); \
extern "C" void* art_quick_check_and_alloc_array##suffix##_instrumented(uint32_t, int32_t, mirror::ArtMethod* ref); \
extern "C" void* art_quick_check_and_alloc_array_with_access_check##suffix##_instrumented(uint32_t, int32_t, mirror::ArtMethod* ref); \
+extern "C" void* art_quick_alloc_string_from_bytes##suffix##_instrumented(void*, int32_t, int32_t, int32_t); \
+extern "C" void* art_quick_alloc_string_from_chars##suffix##_instrumented(int32_t, int32_t, void*); \
+extern "C" void* art_quick_alloc_string_from_string##suffix##_instrumented(void*); \
void SetQuickAllocEntryPoints##suffix(QuickEntryPoints* qpoints, bool instrumented) { \
if (instrumented) { \
qpoints->pAllocArray = art_quick_alloc_array##suffix##_instrumented; \
@@ -196,6 +228,9 @@ void SetQuickAllocEntryPoints##suffix(QuickEntryPoints* qpoints, bool instrument
qpoints->pAllocObjectWithAccessCheck = art_quick_alloc_object_with_access_check##suffix##_instrumented; \
qpoints->pCheckAndAllocArray = art_quick_check_and_alloc_array##suffix##_instrumented; \
qpoints->pCheckAndAllocArrayWithAccessCheck = art_quick_check_and_alloc_array_with_access_check##suffix##_instrumented; \
+ qpoints->pAllocStringFromBytes = art_quick_alloc_string_from_bytes##suffix##_instrumented; \
+ qpoints->pAllocStringFromChars = art_quick_alloc_string_from_chars##suffix##_instrumented; \
+ qpoints->pAllocStringFromString = art_quick_alloc_string_from_string##suffix##_instrumented; \
} else { \
qpoints->pAllocArray = art_quick_alloc_array##suffix; \
qpoints->pAllocArrayResolved = art_quick_alloc_array_resolved##suffix; \
@@ -206,6 +241,9 @@ void SetQuickAllocEntryPoints##suffix(QuickEntryPoints* qpoints, bool instrument
qpoints->pAllocObjectWithAccessCheck = art_quick_alloc_object_with_access_check##suffix; \
qpoints->pCheckAndAllocArray = art_quick_check_and_alloc_array##suffix; \
qpoints->pCheckAndAllocArrayWithAccessCheck = art_quick_check_and_alloc_array_with_access_check##suffix; \
+ qpoints->pAllocStringFromBytes = art_quick_alloc_string_from_bytes##suffix; \
+ qpoints->pAllocStringFromChars = art_quick_alloc_string_from_chars##suffix; \
+ qpoints->pAllocStringFromString = art_quick_alloc_string_from_string##suffix; \
} \
}
diff --git a/runtime/entrypoints/quick/quick_entrypoints_list.h b/runtime/entrypoints/quick/quick_entrypoints_list.h
index 6d9e483a9c..035f57a08a 100644
--- a/runtime/entrypoints/quick/quick_entrypoints_list.h
+++ b/runtime/entrypoints/quick/quick_entrypoints_list.h
@@ -29,6 +29,9 @@
V(AllocObjectWithAccessCheck, void*, uint32_t, mirror::ArtMethod*) \
V(CheckAndAllocArray, void*, uint32_t, int32_t, mirror::ArtMethod*) \
V(CheckAndAllocArrayWithAccessCheck, void*, uint32_t, int32_t, mirror::ArtMethod*) \
+ V(AllocStringFromBytes, void*, void*, int32_t, int32_t, int32_t) \
+ V(AllocStringFromChars, void*, int32_t, int32_t, void*) \
+ V(AllocStringFromString, void*, void*) \
\
V(InstanceofNonTrivial, uint32_t, const mirror::Class*, const mirror::Class*) \
V(CheckCast, void, const mirror::Class*, const mirror::Class*) \
@@ -123,8 +126,24 @@
V(Deoptimize, void, void) \
\
V(A64Load, int64_t, volatile const int64_t *) \
- V(A64Store, void, volatile int64_t *, int64_t)
-
+ V(A64Store, void, volatile int64_t *, int64_t) \
+\
+ V(NewEmptyString, void) \
+ V(NewStringFromBytes_B, void) \
+ V(NewStringFromBytes_BI, void) \
+ V(NewStringFromBytes_BII, void) \
+ V(NewStringFromBytes_BIII, void) \
+ V(NewStringFromBytes_BIIString, void) \
+ V(NewStringFromBytes_BString, void) \
+ V(NewStringFromBytes_BIICharset, void) \
+ V(NewStringFromBytes_BCharset, void) \
+ V(NewStringFromChars_C, void) \
+ V(NewStringFromChars_CII, void) \
+ V(NewStringFromChars_IIC, void) \
+ V(NewStringFromCodePoints, void) \
+ V(NewStringFromString, void) \
+ V(NewStringFromStringBuffer, void) \
+ V(NewStringFromStringBuilder, void)
#endif // ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_ENTRYPOINTS_LIST_H_
#undef ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_ENTRYPOINTS_LIST_H_ // #define is only for lint.