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

Unified Diff: src/factory.cc

Issue 250773004: HashTableKey::AsObject() handlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/factory.h ('k') | src/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index b74a50a6ecc88044101b574e2857d911abdb4dec..748b5197e4c34cb79bc0412bf1ec11092faf485a 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -280,6 +280,75 @@ MaybeHandle<String> Factory::NewStringFromTwoByte(Vector<const uc16> string,
}
+Handle<String> Factory::NewInternalizedStringFromUtf8(Vector<const char> str,
+ int chars,
+ uint32_t hash_field) {
+ CALL_HEAP_FUNCTION(
+ isolate(),
+ isolate()->heap()->AllocateInternalizedStringFromUtf8(
+ str, chars, hash_field),
+ String);
+}
+
+
+MUST_USE_RESULT Handle<String> Factory::NewOneByteInternalizedString(
+ Vector<const uint8_t> str,
+ uint32_t hash_field) {
+ CALL_HEAP_FUNCTION(
+ isolate(),
+ isolate()->heap()->AllocateOneByteInternalizedString(str, hash_field),
+ String);
+}
+
+
+MUST_USE_RESULT Handle<String> Factory::NewTwoByteInternalizedString(
+ Vector<const uc16> str,
+ uint32_t hash_field) {
+ CALL_HEAP_FUNCTION(
+ isolate(),
+ isolate()->heap()->AllocateTwoByteInternalizedString(str, hash_field),
+ String);
+}
+
+
+template<typename T>
+Handle<String> Factory::NewInternalizedStringImpl(
+ T t, int chars, uint32_t hash_field) {
+ CALL_HEAP_FUNCTION(
+ isolate(),
+ isolate()->heap()->AllocateInternalizedStringImpl(t, chars, hash_field),
+ String);
+}
+
+template
+Handle<String> Factory::NewInternalizedStringImpl(String*, int, uint32_t);
+
+
+MaybeHandle<Map> Factory::InternalizedStringMapForString(
+ Handle<String> string) {
+ // If the string is in new space it cannot be used as internalized.
+ if (isolate()->heap()->InNewSpace(*string)) return MaybeHandle<Map>();
+
+ // Find the corresponding internalized string map for strings.
+ switch (string->map()->instance_type()) {
+ case STRING_TYPE: return internalized_string_map();
+ case ASCII_STRING_TYPE: return ascii_internalized_string_map();
+ case EXTERNAL_STRING_TYPE: return external_internalized_string_map();
+ case EXTERNAL_ASCII_STRING_TYPE:
+ return external_ascii_internalized_string_map();
+ case EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE:
+ return external_internalized_string_with_one_byte_data_map();
+ case SHORT_EXTERNAL_STRING_TYPE:
+ return short_external_internalized_string_map();
+ case SHORT_EXTERNAL_ASCII_STRING_TYPE:
+ return short_external_ascii_internalized_string_map();
+ case SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE:
+ return short_external_internalized_string_with_one_byte_data_map();
+ default: return MaybeHandle<Map>(); // No match found.
+ }
+}
+
+
MaybeHandle<SeqOneByteString> Factory::NewRawOneByteString(
int length, PretenureFlag pretenure) {
CALL_HEAP_FUNCTION(
« no previous file with comments | « src/factory.h ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698