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

Unified Diff: src/compiler/instruction-selector.cc

Issue 2203693002: [turbofan] Introduce initial support for TypedArrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5254
Patch Set: Fix Retain Created 4 years, 4 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/compiler/instruction-selector.h ('k') | src/compiler/js-builtin-reducer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/instruction-selector.cc
diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc
index 16676b7e21eb7736efd5a17b7737bc6f4b304f1b..30d2caaac36fcd21370c6ea54eeda1fc2f5509c2 100644
--- a/src/compiler/instruction-selector.cc
+++ b/src/compiler/instruction-selector.cc
@@ -299,6 +299,9 @@ void InstructionSelector::MarkAsDefined(Node* node) {
bool InstructionSelector::IsUsed(Node* node) const {
DCHECK_NOT_NULL(node);
+ // TODO(bmeurer): This is a terrible monster hack, but we have to make sure
+ // that the Retain is actually emitted, otherwise the GC will mess up.
+ if (node->opcode() == IrOpcode::kRetain) return true;
if (!node->op()->HasProperty(Operator::kEliminatable)) return true;
size_t const id = node->id();
DCHECK_LT(id, used_.size());
@@ -929,6 +932,9 @@ void InstructionSelector::VisitNode(Node* node) {
case IrOpcode::kComment:
VisitComment(node);
return;
+ case IrOpcode::kRetain:
+ VisitRetain(node);
+ return;
case IrOpcode::kLoad: {
LoadRepresentation type = LoadRepresentationOf(node->op());
MarkAsRepresentation(type.representation(), node);
@@ -1297,6 +1303,9 @@ void InstructionSelector::VisitNode(Node* node) {
}
case IrOpcode::kAtomicStore:
return VisitAtomicStore(node);
+ case IrOpcode::kUnsafePointerAdd:
+ MarkAsRepresentation(MachineType::PointerRepresentation(), node);
+ return VisitUnsafePointerAdd(node);
default:
V8_Fatal(__FILE__, __LINE__, "Unexpected operator #%d:%s @ node #%d",
node->opcode(), node->op()->mnemonic(), node->id());
@@ -2016,6 +2025,19 @@ void InstructionSelector::VisitComment(Node* node) {
Emit(kArchComment, 0, nullptr, 1, &operand);
}
+void InstructionSelector::VisitUnsafePointerAdd(Node* node) {
+#if V8_TARGET_ARCH_64_BIT
+ VisitInt64Add(node);
+#else // V8_TARGET_ARCH_64_BIT
+ VisitInt32Add(node);
+#endif // V8_TARGET_ARCH_64_BIT
+}
+
+void InstructionSelector::VisitRetain(Node* node) {
+ OperandGenerator g(this);
+ Emit(kArchNop, g.NoOutput(), g.UseAny(node->InputAt(0)));
+}
+
bool InstructionSelector::CanProduceSignalingNaN(Node* node) {
// TODO(jarin) Improve the heuristic here.
if (node->opcode() == IrOpcode::kFloat64Add ||
« no previous file with comments | « src/compiler/instruction-selector.h ('k') | src/compiler/js-builtin-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698