Chromium Code Reviews| Index: src/compiler/js-intrinsic-lowering.cc |
| diff --git a/src/compiler/js-intrinsic-lowering.cc b/src/compiler/js-intrinsic-lowering.cc |
| index ebe2e4e72330e8101e546d6cef0ca3c1ce25397c..df56ce67b36835457d76c1601da671ae7e6e7979 100644 |
| --- a/src/compiler/js-intrinsic-lowering.cc |
| +++ b/src/compiler/js-intrinsic-lowering.cc |
| @@ -32,6 +32,8 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) { |
| return ReduceInlineIsInstanceType(node, JS_ARRAY_TYPE); |
| case Runtime::kInlineIsFunction: |
| return ReduceInlineIsInstanceType(node, JS_FUNCTION_TYPE); |
| + case Runtime::kInlineJSValueValue: |
| + return ReduceInlineJSValueValue(node); |
| case Runtime::kInlineConstructDouble: |
| return ReduceInlineConstructDouble(node); |
| case Runtime::kInlineDoubleLo: |
| @@ -44,6 +46,8 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) { |
| return ReduceInlineMathFloor(node); |
| case Runtime::kInlineMathSqrt: |
| return ReduceInlineMathSqrt(node); |
| + case Runtime::kInlineStringLength: |
| + return ReduceInlineStringLength(node); |
| case Runtime::kInlineValueOf: |
| return ReduceInlineValueOf(node); |
| default: |
| @@ -103,6 +107,19 @@ Reduction JSIntrinsicLowering::ReduceInlineIsNonNegativeSmi(Node* node) { |
| } |
| +Reduction JSIntrinsicLowering::ReduceInlineJSValueValue(Node* node) { |
| + Node* value = NodeProperties::GetValueInput(node, 0); |
| + Node* effect = NodeProperties::GetEffectInput(node); |
| + Node* control = NodeProperties::GetControlInput(node); |
| + |
| + Node* result = |
| + graph()->NewNode(simplified()->LoadField(AccessBuilder::ForValue()), |
| + value, effect, control); |
| + NodeProperties::ReplaceWithValue(node, result); |
|
titzer
2015/03/18 09:25:53
This looks like a good candidate to mutate in plac
Sven Panne
2015/03/18 10:40:08
Done.
|
| + return Replace(value); |
| +} |
| + |
| + |
| Reduction JSIntrinsicLowering::ReduceInlineConstructDouble(Node* node) { |
| Node* high = NodeProperties::GetValueInput(node, 0); |
| Node* low = NodeProperties::GetValueInput(node, 1); |
| @@ -177,6 +194,19 @@ Reduction JSIntrinsicLowering::ReduceInlineMathSqrt(Node* node) { |
| } |
| +Reduction JSIntrinsicLowering::ReduceInlineStringLength(Node* node) { |
| + Node* value = NodeProperties::GetValueInput(node, 0); |
| + Node* effect = NodeProperties::GetEffectInput(node); |
| + Node* control = NodeProperties::GetControlInput(node); |
| + |
| + Node* result = graph()->NewNode( |
| + simplified()->LoadField(AccessBuilder::ForStringLength()), value, effect, |
| + control); |
| + NodeProperties::ReplaceWithValue(node, result); |
|
titzer
2015/03/18 09:25:53
Same as above.
Sven Panne
2015/03/18 10:40:08
Done.
|
| + return Replace(value); |
| +} |
| + |
| + |
| Reduction JSIntrinsicLowering::ReduceInlineValueOf(Node* node) { |
| // if (%_IsSmi(value)) { |
| // return value; |