| 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/code-factory.h" | 5 #include "src/code-factory.h" |
| 6 #include "src/compilation-dependencies.h" | 6 #include "src/compilation-dependencies.h" |
| 7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
| 8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
| 9 #include "src/compiler/js-typed-lowering.h" | 9 #include "src/compiler/js-typed-lowering.h" |
| 10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 BinaryOperationHints hints = BinaryOperationHintsOf(node_->op()); | 38 BinaryOperationHints hints = BinaryOperationHintsOf(node_->op()); |
| 39 BinaryOperationHints::Hint combined = hints.combined(); | 39 BinaryOperationHints::Hint combined = hints.combined(); |
| 40 if (combined == BinaryOperationHints::kSignedSmall || | 40 if (combined == BinaryOperationHints::kSignedSmall || |
| 41 combined == BinaryOperationHints::kSigned32 || | 41 combined == BinaryOperationHints::kSigned32 || |
| 42 combined == BinaryOperationHints::kNumberOrUndefined) { | 42 combined == BinaryOperationHints::kNumberOrUndefined) { |
| 43 return combined; | 43 return combined; |
| 44 } | 44 } |
| 45 return BinaryOperationHints::kAny; | 45 return BinaryOperationHints::kAny; |
| 46 } | 46 } |
| 47 | 47 |
| 48 void ConvertInputsToNumberOrUndefined(Node* frame_state) { | 48 void ConvertInputsToNumber(Node* frame_state) { |
| 49 // To convert the inputs to numbers, we have to provide frame states | 49 // To convert the inputs to numbers, we have to provide frame states |
| 50 // for lazy bailouts in the ToNumber conversions. | 50 // for lazy bailouts in the ToNumber conversions. |
| 51 // We use a little hack here: we take the frame state before the binary | 51 // We use a little hack here: we take the frame state before the binary |
| 52 // operation and use it to construct the frame states for the conversion | 52 // operation and use it to construct the frame states for the conversion |
| 53 // so that after the deoptimization, the binary operation IC gets | 53 // so that after the deoptimization, the binary operation IC gets |
| 54 // already converted values from full code. This way we are sure that we | 54 // already converted values from full code. This way we are sure that we |
| 55 // will not re-do any of the side effects. | 55 // will not re-do any of the side effects. |
| 56 | 56 |
| 57 Node* left_input = nullptr; | 57 Node* left_input = nullptr; |
| 58 Node* right_input = nullptr; | 58 Node* right_input = nullptr; |
| 59 bool left_is_primitive = left_type()->Is(Type::PlainPrimitive()); | 59 bool left_is_primitive = left_type()->Is(Type::PlainPrimitive()); |
| 60 bool right_is_primitive = right_type()->Is(Type::PlainPrimitive()); | 60 bool right_is_primitive = right_type()->Is(Type::PlainPrimitive()); |
| 61 bool handles_exception = NodeProperties::IsExceptionalCall(node_); | 61 bool handles_exception = NodeProperties::IsExceptionalCall(node_); |
| 62 | 62 |
| 63 if (!left_is_primitive && !right_is_primitive && handles_exception) { | 63 if (!left_is_primitive && !right_is_primitive && handles_exception) { |
| 64 ConvertBothInputsToNumber(&left_input, &right_input, frame_state); | 64 ConvertBothInputsToNumber(&left_input, &right_input, frame_state); |
| 65 } else { | 65 } else { |
| 66 left_input = left_is_primitive | 66 left_input = left_is_primitive |
| 67 ? ConvertPlainPrimitiveToNumberOrUndefined(left()) | 67 ? ConvertPlainPrimitiveToNumber(left()) |
| 68 : ConvertSingleInputToNumber( | 68 : ConvertSingleInputToNumber( |
| 69 left(), CreateFrameStateForLeftInput(frame_state)); | 69 left(), CreateFrameStateForLeftInput(frame_state)); |
| 70 right_input = right_is_primitive | 70 right_input = right_is_primitive |
| 71 ? ConvertPlainPrimitiveToNumberOrUndefined(right()) | 71 ? ConvertPlainPrimitiveToNumber(right()) |
| 72 : ConvertSingleInputToNumber( | 72 : ConvertSingleInputToNumber( |
| 73 right(), CreateFrameStateForRightInput( | 73 right(), CreateFrameStateForRightInput( |
| 74 frame_state, left_input)); | 74 frame_state, left_input)); |
| 75 } | 75 } |
| 76 | 76 |
| 77 node_->ReplaceInput(0, left_input); | 77 node_->ReplaceInput(0, left_input); |
| 78 node_->ReplaceInput(1, right_input); | 78 node_->ReplaceInput(1, right_input); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void ConvertInputsToUI32(Signedness left_signedness, | 81 void ConvertInputsToUI32(Signedness left_signedness, |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 graph()->NewNode(stack->op(), stack->InputCount(), &new_values.front()); | 274 graph()->NewNode(stack->op(), stack->InputCount(), &new_values.front()); |
| 275 | 275 |
| 276 return graph()->NewNode( | 276 return graph()->NewNode( |
| 277 op, frame_state->InputAt(kFrameStateParametersInput), | 277 op, frame_state->InputAt(kFrameStateParametersInput), |
| 278 frame_state->InputAt(kFrameStateLocalsInput), new_stack, | 278 frame_state->InputAt(kFrameStateLocalsInput), new_stack, |
| 279 frame_state->InputAt(kFrameStateContextInput), | 279 frame_state->InputAt(kFrameStateContextInput), |
| 280 frame_state->InputAt(kFrameStateFunctionInput), | 280 frame_state->InputAt(kFrameStateFunctionInput), |
| 281 frame_state->InputAt(kFrameStateOuterStateInput)); | 281 frame_state->InputAt(kFrameStateOuterStateInput)); |
| 282 } | 282 } |
| 283 | 283 |
| 284 Node* ConvertPlainPrimitiveToNumberOrUndefined(Node* node) { | 284 Node* ConvertPlainPrimitiveToNumber(Node* node) { |
| 285 DCHECK(NodeProperties::GetType(node)->Is(Type::PlainPrimitive())); | 285 DCHECK(NodeProperties::GetType(node)->Is(Type::PlainPrimitive())); |
| 286 // Avoid inserting too many eager ToNumber() operations. | 286 // Avoid inserting too many eager ToNumber() operations. |
| 287 Reduction const reduction = lowering_->ReduceJSToNumberInput(node); | 287 Reduction const reduction = lowering_->ReduceJSToNumberInput(node); |
| 288 if (reduction.Changed()) return reduction.replacement(); | 288 if (reduction.Changed()) return reduction.replacement(); |
| 289 if (NodeProperties::GetType(node)->Is(Type::NumberOrUndefined())) { | 289 if (NodeProperties::GetType(node)->Is(Type::Number())) { |
| 290 return node; | 290 return node; |
| 291 } | 291 } |
| 292 return graph()->NewNode(simplified()->PlainPrimitiveToNumber(), node); | 292 return graph()->NewNode(simplified()->PlainPrimitiveToNumber(), node); |
| 293 } | 293 } |
| 294 | 294 |
| 295 Node* ConvertSingleInputToNumber(Node* node, Node* frame_state) { | 295 Node* ConvertSingleInputToNumber(Node* node, Node* frame_state) { |
| 296 DCHECK(!NodeProperties::GetType(node)->Is(Type::PlainPrimitive())); | 296 DCHECK(!NodeProperties::GetType(node)->Is(Type::PlainPrimitive())); |
| 297 Node* const n = graph()->NewNode(javascript()->ToNumber(), node, context(), | 297 Node* const n = graph()->NewNode(javascript()->ToNumber(), node, context(), |
| 298 frame_state, effect(), control()); | 298 frame_state, effect(), control()); |
| 299 Node* const if_success = graph()->NewNode(common()->IfSuccess(), n); | 299 Node* const if_success = graph()->NewNode(common()->IfSuccess(), n); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 if (flags() & kDisableBinaryOpReduction) return NoChange(); | 402 if (flags() & kDisableBinaryOpReduction) return NoChange(); |
| 403 | 403 |
| 404 JSBinopReduction r(this, node); | 404 JSBinopReduction r(this, node); |
| 405 | 405 |
| 406 BinaryOperationHints::Hint feedback = r.GetUsableNumberFeedback(); | 406 BinaryOperationHints::Hint feedback = r.GetUsableNumberFeedback(); |
| 407 if (feedback != BinaryOperationHints::kAny) { | 407 if (feedback != BinaryOperationHints::kAny) { |
| 408 // Lower to the optimistic number binop. | 408 // Lower to the optimistic number binop. |
| 409 return r.ChangeToSpeculativeOperator( | 409 return r.ChangeToSpeculativeOperator( |
| 410 simplified()->SpeculativeNumberAdd(feedback)); | 410 simplified()->SpeculativeNumberAdd(feedback)); |
| 411 } | 411 } |
| 412 if (r.BothInputsAre(Type::NumberOrUndefined())) { | 412 if (r.BothInputsAre(Type::Number())) { |
| 413 // JSAdd(x:number, y:number) => NumberAdd(x, y) | 413 // JSAdd(x:number, y:number) => NumberAdd(x, y) |
| 414 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); | 414 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); |
| 415 r.ConvertInputsToNumberOrUndefined(frame_state); | 415 r.ConvertInputsToNumber(frame_state); |
| 416 return r.ChangeToPureOperator(simplified()->NumberAdd(), Type::Number()); | 416 return r.ChangeToPureOperator(simplified()->NumberAdd(), Type::Number()); |
| 417 } | 417 } |
| 418 if (r.NeitherInputCanBe(Type::StringOrReceiver())) { | 418 if (r.NeitherInputCanBe(Type::StringOrReceiver())) { |
| 419 // JSAdd(x:-string, y:-string) => NumberAdd(ToNumber(x), ToNumber(y)) | 419 // JSAdd(x:-string, y:-string) => NumberAdd(ToNumber(x), ToNumber(y)) |
| 420 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); | 420 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); |
| 421 r.ConvertInputsToNumberOrUndefined(frame_state); | 421 r.ConvertInputsToNumber(frame_state); |
| 422 return r.ChangeToPureOperator(simplified()->NumberAdd(), Type::Number()); | 422 return r.ChangeToPureOperator(simplified()->NumberAdd(), Type::Number()); |
| 423 } | 423 } |
| 424 if (r.OneInputIs(Type::String())) { | 424 if (r.OneInputIs(Type::String())) { |
| 425 StringAddFlags flags = STRING_ADD_CHECK_NONE; | 425 StringAddFlags flags = STRING_ADD_CHECK_NONE; |
| 426 if (!r.LeftInputIs(Type::String())) { | 426 if (!r.LeftInputIs(Type::String())) { |
| 427 flags = STRING_ADD_CONVERT_LEFT; | 427 flags = STRING_ADD_CONVERT_LEFT; |
| 428 } else if (!r.RightInputIs(Type::String())) { | 428 } else if (!r.RightInputIs(Type::String())) { |
| 429 flags = STRING_ADD_CONVERT_RIGHT; | 429 flags = STRING_ADD_CONVERT_RIGHT; |
| 430 } | 430 } |
| 431 // JSAdd(x:string, y) => CallStub[StringAdd](x, y) | 431 // JSAdd(x:string, y) => CallStub[StringAdd](x, y) |
| (...skipping 29 matching lines...) Expand all Loading... |
| 461 Reduction JSTypedLowering::ReduceJSSubtract(Node* node) { | 461 Reduction JSTypedLowering::ReduceJSSubtract(Node* node) { |
| 462 if (flags() & kDisableBinaryOpReduction) return NoChange(); | 462 if (flags() & kDisableBinaryOpReduction) return NoChange(); |
| 463 JSBinopReduction r(this, node); | 463 JSBinopReduction r(this, node); |
| 464 BinaryOperationHints::Hint feedback = r.GetUsableNumberFeedback(); | 464 BinaryOperationHints::Hint feedback = r.GetUsableNumberFeedback(); |
| 465 if (feedback != BinaryOperationHints::kAny) { | 465 if (feedback != BinaryOperationHints::kAny) { |
| 466 // Lower to the optimistic number binop. | 466 // Lower to the optimistic number binop. |
| 467 return r.ChangeToSpeculativeOperator( | 467 return r.ChangeToSpeculativeOperator( |
| 468 simplified()->SpeculativeNumberSubtract(feedback)); | 468 simplified()->SpeculativeNumberSubtract(feedback)); |
| 469 } | 469 } |
| 470 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); | 470 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); |
| 471 r.ConvertInputsToNumberOrUndefined(frame_state); | 471 r.ConvertInputsToNumber(frame_state); |
| 472 return r.ChangeToPureOperator(simplified()->NumberSubtract(), Type::Number()); | 472 return r.ChangeToPureOperator(simplified()->NumberSubtract(), Type::Number()); |
| 473 } | 473 } |
| 474 | 474 |
| 475 Reduction JSTypedLowering::ReduceJSMultiply(Node* node) { | 475 Reduction JSTypedLowering::ReduceJSMultiply(Node* node) { |
| 476 if (flags() & kDisableBinaryOpReduction) return NoChange(); | 476 if (flags() & kDisableBinaryOpReduction) return NoChange(); |
| 477 JSBinopReduction r(this, node); | 477 JSBinopReduction r(this, node); |
| 478 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); | 478 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); |
| 479 r.ConvertInputsToNumberOrUndefined(frame_state); | 479 r.ConvertInputsToNumber(frame_state); |
| 480 return r.ChangeToPureOperator(simplified()->NumberMultiply(), Type::Number()); | 480 return r.ChangeToPureOperator(simplified()->NumberMultiply(), Type::Number()); |
| 481 } | 481 } |
| 482 | 482 |
| 483 Reduction JSTypedLowering::ReduceJSDivide(Node* node) { | 483 Reduction JSTypedLowering::ReduceJSDivide(Node* node) { |
| 484 if (flags() & kDisableBinaryOpReduction) return NoChange(); | 484 if (flags() & kDisableBinaryOpReduction) return NoChange(); |
| 485 JSBinopReduction r(this, node); | 485 JSBinopReduction r(this, node); |
| 486 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); | 486 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); |
| 487 r.ConvertInputsToNumberOrUndefined(frame_state); | 487 r.ConvertInputsToNumber(frame_state); |
| 488 return r.ChangeToPureOperator(simplified()->NumberDivide(), Type::Number()); | 488 return r.ChangeToPureOperator(simplified()->NumberDivide(), Type::Number()); |
| 489 } | 489 } |
| 490 | 490 |
| 491 | 491 |
| 492 Reduction JSTypedLowering::ReduceInt32Binop(Node* node, const Operator* intOp) { | 492 Reduction JSTypedLowering::ReduceInt32Binop(Node* node, const Operator* intOp) { |
| 493 if (flags() & kDisableBinaryOpReduction) return NoChange(); | 493 if (flags() & kDisableBinaryOpReduction) return NoChange(); |
| 494 | 494 |
| 495 JSBinopReduction r(this, node); | 495 JSBinopReduction r(this, node); |
| 496 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); | 496 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); |
| 497 r.ConvertInputsToNumberOrUndefined(frame_state); | 497 r.ConvertInputsToNumber(frame_state); |
| 498 r.ConvertInputsToUI32(kSigned, kSigned); | 498 r.ConvertInputsToUI32(kSigned, kSigned); |
| 499 return r.ChangeToPureOperator(intOp, Type::Integral32()); | 499 return r.ChangeToPureOperator(intOp, Type::Integral32()); |
| 500 } | 500 } |
| 501 | 501 |
| 502 | 502 |
| 503 Reduction JSTypedLowering::ReduceUI32Shift(Node* node, | 503 Reduction JSTypedLowering::ReduceUI32Shift(Node* node, |
| 504 Signedness left_signedness, | 504 Signedness left_signedness, |
| 505 const Operator* shift_op) { | 505 const Operator* shift_op) { |
| 506 if (flags() & kDisableBinaryOpReduction) return NoChange(); | 506 if (flags() & kDisableBinaryOpReduction) return NoChange(); |
| 507 | 507 |
| 508 JSBinopReduction r(this, node); | 508 JSBinopReduction r(this, node); |
| 509 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); | 509 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); |
| 510 r.ConvertInputsToNumberOrUndefined(frame_state); | 510 r.ConvertInputsToNumber(frame_state); |
| 511 r.ConvertInputsToUI32(left_signedness, kUnsigned); | 511 r.ConvertInputsToUI32(left_signedness, kUnsigned); |
| 512 return r.ChangeToPureOperator(shift_op); | 512 return r.ChangeToPureOperator(shift_op); |
| 513 } | 513 } |
| 514 | 514 |
| 515 | 515 |
| 516 Reduction JSTypedLowering::ReduceJSComparison(Node* node) { | 516 Reduction JSTypedLowering::ReduceJSComparison(Node* node) { |
| 517 if (flags() & kDisableBinaryOpReduction) return NoChange(); | 517 if (flags() & kDisableBinaryOpReduction) return NoChange(); |
| 518 | 518 |
| 519 JSBinopReduction r(this, node); | 519 JSBinopReduction r(this, node); |
| 520 if (r.BothInputsAre(Type::String())) { | 520 if (r.BothInputsAre(Type::String())) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 546 const Operator* less_than_or_equal; | 546 const Operator* less_than_or_equal; |
| 547 if (r.BothInputsAre(Type::Unsigned32())) { | 547 if (r.BothInputsAre(Type::Unsigned32())) { |
| 548 less_than = machine()->Uint32LessThan(); | 548 less_than = machine()->Uint32LessThan(); |
| 549 less_than_or_equal = machine()->Uint32LessThanOrEqual(); | 549 less_than_or_equal = machine()->Uint32LessThanOrEqual(); |
| 550 } else if (r.BothInputsAre(Type::Signed32())) { | 550 } else if (r.BothInputsAre(Type::Signed32())) { |
| 551 less_than = machine()->Int32LessThan(); | 551 less_than = machine()->Int32LessThan(); |
| 552 less_than_or_equal = machine()->Int32LessThanOrEqual(); | 552 less_than_or_equal = machine()->Int32LessThanOrEqual(); |
| 553 } else { | 553 } else { |
| 554 // TODO(turbofan): mixed signed/unsigned int32 comparisons. | 554 // TODO(turbofan): mixed signed/unsigned int32 comparisons. |
| 555 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); | 555 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); |
| 556 r.ConvertInputsToNumberOrUndefined(frame_state); | 556 r.ConvertInputsToNumber(frame_state); |
| 557 less_than = simplified()->NumberLessThan(); | 557 less_than = simplified()->NumberLessThan(); |
| 558 less_than_or_equal = simplified()->NumberLessThanOrEqual(); | 558 less_than_or_equal = simplified()->NumberLessThanOrEqual(); |
| 559 } | 559 } |
| 560 const Operator* comparison; | 560 const Operator* comparison; |
| 561 switch (node->opcode()) { | 561 switch (node->opcode()) { |
| 562 case IrOpcode::kJSLessThan: | 562 case IrOpcode::kJSLessThan: |
| 563 comparison = less_than; | 563 comparison = less_than; |
| 564 break; | 564 break; |
| 565 case IrOpcode::kJSGreaterThan: | 565 case IrOpcode::kJSGreaterThan: |
| 566 comparison = less_than; | 566 comparison = less_than; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 return r.ChangeToPureOperator( | 715 return r.ChangeToPureOperator( |
| 716 simplified()->ReferenceEqual(Type::Receiver()), invert); | 716 simplified()->ReferenceEqual(Type::Receiver()), invert); |
| 717 } | 717 } |
| 718 if (r.BothInputsAre(Type::Unique())) { | 718 if (r.BothInputsAre(Type::Unique())) { |
| 719 return r.ChangeToPureOperator(simplified()->ReferenceEqual(Type::Unique()), | 719 return r.ChangeToPureOperator(simplified()->ReferenceEqual(Type::Unique()), |
| 720 invert); | 720 invert); |
| 721 } | 721 } |
| 722 if (r.BothInputsAre(Type::String())) { | 722 if (r.BothInputsAre(Type::String())) { |
| 723 return r.ChangeToPureOperator(simplified()->StringEqual(), invert); | 723 return r.ChangeToPureOperator(simplified()->StringEqual(), invert); |
| 724 } | 724 } |
| 725 if (r.BothInputsAre(Type::NumberOrUndefined())) { | 725 if (r.BothInputsAre(Type::Number())) { |
| 726 return r.ChangeToPureOperator(simplified()->NumberEqual(), invert); | 726 return r.ChangeToPureOperator(simplified()->NumberEqual(), invert); |
| 727 } | 727 } |
| 728 // TODO(turbofan): js-typed-lowering of StrictEqual(mixed types) | 728 // TODO(turbofan): js-typed-lowering of StrictEqual(mixed types) |
| 729 return NoChange(); | 729 return NoChange(); |
| 730 } | 730 } |
| 731 | 731 |
| 732 | 732 |
| 733 Reduction JSTypedLowering::ReduceJSToBoolean(Node* node) { | 733 Reduction JSTypedLowering::ReduceJSToBoolean(Node* node) { |
| 734 Node* const input = node->InputAt(0); | 734 Node* const input = node->InputAt(0); |
| 735 Type* const input_type = NodeProperties::GetType(input); | 735 Type* const input_type = NodeProperties::GetType(input); |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1066 key_type->Is(shifted_int32_ranges_[k]) && byte_length <= kMaxInt) { | 1066 key_type->Is(shifted_int32_ranges_[k]) && byte_length <= kMaxInt) { |
| 1067 // JSLoadProperty(typed-array, int32) | 1067 // JSLoadProperty(typed-array, int32) |
| 1068 Handle<FixedTypedArrayBase> elements = | 1068 Handle<FixedTypedArrayBase> elements = |
| 1069 Handle<FixedTypedArrayBase>::cast(handle(array->elements())); | 1069 Handle<FixedTypedArrayBase>::cast(handle(array->elements())); |
| 1070 Node* buffer = jsgraph()->PointerConstant(elements->external_pointer()); | 1070 Node* buffer = jsgraph()->PointerConstant(elements->external_pointer()); |
| 1071 Node* length = jsgraph()->Constant(byte_length); | 1071 Node* length = jsgraph()->Constant(byte_length); |
| 1072 Node* context = NodeProperties::GetContextInput(node); | 1072 Node* context = NodeProperties::GetContextInput(node); |
| 1073 Node* effect = NodeProperties::GetEffectInput(node); | 1073 Node* effect = NodeProperties::GetEffectInput(node); |
| 1074 Node* control = NodeProperties::GetControlInput(node); | 1074 Node* control = NodeProperties::GetControlInput(node); |
| 1075 // Convert to a number first. | 1075 // Convert to a number first. |
| 1076 if (!value_type->Is(Type::NumberOrUndefined())) { | 1076 if (!value_type->Is(Type::Number())) { |
| 1077 Reduction number_reduction = ReduceJSToNumberInput(value); | 1077 Reduction number_reduction = ReduceJSToNumberInput(value); |
| 1078 if (number_reduction.Changed()) { | 1078 if (number_reduction.Changed()) { |
| 1079 value = number_reduction.replacement(); | 1079 value = number_reduction.replacement(); |
| 1080 } else { | 1080 } else { |
| 1081 Node* frame_state_for_to_number = | 1081 Node* frame_state_for_to_number = |
| 1082 NodeProperties::FindFrameStateBefore(node); | 1082 NodeProperties::FindFrameStateBefore(node); |
| 1083 value = effect = | 1083 value = effect = |
| 1084 graph()->NewNode(javascript()->ToNumber(), value, context, | 1084 graph()->NewNode(javascript()->ToNumber(), value, context, |
| 1085 frame_state_for_to_number, effect, control); | 1085 frame_state_for_to_number, effect, control); |
| 1086 } | 1086 } |
| (...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1947 } | 1947 } |
| 1948 | 1948 |
| 1949 | 1949 |
| 1950 CompilationDependencies* JSTypedLowering::dependencies() const { | 1950 CompilationDependencies* JSTypedLowering::dependencies() const { |
| 1951 return dependencies_; | 1951 return dependencies_; |
| 1952 } | 1952 } |
| 1953 | 1953 |
| 1954 } // namespace compiler | 1954 } // namespace compiler |
| 1955 } // namespace internal | 1955 } // namespace internal |
| 1956 } // namespace v8 | 1956 } // namespace v8 |
| OLD | NEW |