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

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

Issue 1219943002: Expose SIMD.Float32x4 type to Javascript. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
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 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 SimpleListPrinter p(os); 941 SimpleListPrinter p(os);
942 if (s.IsEmpty()) p.Add("None"); 942 if (s.IsEmpty()) p.Add("None");
943 if (s.Contains(ToBooleanStub::UNDEFINED)) p.Add("Undefined"); 943 if (s.Contains(ToBooleanStub::UNDEFINED)) p.Add("Undefined");
944 if (s.Contains(ToBooleanStub::BOOLEAN)) p.Add("Bool"); 944 if (s.Contains(ToBooleanStub::BOOLEAN)) p.Add("Bool");
945 if (s.Contains(ToBooleanStub::NULL_TYPE)) p.Add("Null"); 945 if (s.Contains(ToBooleanStub::NULL_TYPE)) p.Add("Null");
946 if (s.Contains(ToBooleanStub::SMI)) p.Add("Smi"); 946 if (s.Contains(ToBooleanStub::SMI)) p.Add("Smi");
947 if (s.Contains(ToBooleanStub::SPEC_OBJECT)) p.Add("SpecObject"); 947 if (s.Contains(ToBooleanStub::SPEC_OBJECT)) p.Add("SpecObject");
948 if (s.Contains(ToBooleanStub::STRING)) p.Add("String"); 948 if (s.Contains(ToBooleanStub::STRING)) p.Add("String");
949 if (s.Contains(ToBooleanStub::SYMBOL)) p.Add("Symbol"); 949 if (s.Contains(ToBooleanStub::SYMBOL)) p.Add("Symbol");
950 if (s.Contains(ToBooleanStub::HEAP_NUMBER)) p.Add("HeapNumber"); 950 if (s.Contains(ToBooleanStub::HEAP_NUMBER)) p.Add("HeapNumber");
951 if (s.Contains(ToBooleanStub::SIMD_TYPE)) p.Add("SimdType");
rossberg 2015/07/02 13:35:43 Nit: "Simd"
bbudge 2015/07/06 23:59:04 SimdValue?
951 return os << ")"; 952 return os << ")";
952 } 953 }
953 954
954 955
955 bool ToBooleanStub::Types::UpdateStatus(Handle<Object> object) { 956 bool ToBooleanStub::Types::UpdateStatus(Handle<Object> object) {
956 if (object->IsUndefined()) { 957 if (object->IsUndefined()) {
957 Add(UNDEFINED); 958 Add(UNDEFINED);
958 return false; 959 return false;
959 } else if (object->IsBoolean()) { 960 } else if (object->IsBoolean()) {
960 Add(BOOLEAN); 961 Add(BOOLEAN);
(...skipping 12 matching lines...) Expand all
973 return !object->IsUndetectableObject() && 974 return !object->IsUndetectableObject() &&
974 String::cast(*object)->length() != 0; 975 String::cast(*object)->length() != 0;
975 } else if (object->IsSymbol()) { 976 } else if (object->IsSymbol()) {
976 Add(SYMBOL); 977 Add(SYMBOL);
977 return true; 978 return true;
978 } else if (object->IsHeapNumber()) { 979 } else if (object->IsHeapNumber()) {
979 DCHECK(!object->IsUndetectableObject()); 980 DCHECK(!object->IsUndetectableObject());
980 Add(HEAP_NUMBER); 981 Add(HEAP_NUMBER);
981 double value = HeapNumber::cast(*object)->value(); 982 double value = HeapNumber::cast(*object)->value();
982 return value != 0 && !std::isnan(value); 983 return value != 0 && !std::isnan(value);
984 } else if (object->IsFloat32x4()) {
985 Add(SIMD_TYPE);
986 return true;
983 } else { 987 } else {
984 // We should never see an internal object at runtime here! 988 // We should never see an internal object at runtime here!
985 UNREACHABLE(); 989 UNREACHABLE();
986 return true; 990 return true;
987 } 991 }
988 } 992 }
989 993
990 994
991 bool ToBooleanStub::Types::NeedsMap() const { 995 bool ToBooleanStub::Types::NeedsMap() const {
992 return Contains(ToBooleanStub::SPEC_OBJECT) 996 return Contains(ToBooleanStub::SPEC_OBJECT) ||
993 || Contains(ToBooleanStub::STRING) 997 Contains(ToBooleanStub::STRING) || Contains(ToBooleanStub::SYMBOL) ||
994 || Contains(ToBooleanStub::SYMBOL) 998 Contains(ToBooleanStub::HEAP_NUMBER) ||
995 || Contains(ToBooleanStub::HEAP_NUMBER); 999 Contains(ToBooleanStub::SIMD_TYPE);
996 } 1000 }
997 1001
998 1002
999 bool ToBooleanStub::Types::CanBeUndetectable() const { 1003 bool ToBooleanStub::Types::CanBeUndetectable() const {
1000 return Contains(ToBooleanStub::SPEC_OBJECT) 1004 return Contains(ToBooleanStub::SPEC_OBJECT)
1001 || Contains(ToBooleanStub::STRING); 1005 || Contains(ToBooleanStub::STRING);
1002 } 1006 }
1003 1007
1004 1008
1005 void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) { 1009 void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 1063
1060 if (type->Is(Type::UntaggedPointer())) { 1064 if (type->Is(Type::UntaggedPointer())) {
1061 return Representation::External(); 1065 return Representation::External();
1062 } 1066 }
1063 1067
1064 DCHECK(!type->Is(Type::Untagged())); 1068 DCHECK(!type->Is(Type::Untagged()));
1065 return Representation::Tagged(); 1069 return Representation::Tagged();
1066 } 1070 }
1067 } // namespace internal 1071 } // namespace internal
1068 } // namespace v8 1072 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698