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

Side by Side Diff: src/compiler/node-properties.cc

Issue 1697513003: [turbofan] Specialize loads of the native context. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comment. 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-native-context-specialization.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/common-operator.h" 5 #include "src/compiler/common-operator.h"
6 #include "src/compiler/graph.h" 6 #include "src/compiler/graph.h"
7 #include "src/compiler/js-operator.h"
7 #include "src/compiler/linkage.h" 8 #include "src/compiler/linkage.h"
8 #include "src/compiler/node-properties.h" 9 #include "src/compiler/node-properties.h"
9 #include "src/compiler/operator-properties.h" 10 #include "src/compiler/operator-properties.h"
10 #include "src/compiler/verifier.h" 11 #include "src/compiler/verifier.h"
11 #include "src/handles-inl.h" 12 #include "src/handles-inl.h"
12 13
13 namespace v8 { 14 namespace v8 {
14 namespace internal { 15 namespace internal {
15 namespace compiler { 16 namespace compiler {
16 17
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 } 329 }
329 return MaybeHandle<Context>(); 330 return MaybeHandle<Context>();
330 } 331 }
331 332
332 333
333 // static 334 // static
334 MaybeHandle<Context> NodeProperties::GetSpecializationNativeContext( 335 MaybeHandle<Context> NodeProperties::GetSpecializationNativeContext(
335 Node* node, MaybeHandle<Context> native_context) { 336 Node* node, MaybeHandle<Context> native_context) {
336 while (true) { 337 while (true) {
337 switch (node->opcode()) { 338 switch (node->opcode()) {
339 case IrOpcode::kJSLoadContext: {
340 ContextAccess const& access = ContextAccessOf(node->op());
341 if (access.index() != Context::NATIVE_CONTEXT_INDEX) {
342 return MaybeHandle<Context>();
343 }
344 // Skip over the intermediate contexts, we're only interested in the
345 // very last context in the context chain anyway.
346 node = NodeProperties::GetContextInput(node);
347 break;
348 }
338 case IrOpcode::kJSCreateBlockContext: 349 case IrOpcode::kJSCreateBlockContext:
339 case IrOpcode::kJSCreateCatchContext: 350 case IrOpcode::kJSCreateCatchContext:
340 case IrOpcode::kJSCreateFunctionContext: 351 case IrOpcode::kJSCreateFunctionContext:
341 case IrOpcode::kJSCreateModuleContext: 352 case IrOpcode::kJSCreateModuleContext:
342 case IrOpcode::kJSCreateScriptContext: 353 case IrOpcode::kJSCreateScriptContext:
343 case IrOpcode::kJSCreateWithContext: { 354 case IrOpcode::kJSCreateWithContext: {
344 // Skip over the intermediate contexts, we're only interested in the 355 // Skip over the intermediate contexts, we're only interested in the
345 // very last context in the context chain anyway. 356 // very last context in the context chain anyway.
346 node = NodeProperties::GetContextInput(node); 357 node = NodeProperties::GetContextInput(node);
347 break; 358 break;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 // static 419 // static
409 bool NodeProperties::IsInputRange(Edge edge, int first, int num) { 420 bool NodeProperties::IsInputRange(Edge edge, int first, int num) {
410 if (num == 0) return false; 421 if (num == 0) return false;
411 int const index = edge.index(); 422 int const index = edge.index();
412 return first <= index && index < first + num; 423 return first <= index && index < first + num;
413 } 424 }
414 425
415 } // namespace compiler 426 } // namespace compiler
416 } // namespace internal 427 } // namespace internal
417 } // namespace v8 428 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-native-context-specialization.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698