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

Unified Diff: src/ast/ast.cc

Issue 2059173002: Reland of place all remaining Oddball checks with new function (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/api-natives.cc ('k') | src/ast/prettyprinter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.cc
diff --git a/src/ast/ast.cc b/src/ast/ast.cc
index a943fdf05cafd437e75ce5ab1524365569d4227a..27e325fb1e8c134c17392cbfc642e63ccef2b781 100644
--- a/src/ast/ast.cc
+++ b/src/ast/ast.cc
@@ -59,12 +59,19 @@
bool Expression::IsNullLiteral() const {
- return IsLiteral() && AsLiteral()->value()->IsNull();
+ if (!IsLiteral()) return false;
+ Handle<Object> value = AsLiteral()->value();
+ return !value->IsSmi() &&
+ value->IsNull(HeapObject::cast(*value)->GetIsolate());
}
bool Expression::IsUndefinedLiteral() const {
- if (IsLiteral() && AsLiteral()->value()->IsUndefined()) {
- return true;
+ if (IsLiteral()) {
+ Handle<Object> value = AsLiteral()->value();
+ if (!value->IsSmi() &&
+ value->IsUndefined(HeapObject::cast(*value)->GetIsolate())) {
+ return true;
+ }
}
const VariableProxy* var_proxy = AsVariableProxy();
@@ -387,7 +394,7 @@
if (property->is_computed_name()) continue;
if (property->kind() == ObjectLiteral::Property::PROTOTYPE) continue;
Literal* literal = property->key()->AsLiteral();
- DCHECK(!literal->value()->IsNull());
+ DCHECK(!literal->IsNullLiteral());
// If there is an existing entry do not emit a store unless the previous
// entry was also an accessor.
@@ -457,11 +464,11 @@
// (value->IsNumber()).
// TODO(verwaest): Remove once we can store them inline.
if (FLAG_track_double_fields &&
- (value->IsNumber() || value->IsUninitialized())) {
+ (value->IsNumber() || value->IsUninitialized(isolate))) {
may_store_doubles_ = true;
}
- is_simple = is_simple && !value->IsUninitialized();
+ is_simple = is_simple && !value->IsUninitialized(isolate);
// Keep track of the number of elements in the object literal and
// the largest element index. If the largest element index is
@@ -529,7 +536,7 @@
continue;
}
- if (boilerplate_value->IsUninitialized()) {
+ if (boilerplate_value->IsUninitialized(isolate)) {
boilerplate_value = handle(Smi::FromInt(0), isolate);
is_simple = false;
}
« no previous file with comments | « src/api-natives.cc ('k') | src/ast/prettyprinter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698