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

Unified Diff: src/objects-inl.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
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index d0958eef29a0faa736980f8b8bd23887da101375..5df3f3f5ca6021816b51eb0a643fc853ed236d3e 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -892,7 +892,7 @@ MaybeObject* Object::GetElement(uint32_t index) {
// GetElement can trigger a getter which can cause allocation.
// This was not always the case. This ASSERT is here to catch
// leftover incorrect uses.
- ASSERT(HEAP->IsAllocationAllowed());
+ ASSERT(AllowHeapAllocation::IsAllowed());
return GetElementWithReceiver(this, index);
}
@@ -1550,7 +1550,7 @@ MaybeObject* JSObject::TryMigrateInstance() {
Handle<String> JSObject::ExpectedTransitionKey(Handle<Map> map) {
- AssertNoAllocation no_gc;
+ DisallowHeapAllocation no_gc;
if (!map->HasTransitionArray()) return Handle<String>::null();
TransitionArray* transitions = map->transitions();
if (!transitions->IsSimpleTransition()) return Handle<String>::null();
@@ -1572,7 +1572,7 @@ Handle<Map> JSObject::ExpectedTransitionTarget(Handle<Map> map) {
Handle<Map> JSObject::FindTransitionToField(Handle<Map> map, Handle<Name> key) {
- AssertNoAllocation no_allocation;
+ DisallowHeapAllocation no_allocation;
if (!map->HasTransitionArray()) return Handle<Map>::null();
TransitionArray* transitions = map->transitions();
int transition = transitions->Search(*key);
@@ -1984,7 +1984,8 @@ bool FixedDoubleArray::is_the_hole(int index) {
}
-WriteBarrierMode HeapObject::GetWriteBarrierMode(const AssertNoAllocation&) {
+WriteBarrierMode HeapObject::GetWriteBarrierMode(
+ const DisallowHeapAllocation& promise) {
Heap* heap = GetHeap();
if (heap->incremental_marking()->IsMarking()) return UPDATE_WRITE_BARRIER;
if (heap->InNewSpace(this)) return SKIP_WRITE_BARRIER;
@@ -5826,7 +5827,7 @@ void Dictionary<Shape, Key>::SetEntry(int entry,
details.IsDeleted() ||
details.dictionary_index() > 0);
int index = HashTable<Shape, Key>::EntryToIndex(entry);
- AssertNoAllocation no_gc;
+ DisallowHeapAllocation no_gc;
WriteBarrierMode mode = FixedArray::GetWriteBarrierMode(no_gc);
FixedArray::set(index, key, mode);
FixedArray::set(index+1, value, mode);
« src/api.cc ('K') | « src/objects.cc ('k') | src/optimizing-compiler-thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698