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

Side by Side Diff: src/compiler/js-context-relaxation.cc

Issue 1715633002: [turbofan] Remove the JSContextRelaxation reducer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « src/compiler/js-context-relaxation.h ('k') | src/compiler/js-inlining.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "src/compiler/frame-states.h"
6 #include "src/compiler/js-context-relaxation.h"
7 #include "src/compiler/js-operator.h"
8 #include "src/compiler/node.h"
9 #include "src/compiler/node-properties.h"
10
11 namespace v8 {
12 namespace internal {
13 namespace compiler {
14
15 Reduction JSContextRelaxation::Reduce(Node* node) {
16 switch (node->opcode()) {
17 case IrOpcode::kJSCallFunction:
18 case IrOpcode::kJSToNumber: {
19 Node* frame_state = NodeProperties::GetFrameStateInput(node, 0);
20 Node* outer_frame = frame_state;
21 Node* original_context = NodeProperties::GetContextInput(node);
22 Node* candidate_new_context = original_context;
23 do {
24 FrameStateInfo frame_state_info(
25 OpParameter<FrameStateInfo>(outer_frame->op()));
26 const FrameStateFunctionInfo* function_info =
27 frame_state_info.function_info();
28 if (function_info == nullptr ||
29 (function_info->context_calling_mode() ==
30 CALL_CHANGES_NATIVE_CONTEXT)) {
31 break;
32 }
33 candidate_new_context = outer_frame->InputAt(kFrameStateContextInput);
34 outer_frame = outer_frame->InputAt(kFrameStateOuterStateInput);
35 } while (outer_frame->opcode() == IrOpcode::kFrameState);
36
37 while (true) {
38 switch (candidate_new_context->opcode()) {
39 case IrOpcode::kParameter:
40 case IrOpcode::kJSCreateModuleContext:
41 case IrOpcode::kJSCreateScriptContext:
42 if (candidate_new_context != original_context) {
43 NodeProperties::ReplaceContextInput(node, candidate_new_context);
44 return Changed(node);
45 } else {
46 return NoChange();
47 }
48 case IrOpcode::kJSCreateCatchContext:
49 case IrOpcode::kJSCreateWithContext:
50 case IrOpcode::kJSCreateBlockContext:
51 candidate_new_context =
52 NodeProperties::GetContextInput(candidate_new_context);
53 break;
54 default:
55 return NoChange();
56 }
57 }
58 }
59 default:
60 break;
61 }
62 return NoChange();
63 }
64
65 } // namespace compiler
66 } // namespace internal
67 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-context-relaxation.h ('k') | src/compiler/js-inlining.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698