| OLD | NEW |
| 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/frame-states.h" | 5 #include "src/compiler/frame-states.h" |
| 6 #include "src/compiler/js-context-relaxation.h" | 6 #include "src/compiler/js-context-relaxation.h" |
| 7 #include "src/compiler/js-operator.h" | 7 #include "src/compiler/js-operator.h" |
| 8 #include "src/compiler/node.h" | 8 #include "src/compiler/node.h" |
| 9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
| 10 | 10 |
| 11 namespace v8 { | 11 namespace v8 { |
| 12 namespace internal { | 12 namespace internal { |
| 13 namespace compiler { | 13 namespace compiler { |
| 14 | 14 |
| 15 Reduction JSContextRelaxation::Reduce(Node* node) { | 15 Reduction JSContextRelaxation::Reduce(Node* node) { |
| 16 switch (node->opcode()) { | 16 switch (node->opcode()) { |
| 17 case IrOpcode::kJSCallRuntime: { |
| 18 const CallRuntimeParameters& p = CallRuntimeParametersOf(node->op()); |
| 19 const Runtime::Function* fun = Runtime::FunctionForId(p.id()); |
| 20 switch (fun->function_id) { |
| 21 #define IC_CASE(name, number_of_args, result_size) \ |
| 22 case Runtime::k##name: \ |
| 23 break; |
| 24 FOR_EACH_INTRINSIC_IC(IC_CASE) |
| 25 #undef IC_CASE |
| 26 default: |
| 27 return NoChange(); |
| 28 } |
| 29 } |
| 30 // Fall through |
| 17 case IrOpcode::kJSCallFunction: | 31 case IrOpcode::kJSCallFunction: |
| 18 case IrOpcode::kJSToNumber: { | 32 case IrOpcode::kJSToNumber: { |
| 19 Node* frame_state = NodeProperties::GetFrameStateInput(node, 0); | 33 Node* frame_state = NodeProperties::GetFrameStateInput(node, 0); |
| 20 Node* outer_frame = frame_state; | 34 Node* outer_frame = frame_state; |
| 21 Node* original_context = NodeProperties::GetContextInput(node); | 35 Node* original_context = NodeProperties::GetContextInput(node); |
| 22 Node* candidate_new_context = original_context; | 36 Node* candidate_new_context = original_context; |
| 23 do { | 37 do { |
| 24 FrameStateInfo frame_state_info( | 38 FrameStateInfo frame_state_info( |
| 25 OpParameter<FrameStateInfo>(outer_frame->op())); | 39 OpParameter<FrameStateInfo>(outer_frame->op())); |
| 26 const FrameStateFunctionInfo* function_info = | 40 const FrameStateFunctionInfo* function_info = |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 72 } |
| 59 default: | 73 default: |
| 60 break; | 74 break; |
| 61 } | 75 } |
| 62 return NoChange(); | 76 return NoChange(); |
| 63 } | 77 } |
| 64 | 78 |
| 65 } // namespace compiler | 79 } // namespace compiler |
| 66 } // namespace internal | 80 } // namespace internal |
| 67 } // namespace v8 | 81 } // namespace v8 |
| OLD | NEW |