| OLD | NEW |
| 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/js-operator.h" |
| 8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
| 9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
| 10 #include "src/compiler/operator-properties.h" | 10 #include "src/compiler/operator-properties.h" |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 // very last context in the context chain anyway. | 361 // very last context in the context chain anyway. |
| 362 node = NodeProperties::GetContextInput(node); | 362 node = NodeProperties::GetContextInput(node); |
| 363 break; | 363 break; |
| 364 } | 364 } |
| 365 case IrOpcode::kHeapConstant: { | 365 case IrOpcode::kHeapConstant: { |
| 366 // Extract the native context from the actual {context}. | 366 // Extract the native context from the actual {context}. |
| 367 Handle<Context> context = | 367 Handle<Context> context = |
| 368 Handle<Context>::cast(OpParameter<Handle<HeapObject>>(node)); | 368 Handle<Context>::cast(OpParameter<Handle<HeapObject>>(node)); |
| 369 return handle(context->native_context()); | 369 return handle(context->native_context()); |
| 370 } | 370 } |
| 371 case IrOpcode::kOsrValue: { | 371 case IrOpcode::kOsrGuard: { |
| 372 int const index = OpParameter<int>(node); | 372 Node* osr_value = node->InputAt(0); |
| 373 DCHECK_EQ(IrOpcode::kOsrValue, osr_value->opcode()); |
| 374 int const index = OsrValueIndexOf(osr_value->op()); |
| 373 if (index == Linkage::kOsrContextSpillSlotIndex) { | 375 if (index == Linkage::kOsrContextSpillSlotIndex) { |
| 374 return native_context; | 376 return native_context; |
| 375 } | 377 } |
| 376 return MaybeHandle<Context>(); | 378 return MaybeHandle<Context>(); |
| 377 } | 379 } |
| 378 case IrOpcode::kParameter: { | 380 case IrOpcode::kParameter: { |
| 379 Node* const start = NodeProperties::GetValueInput(node, 0); | 381 Node* const start = NodeProperties::GetValueInput(node, 0); |
| 380 DCHECK_EQ(IrOpcode::kStart, start->opcode()); | 382 DCHECK_EQ(IrOpcode::kStart, start->opcode()); |
| 381 int const index = ParameterIndexOf(node->op()); | 383 int const index = ParameterIndexOf(node->op()); |
| 382 // The context is always the last parameter to a JavaScript function, | 384 // The context is always the last parameter to a JavaScript function, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 // static | 426 // static |
| 425 bool NodeProperties::IsInputRange(Edge edge, int first, int num) { | 427 bool NodeProperties::IsInputRange(Edge edge, int first, int num) { |
| 426 if (num == 0) return false; | 428 if (num == 0) return false; |
| 427 int const index = edge.index(); | 429 int const index = edge.index(); |
| 428 return first <= index && index < first + num; | 430 return first <= index && index < first + num; |
| 429 } | 431 } |
| 430 | 432 |
| 431 } // namespace compiler | 433 } // namespace compiler |
| 432 } // namespace internal | 434 } // namespace internal |
| 433 } // namespace v8 | 435 } // namespace v8 |
| OLD | NEW |