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

Side by Side Diff: src/crankshaft/hydrogen-types.cc

Issue 2060213002: Revert of Replace 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 unified diff | Download patch
« no previous file with comments | « src/crankshaft/hydrogen-instructions.cc ('k') | src/debug/debug.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/crankshaft/hydrogen-types.h" 5 #include "src/crankshaft/hydrogen-types.h"
6 6
7 #include "src/field-type.h" 7 #include "src/field-type.h"
8 #include "src/handles-inl.h" 8 #include "src/handles-inl.h"
9 #include "src/ostreams.h" 9 #include "src/ostreams.h"
10 10
(...skipping 20 matching lines...) Expand all
31 HType HType::FromFieldType(Handle<FieldType> type, Zone* temp_zone) { 31 HType HType::FromFieldType(Handle<FieldType> type, Zone* temp_zone) {
32 return FromType(type->Convert(temp_zone)); 32 return FromType(type->Convert(temp_zone));
33 } 33 }
34 34
35 // static 35 // static
36 HType HType::FromValue(Handle<Object> value) { 36 HType HType::FromValue(Handle<Object> value) {
37 Object* raw_value = *value; 37 Object* raw_value = *value;
38 if (raw_value->IsSmi()) return HType::Smi(); 38 if (raw_value->IsSmi()) return HType::Smi();
39 DCHECK(raw_value->IsHeapObject()); 39 DCHECK(raw_value->IsHeapObject());
40 Isolate* isolate = HeapObject::cast(*value)->GetIsolate(); 40 Isolate* isolate = HeapObject::cast(*value)->GetIsolate();
41 if (raw_value->IsNull(isolate)) return HType::Null(); 41 if (raw_value->IsNull()) return HType::Null();
42 if (raw_value->IsHeapNumber()) { 42 if (raw_value->IsHeapNumber()) {
43 double n = Handle<v8::internal::HeapNumber>::cast(value)->value(); 43 double n = Handle<v8::internal::HeapNumber>::cast(value)->value();
44 return IsSmiDouble(n) ? HType::Smi() : HType::HeapNumber(); 44 return IsSmiDouble(n) ? HType::Smi() : HType::HeapNumber();
45 } 45 }
46 if (raw_value->IsString()) return HType::String(); 46 if (raw_value->IsString()) return HType::String();
47 if (raw_value->IsBoolean()) return HType::Boolean(); 47 if (raw_value->IsBoolean()) return HType::Boolean();
48 if (raw_value->IsUndefined(isolate)) return HType::Undefined(); 48 if (raw_value->IsUndefined(isolate)) return HType::Undefined();
49 if (raw_value->IsJSArray()) { 49 if (raw_value->IsJSArray()) {
50 DCHECK(!raw_value->IsUndetectable()); 50 DCHECK(!raw_value->IsUndetectable());
51 return HType::JSArray(); 51 return HType::JSArray();
(...skipping 14 matching lines...) Expand all
66 return os << #Name; 66 return os << #Name;
67 HTYPE_LIST(DEFINE_CASE) 67 HTYPE_LIST(DEFINE_CASE)
68 #undef DEFINE_CASE 68 #undef DEFINE_CASE
69 } 69 }
70 UNREACHABLE(); 70 UNREACHABLE();
71 return os; 71 return os;
72 } 72 }
73 73
74 } // namespace internal 74 } // namespace internal
75 } // namespace v8 75 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen-instructions.cc ('k') | src/debug/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698