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

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

Issue 934293002: [turbofan] Simply context specialization and fix for OSR. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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-specialization.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
1 // Copyright 2014 the V8 project authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/js-context-specialization.h" 5 #include "src/compiler/js-context-specialization.h"
6 6
7 #include "src/compiler/common-operator.h" 7 #include "src/compiler/common-operator.h"
8 #include "src/compiler/js-operator.h" 8 #include "src/compiler/js-operator.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/node-properties.h" 10 #include "src/compiler/node-properties.h"
11 11
12 namespace v8 { 12 namespace v8 {
13 namespace internal { 13 namespace internal {
14 namespace compiler { 14 namespace compiler {
15 15
16 Reduction JSContextSpecializer::Reduce(Node* node) { 16 Reduction JSContextSpecializer::Reduce(Node* node) {
17 if (node == context_) {
18 Node* constant = jsgraph_->Constant(ctx_);
19 NodeProperties::ReplaceWithValue(node, constant);
20 return Replace(constant);
21 }
22 if (node->opcode() == IrOpcode::kJSLoadContext) { 17 if (node->opcode() == IrOpcode::kJSLoadContext) {
23 return ReduceJSLoadContext(node); 18 return ReduceJSLoadContext(node);
24 } 19 }
25 if (node->opcode() == IrOpcode::kJSStoreContext) { 20 if (node->opcode() == IrOpcode::kJSStoreContext) {
26 return ReduceJSStoreContext(node); 21 return ReduceJSStoreContext(node);
27 } 22 }
28 return NoChange(); 23 return NoChange();
29 } 24 }
30 25
31 26
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 Handle<Object> new_context_handle = 102 Handle<Object> new_context_handle =
108 Handle<Object>(context, jsgraph_->isolate()); 103 Handle<Object>(context, jsgraph_->isolate());
109 node->ReplaceInput(0, jsgraph_->Constant(new_context_handle)); 104 node->ReplaceInput(0, jsgraph_->Constant(new_context_handle));
110 105
111 return Changed(node); 106 return Changed(node);
112 } 107 }
113 108
114 } // namespace compiler 109 } // namespace compiler
115 } // namespace internal 110 } // namespace internal
116 } // namespace v8 111 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-context-specialization.h ('k') | src/compiler/js-inlining.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698