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

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: Back out changes to include/v8.h 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 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 SimpleListPrinter p(os); 961 SimpleListPrinter p(os);
962 if (s.IsEmpty()) p.Add("None"); 962 if (s.IsEmpty()) p.Add("None");
963 if (s.Contains(ToBooleanStub::UNDEFINED)) p.Add("Undefined"); 963 if (s.Contains(ToBooleanStub::UNDEFINED)) p.Add("Undefined");
964 if (s.Contains(ToBooleanStub::BOOLEAN)) p.Add("Bool"); 964 if (s.Contains(ToBooleanStub::BOOLEAN)) p.Add("Bool");
965 if (s.Contains(ToBooleanStub::NULL_TYPE)) p.Add("Null"); 965 if (s.Contains(ToBooleanStub::NULL_TYPE)) p.Add("Null");
966 if (s.Contains(ToBooleanStub::SMI)) p.Add("Smi"); 966 if (s.Contains(ToBooleanStub::SMI)) p.Add("Smi");
967 if (s.Contains(ToBooleanStub::SPEC_OBJECT)) p.Add("SpecObject"); 967 if (s.Contains(ToBooleanStub::SPEC_OBJECT)) p.Add("SpecObject");
968 if (s.Contains(ToBooleanStub::STRING)) p.Add("String"); 968 if (s.Contains(ToBooleanStub::STRING)) p.Add("String");
969 if (s.Contains(ToBooleanStub::SYMBOL)) p.Add("Symbol"); 969 if (s.Contains(ToBooleanStub::SYMBOL)) p.Add("Symbol");
970 if (s.Contains(ToBooleanStub::HEAP_NUMBER)) p.Add("HeapNumber"); 970 if (s.Contains(ToBooleanStub::HEAP_NUMBER)) p.Add("HeapNumber");
971 if (s.Contains(ToBooleanStub::SIMD_VALUE)) p.Add("SimdValue");
971 return os << ")"; 972 return os << ")";
972 } 973 }
973 974
974 975
975 bool ToBooleanStub::Types::UpdateStatus(Handle<Object> object) { 976 bool ToBooleanStub::Types::UpdateStatus(Handle<Object> object) {
976 if (object->IsUndefined()) { 977 if (object->IsUndefined()) {
977 Add(UNDEFINED); 978 Add(UNDEFINED);
978 return false; 979 return false;
979 } else if (object->IsBoolean()) { 980 } else if (object->IsBoolean()) {
980 Add(BOOLEAN); 981 Add(BOOLEAN);
(...skipping 12 matching lines...) Expand all
993 return !object->IsUndetectableObject() && 994 return !object->IsUndetectableObject() &&
994 String::cast(*object)->length() != 0; 995 String::cast(*object)->length() != 0;
995 } else if (object->IsSymbol()) { 996 } else if (object->IsSymbol()) {
996 Add(SYMBOL); 997 Add(SYMBOL);
997 return true; 998 return true;
998 } else if (object->IsHeapNumber()) { 999 } else if (object->IsHeapNumber()) {
999 DCHECK(!object->IsUndetectableObject()); 1000 DCHECK(!object->IsUndetectableObject());
1000 Add(HEAP_NUMBER); 1001 Add(HEAP_NUMBER);
1001 double value = HeapNumber::cast(*object)->value(); 1002 double value = HeapNumber::cast(*object)->value();
1002 return value != 0 && !std::isnan(value); 1003 return value != 0 && !std::isnan(value);
1004 } else if (object->IsFloat32x4()) {
1005 Add(SIMD_VALUE);
1006 return true;
1003 } else { 1007 } else {
1004 // We should never see an internal object at runtime here! 1008 // We should never see an internal object at runtime here!
1005 UNREACHABLE(); 1009 UNREACHABLE();
1006 return true; 1010 return true;
1007 } 1011 }
1008 } 1012 }
1009 1013
1010 1014
1011 bool ToBooleanStub::Types::NeedsMap() const { 1015 bool ToBooleanStub::Types::NeedsMap() const {
1012 return Contains(ToBooleanStub::SPEC_OBJECT) 1016 return Contains(ToBooleanStub::SPEC_OBJECT) ||
1013 || Contains(ToBooleanStub::STRING) 1017 Contains(ToBooleanStub::STRING) || Contains(ToBooleanStub::SYMBOL) ||
1014 || Contains(ToBooleanStub::SYMBOL) 1018 Contains(ToBooleanStub::HEAP_NUMBER) ||
1015 || Contains(ToBooleanStub::HEAP_NUMBER); 1019 Contains(ToBooleanStub::SIMD_VALUE);
1016 } 1020 }
1017 1021
1018 1022
1019 bool ToBooleanStub::Types::CanBeUndetectable() const { 1023 bool ToBooleanStub::Types::CanBeUndetectable() const {
1020 return Contains(ToBooleanStub::SPEC_OBJECT) 1024 return Contains(ToBooleanStub::SPEC_OBJECT)
1021 || Contains(ToBooleanStub::STRING); 1025 || Contains(ToBooleanStub::STRING);
1022 } 1026 }
1023 1027
1024 1028
1025 void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) { 1029 void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 1083
1080 if (type->Is(Type::UntaggedPointer())) { 1084 if (type->Is(Type::UntaggedPointer())) {
1081 return Representation::External(); 1085 return Representation::External();
1082 } 1086 }
1083 1087
1084 DCHECK(!type->Is(Type::Untagged())); 1088 DCHECK(!type->Is(Type::Untagged()));
1085 return Representation::Tagged(); 1089 return Representation::Tagged();
1086 } 1090 }
1087 } // namespace internal 1091 } // namespace internal
1088 } // namespace v8 1092 } // 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