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

Side by Side Diff: src/code-stubs.cc

Issue 1160443009: Add SIMD.Float32x4 functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tests working. Created 5 years, 5 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/code-stubs.h ('k') | src/code-stubs-hydrogen.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/code-stubs.h" 5 #include "src/code-stubs.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/cpu-profiler.h" 10 #include "src/cpu-profiler.h"
(...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 SimpleListPrinter p(os); 940 SimpleListPrinter p(os);
941 if (s.IsEmpty()) p.Add("None"); 941 if (s.IsEmpty()) p.Add("None");
942 if (s.Contains(ToBooleanStub::UNDEFINED)) p.Add("Undefined"); 942 if (s.Contains(ToBooleanStub::UNDEFINED)) p.Add("Undefined");
943 if (s.Contains(ToBooleanStub::BOOLEAN)) p.Add("Bool"); 943 if (s.Contains(ToBooleanStub::BOOLEAN)) p.Add("Bool");
944 if (s.Contains(ToBooleanStub::NULL_TYPE)) p.Add("Null"); 944 if (s.Contains(ToBooleanStub::NULL_TYPE)) p.Add("Null");
945 if (s.Contains(ToBooleanStub::SMI)) p.Add("Smi"); 945 if (s.Contains(ToBooleanStub::SMI)) p.Add("Smi");
946 if (s.Contains(ToBooleanStub::SPEC_OBJECT)) p.Add("SpecObject"); 946 if (s.Contains(ToBooleanStub::SPEC_OBJECT)) p.Add("SpecObject");
947 if (s.Contains(ToBooleanStub::STRING)) p.Add("String"); 947 if (s.Contains(ToBooleanStub::STRING)) p.Add("String");
948 if (s.Contains(ToBooleanStub::SYMBOL)) p.Add("Symbol"); 948 if (s.Contains(ToBooleanStub::SYMBOL)) p.Add("Symbol");
949 if (s.Contains(ToBooleanStub::HEAP_NUMBER)) p.Add("HeapNumber"); 949 if (s.Contains(ToBooleanStub::HEAP_NUMBER)) p.Add("HeapNumber");
950 if (s.Contains(ToBooleanStub::SIMD_TYPE)) p.Add("SimdType");
950 return os << ")"; 951 return os << ")";
951 } 952 }
952 953
953 954
954 bool ToBooleanStub::Types::UpdateStatus(Handle<Object> object) { 955 bool ToBooleanStub::Types::UpdateStatus(Handle<Object> object) {
955 if (object->IsUndefined()) { 956 if (object->IsUndefined()) {
956 Add(UNDEFINED); 957 Add(UNDEFINED);
957 return false; 958 return false;
958 } else if (object->IsBoolean()) { 959 } else if (object->IsBoolean()) {
959 Add(BOOLEAN); 960 Add(BOOLEAN);
(...skipping 12 matching lines...) Expand all
972 return !object->IsUndetectableObject() && 973 return !object->IsUndetectableObject() &&
973 String::cast(*object)->length() != 0; 974 String::cast(*object)->length() != 0;
974 } else if (object->IsSymbol()) { 975 } else if (object->IsSymbol()) {
975 Add(SYMBOL); 976 Add(SYMBOL);
976 return true; 977 return true;
977 } else if (object->IsHeapNumber()) { 978 } else if (object->IsHeapNumber()) {
978 DCHECK(!object->IsUndetectableObject()); 979 DCHECK(!object->IsUndetectableObject());
979 Add(HEAP_NUMBER); 980 Add(HEAP_NUMBER);
980 double value = HeapNumber::cast(*object)->value(); 981 double value = HeapNumber::cast(*object)->value();
981 return value != 0 && !std::isnan(value); 982 return value != 0 && !std::isnan(value);
983 } else if (object->IsFloat32x4()) {
984 Add(SIMD_TYPE);
985 return true;
982 } else { 986 } else {
983 // We should never see an internal object at runtime here! 987 // We should never see an internal object at runtime here!
984 UNREACHABLE(); 988 UNREACHABLE();
985 return true; 989 return true;
986 } 990 }
987 } 991 }
988 992
989 993
990 bool ToBooleanStub::Types::NeedsMap() const { 994 bool ToBooleanStub::Types::NeedsMap() const {
991 return Contains(ToBooleanStub::SPEC_OBJECT) 995 return Contains(ToBooleanStub::SPEC_OBJECT) ||
992 || Contains(ToBooleanStub::STRING) 996 Contains(ToBooleanStub::STRING) || Contains(ToBooleanStub::SYMBOL) ||
993 || Contains(ToBooleanStub::SYMBOL) 997 Contains(ToBooleanStub::HEAP_NUMBER) ||
994 || Contains(ToBooleanStub::HEAP_NUMBER); 998 Contains(ToBooleanStub::SIMD_TYPE);
995 } 999 }
996 1000
997 1001
998 bool ToBooleanStub::Types::CanBeUndetectable() const { 1002 bool ToBooleanStub::Types::CanBeUndetectable() const {
999 return Contains(ToBooleanStub::SPEC_OBJECT) 1003 return Contains(ToBooleanStub::SPEC_OBJECT)
1000 || Contains(ToBooleanStub::STRING); 1004 || Contains(ToBooleanStub::STRING);
1001 } 1005 }
1002 1006
1003 1007
1004 void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) { 1008 void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 1062
1059 if (type->Is(Type::UntaggedPointer())) { 1063 if (type->Is(Type::UntaggedPointer())) {
1060 return Representation::External(); 1064 return Representation::External();
1061 } 1065 }
1062 1066
1063 DCHECK(!type->Is(Type::Untagged())); 1067 DCHECK(!type->Is(Type::Untagged()));
1064 return Representation::Tagged(); 1068 return Representation::Tagged();
1065 } 1069 }
1066 } // namespace internal 1070 } // namespace internal
1067 } // namespace v8 1071 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs.h ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698