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

Unified Diff: src/elements.cc

Issue 2043183003: Replace all remaining Oddball checks with new function (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: keep em coming Created 4 years, 6 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/debug/debug-frames.cc ('k') | src/execution.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/elements.cc
diff --git a/src/elements.cc b/src/elements.cc
index ed88b01b8bf7baf764dd1d20aa6af0bfc10dceb0..d7e49cdcb9350b6f17c28882fc6c0aa6f57d12b4 100644
--- a/src/elements.cc
+++ b/src/elements.cc
@@ -450,11 +450,13 @@ static void SortIndices(
WriteBarrierMode write_barrier_mode = UPDATE_WRITE_BARRIER) {
struct {
bool operator()(Object* a, Object* b) {
- if (!a->IsUndefined()) {
- if (b->IsUndefined()) return true;
+ if (a->IsSmi() || !a->IsUndefined(HeapObject::cast(a)->GetIsolate())) {
+ if (!b->IsSmi() && b->IsUndefined(HeapObject::cast(b)->GetIsolate())) {
+ return true;
+ }
return a->Number() < b->Number();
}
- return b->IsUndefined();
+ return !b->IsSmi() && b->IsUndefined(HeapObject::cast(b)->GetIsolate());
}
} cmp;
Object** start =
@@ -1174,7 +1176,7 @@ class DictionaryElementsAccessor
uint32_t index = GetIndexForEntryImpl(*dict, entry);
Handle<Object> result = SeededNumberDictionary::DeleteProperty(dict, entry);
USE(result);
- DCHECK(result->IsTrue());
+ DCHECK(result->IsTrue(dict->GetIsolate()));
Handle<FixedArray> new_elements =
SeededNumberDictionary::Shrink(dict, index);
obj->set_elements(*new_elements);
@@ -2445,7 +2447,7 @@ class SlowSloppyArgumentsElementsAccessor
uint32_t index = GetIndexForEntryImpl(*dict, entry);
Handle<Object> result = SeededNumberDictionary::DeleteProperty(dict, entry);
USE(result);
- DCHECK(result->IsTrue());
+ DCHECK(result->IsTrue(dict->GetIsolate()));
Handle<FixedArray> new_elements =
SeededNumberDictionary::Shrink(dict, index);
parameter_map->set(1, *new_elements);
« no previous file with comments | « src/debug/debug-frames.cc ('k') | src/execution.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698