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

Unified Diff: src/heap.cc

Issue 11818025: Continues Latin-1 support. All tests pass with ENABLE_LATIN_1 flag. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: ARM fix Created 7 years, 11 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/handles.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | src/isolate.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 9ee52bb91d17a0fc65463bf7208d1ae1fb160c52..8cf078e5ad101c92fc0d112ea2a86f3deb3f6093 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -3316,9 +3316,9 @@ MUST_USE_RESULT static inline MaybeObject* MakeOrFindTwoCharacterString(
{ MaybeObject* maybe_result = heap->AllocateRawOneByteString(2);
if (!maybe_result->ToObject(&result)) return maybe_result;
}
- char* dest = SeqOneByteString::cast(result)->GetChars();
- dest[0] = static_cast<char>(c1);
- dest[1] = static_cast<char>(c2);
+ uint8_t* dest = SeqOneByteString::cast(result)->GetChars();
+ dest[0] = static_cast<uint8_t>(c1);
+ dest[1] = static_cast<uint8_t>(c2);
return result;
} else {
Object* result;
@@ -3389,9 +3389,9 @@ MaybeObject* Heap::AllocateConsString(String* first, String* second) {
if (!maybe_result->ToObject(&result)) return maybe_result;
}
// Copy the characters into the new object.
- char* dest = SeqOneByteString::cast(result)->GetChars();
+ uint8_t* dest = SeqOneByteString::cast(result)->GetChars();
// Copy first part.
- const char* src;
+ const uint8_t* src;
if (first->IsExternalString()) {
src = ExternalAsciiString::cast(first)->GetChars();
} else {
@@ -3413,7 +3413,7 @@ MaybeObject* Heap::AllocateConsString(String* first, String* second) {
if (!maybe_result->ToObject(&result)) return maybe_result;
}
// Copy the characters into the new object.
- char* dest = SeqOneByteString::cast(result)->GetChars();
+ uint8_t* dest = SeqOneByteString::cast(result)->GetChars();
String::WriteToFlat(first, dest, 0, first_length);
String::WriteToFlat(second, dest + first_length, 0, second_length);
isolate_->counters()->string_add_runtime_ext_to_ascii()->Increment();
@@ -3490,7 +3490,7 @@ MaybeObject* Heap::AllocateSubString(String* buffer,
// Copy the characters into the new object.
if (is_one_byte) {
ASSERT(string_result->IsOneByteRepresentation());
- char* dest = SeqOneByteString::cast(string_result)->GetChars();
+ uint8_t* dest = SeqOneByteString::cast(string_result)->GetChars();
String::WriteToFlat(buffer, dest, start, end);
} else {
ASSERT(string_result->IsTwoByteRepresentation());
@@ -4532,7 +4532,7 @@ MaybeObject* Heap::AllocateStringFromOneByte(Vector<const uint8_t> string,
}
// Copy the characters into the new object.
- CopyChars(SeqOneByteString::cast(result)->GetCharsU(),
+ CopyChars(SeqOneByteString::cast(result)->GetChars(),
string.start(),
length);
return result;
@@ -4631,7 +4631,7 @@ template<>
class AllocateInternalSymbolHelper< Vector<const char> > {
public:
static inline void WriteOneByteData(Vector<const char> vector,
- char* chars,
+ uint8_t* chars,
int len) {
// Only works for ascii.
ASSERT(vector.length() == len);
@@ -4673,7 +4673,7 @@ class AllocateInternalSymbolHelper< Vector<const char> > {
template<>
class AllocateInternalSymbolHelper<String*> {
public:
- static inline void WriteOneByteData(String* s, char* chars, int len) {
+ static inline void WriteOneByteData(String* s, uint8_t* chars, int len) {
ASSERT(s->length() == len);
String::WriteToFlat(s, chars, 0, len);
}
@@ -4783,14 +4783,16 @@ MaybeObject* Heap::AllocateRawOneByteString(int length,
String::cast(result)->set_hash_field(String::kEmptyHashField);
ASSERT_EQ(size, HeapObject::cast(result)->Size());
+#ifndef ENABLE_LATIN_1
#ifdef VERIFY_HEAP
if (FLAG_verify_heap) {
// Initialize string's content to ensure ASCII-ness (character range 0-127)
// as required when verifying the heap.
- char* dest = SeqOneByteString::cast(result)->GetChars();
+ uint8_t* dest = SeqOneByteString::cast(result)->GetChars();
memset(dest, 0x0F, length * kCharSize);
}
#endif
+#endif
return result;
}
« no previous file with comments | « src/handles.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | src/isolate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698