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

Unified 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: samevalue.js tweak. 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 side-by-side diff with in-line comments
Download patch
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index bcc1fe88014d9bcd52a61df4bef62c1131e497a7..4ae02c5c697055609add9fafc54e953e25652503 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -950,6 +950,7 @@ std::ostream& operator<<(std::ostream& os, const ToBooleanStub::Types& s) {
if (s.Contains(ToBooleanStub::STRING)) p.Add("String");
if (s.Contains(ToBooleanStub::SYMBOL)) p.Add("Symbol");
if (s.Contains(ToBooleanStub::HEAP_NUMBER)) p.Add("HeapNumber");
+ if (s.Contains(ToBooleanStub::SIMD_VALUE)) p.Add("SimdValue");
return os << ")";
}
@@ -982,6 +983,9 @@ bool ToBooleanStub::Types::UpdateStatus(Handle<Object> object) {
Add(HEAP_NUMBER);
double value = HeapNumber::cast(*object)->value();
return value != 0 && !std::isnan(value);
+ } else if (object->IsFloat32x4()) {
+ Add(SIMD_VALUE);
+ return true;
} else {
// We should never see an internal object at runtime here!
UNREACHABLE();
@@ -991,10 +995,10 @@ bool ToBooleanStub::Types::UpdateStatus(Handle<Object> object) {
bool ToBooleanStub::Types::NeedsMap() const {
- return Contains(ToBooleanStub::SPEC_OBJECT)
- || Contains(ToBooleanStub::STRING)
- || Contains(ToBooleanStub::SYMBOL)
- || Contains(ToBooleanStub::HEAP_NUMBER);
+ return Contains(ToBooleanStub::SPEC_OBJECT) ||
+ Contains(ToBooleanStub::STRING) || Contains(ToBooleanStub::SYMBOL) ||
+ Contains(ToBooleanStub::HEAP_NUMBER) ||
+ Contains(ToBooleanStub::SIMD_VALUE);
}
« no previous file with comments | « src/code-stubs.h ('k') | src/code-stubs-hydrogen.cc » ('j') | test/mjsunit/object-toprimitive.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698