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

Unified Diff: src/json-stringifier.h

Issue 15691017: Make assertion scopes thread safe. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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
« src/api.cc ('K') | « src/json-parser.h ('k') | src/jsregexp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/json-stringifier.h
diff --git a/src/json-stringifier.h b/src/json-stringifier.h
index f548a2e7f9e446199a3162539b3ed6c99a738466..8bcb11eba3231180fc711cc02656dfa13b790c43 100644
--- a/src/json-stringifier.h
+++ b/src/json-stringifier.h
@@ -300,7 +300,7 @@ MaybeObject* BasicJsonStringifier::StringifyString(Isolate* isolate,
if (object->IsOneByteRepresentationUnderneath()) {
Handle<String> result =
isolate->factory()->NewRawOneByteString(worst_case_length);
- AssertNoAllocation no_alloc;
+ DisallowHeapAllocation no_gc;
return StringifyString_<SeqOneByteString>(
isolate,
object->GetFlatContent().ToOneByteVector(),
@@ -308,7 +308,7 @@ MaybeObject* BasicJsonStringifier::StringifyString(Isolate* isolate,
} else {
Handle<String> result =
isolate->factory()->NewRawTwoByteString(worst_case_length);
- AssertNoAllocation no_alloc;
+ DisallowHeapAllocation no_gc;
return StringifyString_<SeqTwoByteString>(
isolate,
object->GetFlatContent().ToUC16Vector(),
@@ -321,7 +321,7 @@ template <typename ResultType, typename Char>
MaybeObject* BasicJsonStringifier::StringifyString_(Isolate* isolate,
Vector<Char> vector,
Handle<String> result) {
- AssertNoAllocation no_allocation;
+ DisallowHeapAllocation no_gc;
int final_size = 0;
ResultType* dest = ResultType::cast(*result);
dest->Set(final_size++, '\"');
@@ -759,7 +759,7 @@ void BasicJsonStringifier::SerializeString_(Handle<String> string) {
// is a more pessimistic estimate, but faster to calculate.
if (((part_length_ - current_index_) >> 3) > length) {
- AssertNoAllocation no_allocation;
+ DisallowHeapAllocation no_gc;
Vector<const Char> vector = GetCharVector<Char>(string);
if (is_ascii) {
current_index_ += SerializeStringUnchecked_(
@@ -778,7 +778,7 @@ void BasicJsonStringifier::SerializeString_(Handle<String> string) {
for (int i = 0; i < length; i++) {
// If GC moved the string, we need to refresh the vector.
if (*string != string_location) {
- AssertNoAllocation no_gc;
+ DisallowHeapAllocation no_gc;
// This does not actually prevent the string from being relocated later.
vector = GetCharVector<Char>(string);
string_location = *string;
« src/api.cc ('K') | « src/json-parser.h ('k') | src/jsregexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698