| Index: src/compiler/js-context-relaxation.cc
|
| diff --git a/src/compiler/js-context-relaxation.cc b/src/compiler/js-context-relaxation.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4f19de88a187ce1ec372677e2cc46b3f5f2b8284
|
| --- /dev/null
|
| +++ b/src/compiler/js-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/js-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 JSContextRelaxation::Reduce(Node* node) {
|
| + 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_) {
|
| + if (relaxed_context_->IsDead()) {
|
| + 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
|
|
|