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

Unified Diff: src/code-stubs.cc

Issue 2695653005: Revert of Remove SIMD.js from V8. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « src/code-stubs.h ('k') | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index 7e5f07b6fc3566dfae7829c02f4333f9260831f4..aeb4ad307e9d1c355f41c528c76020ba4aaaf704 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -488,6 +488,21 @@
assembler.Return(result);
}
+#define SIMD128_GEN_ASM(TYPE, Type, type, lane_count, lane_type) \
+ void Allocate##Type##Stub::GenerateAssembly( \
+ compiler::CodeAssemblerState* state) const { \
+ CodeStubAssembler assembler(state); \
+ compiler::Node* result = \
+ assembler.Allocate(Simd128Value::kSize, CodeStubAssembler::kNone); \
+ compiler::Node* map = assembler.LoadMap(result); \
+ assembler.StoreNoWriteBarrier( \
+ MachineRepresentation::kTagged, map, \
+ assembler.HeapConstant(isolate()->factory()->type##_map())); \
+ assembler.Return(result); \
+ }
+SIMD128_TYPES(SIMD128_GEN_ASM)
+#undef SIMD128_GEN_ASM
+
void StringLengthStub::GenerateAssembly(
compiler::CodeAssemblerState* state) const {
CodeStubAssembler assembler(state);
@@ -1944,6 +1959,15 @@
Runtime::FunctionForId(Runtime::kAllocateHeapNumber)->entry);
}
+
+#define SIMD128_INIT_DESC(TYPE, Type, type, lane_count, lane_type) \
+ void Allocate##Type##Stub::InitializeDescriptor( \
+ CodeStubDescriptor* descriptor) { \
+ descriptor->Initialize( \
+ Runtime::FunctionForId(Runtime::kCreate##Type)->entry); \
+ }
+SIMD128_TYPES(SIMD128_INIT_DESC)
+#undef SIMD128_INIT_DESC
void ToBooleanICStub::InitializeDescriptor(CodeStubDescriptor* descriptor) {
descriptor->Initialize(FUNCTION_ADDR(Runtime_ToBooleanIC_Miss));
@@ -2130,6 +2154,9 @@
new_hints |= ToBooleanHint::kHeapNumber;
double value = HeapNumber::cast(*object)->value();
to_boolean_value = value != 0 && !std::isnan(value);
+ } else if (object->IsSimd128Value()) {
+ new_hints |= ToBooleanHint::kSimdValue;
+ to_boolean_value = true;
} else {
// We should never see an internal object at runtime here!
UNREACHABLE();
« no previous file with comments | « src/code-stubs.h ('k') | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698