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

Unified Diff: src/crankshaft/hydrogen-types.cc

Issue 2028983002: Introduce IsUndefined(Isolate*) and IsTheHole(Isolate*) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase master 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/crankshaft/hydrogen-instructions.cc ('k') | src/d8-posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen-types.cc
diff --git a/src/crankshaft/hydrogen-types.cc b/src/crankshaft/hydrogen-types.cc
index 4266e28da09901da64b082535f5d03f71b44122b..773685b04c162daf927764815a2985c70a07b5f6 100644
--- a/src/crankshaft/hydrogen-types.cc
+++ b/src/crankshaft/hydrogen-types.cc
@@ -34,23 +34,25 @@ HType HType::FromFieldType(Handle<FieldType> type, Zone* temp_zone) {
// static
HType HType::FromValue(Handle<Object> value) {
- if (value->IsSmi()) return HType::Smi();
- if (value->IsNull()) return HType::Null();
- if (value->IsHeapNumber()) {
+ Object* raw_value = *value;
+ if (raw_value->IsSmi()) return HType::Smi();
+ DCHECK(raw_value->IsHeapObject());
+ Isolate* isolate = HeapObject::cast(*value)->GetIsolate();
+ if (raw_value->IsNull()) return HType::Null();
+ if (raw_value->IsHeapNumber()) {
double n = Handle<v8::internal::HeapNumber>::cast(value)->value();
return IsSmiDouble(n) ? HType::Smi() : HType::HeapNumber();
}
- if (value->IsString()) return HType::String();
- if (value->IsBoolean()) return HType::Boolean();
- if (value->IsUndefined()) return HType::Undefined();
- if (value->IsJSArray()) {
- DCHECK(!value->IsUndetectable());
+ if (raw_value->IsString()) return HType::String();
+ if (raw_value->IsBoolean()) return HType::Boolean();
+ if (raw_value->IsUndefined(isolate)) return HType::Undefined();
+ if (raw_value->IsJSArray()) {
+ DCHECK(!raw_value->IsUndetectable());
return HType::JSArray();
}
- if (value->IsJSObject() && !value->IsUndetectable()) {
+ if (raw_value->IsJSObject() && !raw_value->IsUndetectable()) {
return HType::JSObject();
}
- DCHECK(value->IsHeapObject());
return HType::HeapObject();
}
« no previous file with comments | « src/crankshaft/hydrogen-instructions.cc ('k') | src/d8-posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698