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

Unified Diff: src/compiler/context-relaxation.cc

Issue 1220823004: [turbofan]: Add a context relaxation Reducer (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/compiler/context-relaxation.cc
diff --git a/src/compiler/context-relaxation.cc b/src/compiler/context-relaxation.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3e25dae88bf35d4e63368860a53627a0b16a9555
--- /dev/null
+++ b/src/compiler/context-relaxation.cc
@@ -0,0 +1,45 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "src/compiler/context-relaxation.h"
+#include "src/compiler/js-operator.h"
+#include "src/compiler/node.h"
+#include "src/compiler/node-properties.h"
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+Reduction ContextRelaxation::Reduce(Node* node) {
Michael Starzinger 2015/07/02 10:29:26 I think it would make sense to rename this class t
+ switch (node->opcode()) {
+ case IrOpcode::kJSCallRuntime:
+ switch (OpParameter<CallRuntimeParameters>(node->op()).id()) {
+ case Runtime::kInlineMathClz32:
+ case Runtime::kInlineMathFloor:
+ case Runtime::kInlineMathSqrt:
+ break;
+ default:
+ return NoChange();
+ }
+ // Fall through...
+ case IrOpcode::kJSCallFunction:
+ case IrOpcode::kJSToNumber:
+ if (!context_is_wired_) {
danno 2015/07/01 09:11:48 This is a bit weird, any better ideas?
Michael Starzinger 2015/07/02 10:29:26 As discussed offline: We could move the parameter
+ if (relaxed_context_->InputAt(0) == nullptr) {
Michael Starzinger 2015/07/02 10:29:26 Can we please use relaxed_context_->IsDead() inste
+ relaxed_context_->ReplaceInput(0, start_);
+ }
+ context_is_wired_ = true;
+ }
+ NodeProperties::ReplaceContextInput(node, relaxed_context_);
+ return Changed(node);
+ break;
+ default:
+ break;
+ }
+ return NoChange();
+}
+
+} // namespace compiler
+} // namespace internal
+} // namespace v8

Powered by Google App Engine
This is Rietveld 408576698