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/js-frame-specialization.h" | 5 #include "src/compiler/js-frame-specialization.h" |
6 | 6 |
7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
9 #include "src/frames-inl.h" | 9 #include "src/frames-inl.h" |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 default: | 21 default: |
22 break; | 22 break; |
23 } | 23 } |
24 return NoChange(); | 24 return NoChange(); |
25 } | 25 } |
26 | 26 |
27 | 27 |
28 Reduction JSFrameSpecialization::ReduceOsrValue(Node* node) { | 28 Reduction JSFrameSpecialization::ReduceOsrValue(Node* node) { |
29 DCHECK_EQ(IrOpcode::kOsrValue, node->opcode()); | 29 DCHECK_EQ(IrOpcode::kOsrValue, node->opcode()); |
30 Handle<Object> value; | 30 Handle<Object> value; |
31 int const index = OpParameter<int>(node); | 31 int index = OsrValueIndexOf(node->op()); |
32 int const parameters_count = frame()->ComputeParametersCount() + 1; | 32 int const parameters_count = frame()->ComputeParametersCount() + 1; |
33 if (index == Linkage::kOsrContextSpillSlotIndex) { | 33 if (index == Linkage::kOsrContextSpillSlotIndex) { |
34 value = handle(frame()->context(), isolate()); | 34 value = handle(frame()->context(), isolate()); |
35 } else if (index >= parameters_count) { | 35 } else if (index >= parameters_count) { |
36 value = handle(frame()->GetExpression(index - parameters_count), isolate()); | 36 value = handle(frame()->GetExpression(index - parameters_count), isolate()); |
37 } else { | 37 } else { |
38 // The OsrValue index 0 is the receiver. | 38 // The OsrValue index 0 is the receiver. |
39 value = | 39 value = |
40 handle(index ? frame()->GetParameter(index - 1) : frame()->receiver(), | 40 handle(index ? frame()->GetParameter(index - 1) : frame()->receiver(), |
41 isolate()); | 41 isolate()); |
(...skipping 24 matching lines...) Expand all Loading... |
66 } | 66 } |
67 return Replace(jsgraph()->Constant(value)); | 67 return Replace(jsgraph()->Constant(value)); |
68 } | 68 } |
69 | 69 |
70 | 70 |
71 Isolate* JSFrameSpecialization::isolate() const { return jsgraph()->isolate(); } | 71 Isolate* JSFrameSpecialization::isolate() const { return jsgraph()->isolate(); } |
72 | 72 |
73 } // namespace compiler | 73 } // namespace compiler |
74 } // namespace internal | 74 } // namespace internal |
75 } // namespace v8 | 75 } // namespace v8 |
OLD | NEW |