OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/simplified-operator.h" | 5 #include "src/compiler/simplified-operator.h" |
6 | 6 |
7 #include "src/base/lazy-instance.h" | 7 #include "src/base/lazy-instance.h" |
8 #include "src/compiler/opcodes.h" | 8 #include "src/compiler/opcodes.h" |
9 #include "src/compiler/operator.h" | 9 #include "src/compiler/operator.h" |
10 #include "src/compiler/types.h" | 10 #include "src/compiler/types.h" |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 V(StringCharCodeAt, Operator::kNoProperties, 2, 1) \ | 397 V(StringCharCodeAt, Operator::kNoProperties, 2, 1) \ |
398 V(StringFromCharCode, Operator::kNoProperties, 1, 0) \ | 398 V(StringFromCharCode, Operator::kNoProperties, 1, 0) \ |
399 V(PlainPrimitiveToNumber, Operator::kNoProperties, 1, 0) \ | 399 V(PlainPrimitiveToNumber, Operator::kNoProperties, 1, 0) \ |
400 V(PlainPrimitiveToWord32, Operator::kNoProperties, 1, 0) \ | 400 V(PlainPrimitiveToWord32, Operator::kNoProperties, 1, 0) \ |
401 V(PlainPrimitiveToFloat64, Operator::kNoProperties, 1, 0) \ | 401 V(PlainPrimitiveToFloat64, Operator::kNoProperties, 1, 0) \ |
402 V(ChangeTaggedSignedToInt32, Operator::kNoProperties, 1, 0) \ | 402 V(ChangeTaggedSignedToInt32, Operator::kNoProperties, 1, 0) \ |
403 V(ChangeTaggedToInt32, Operator::kNoProperties, 1, 0) \ | 403 V(ChangeTaggedToInt32, Operator::kNoProperties, 1, 0) \ |
404 V(ChangeTaggedToUint32, Operator::kNoProperties, 1, 0) \ | 404 V(ChangeTaggedToUint32, Operator::kNoProperties, 1, 0) \ |
405 V(ChangeTaggedToFloat64, Operator::kNoProperties, 1, 0) \ | 405 V(ChangeTaggedToFloat64, Operator::kNoProperties, 1, 0) \ |
406 V(ChangeFloat64ToTagged, Operator::kNoProperties, 1, 0) \ | 406 V(ChangeFloat64ToTagged, Operator::kNoProperties, 1, 0) \ |
| 407 V(ChangeFloat64ToTaggedPointer, Operator::kNoProperties, 1, 0) \ |
407 V(ChangeInt31ToTaggedSigned, Operator::kNoProperties, 1, 0) \ | 408 V(ChangeInt31ToTaggedSigned, Operator::kNoProperties, 1, 0) \ |
408 V(ChangeInt32ToTagged, Operator::kNoProperties, 1, 0) \ | 409 V(ChangeInt32ToTagged, Operator::kNoProperties, 1, 0) \ |
409 V(ChangeUint32ToTagged, Operator::kNoProperties, 1, 0) \ | 410 V(ChangeUint32ToTagged, Operator::kNoProperties, 1, 0) \ |
410 V(ChangeTaggedToBit, Operator::kNoProperties, 1, 0) \ | 411 V(ChangeTaggedToBit, Operator::kNoProperties, 1, 0) \ |
411 V(ChangeBitToTagged, Operator::kNoProperties, 1, 0) \ | 412 V(ChangeBitToTagged, Operator::kNoProperties, 1, 0) \ |
412 V(TruncateTaggedToBit, Operator::kNoProperties, 1, 0) \ | 413 V(TruncateTaggedToBit, Operator::kNoProperties, 1, 0) \ |
413 V(TruncateTaggedToWord32, Operator::kNoProperties, 1, 0) \ | 414 V(TruncateTaggedToWord32, Operator::kNoProperties, 1, 0) \ |
414 V(TruncateTaggedToFloat64, Operator::kNoProperties, 1, 0) \ | 415 V(TruncateTaggedToFloat64, Operator::kNoProperties, 1, 0) \ |
415 V(ObjectIsCallable, Operator::kNoProperties, 1, 0) \ | 416 V(ObjectIsCallable, Operator::kNoProperties, 1, 0) \ |
416 V(ObjectIsNumber, Operator::kNoProperties, 1, 0) \ | 417 V(ObjectIsNumber, Operator::kNoProperties, 1, 0) \ |
417 V(ObjectIsReceiver, Operator::kNoProperties, 1, 0) \ | 418 V(ObjectIsReceiver, Operator::kNoProperties, 1, 0) \ |
418 V(ObjectIsSmi, Operator::kNoProperties, 1, 0) \ | 419 V(ObjectIsSmi, Operator::kNoProperties, 1, 0) \ |
419 V(ObjectIsString, Operator::kNoProperties, 1, 0) \ | 420 V(ObjectIsString, Operator::kNoProperties, 1, 0) \ |
420 V(ObjectIsUndetectable, Operator::kNoProperties, 1, 0) \ | 421 V(ObjectIsUndetectable, Operator::kNoProperties, 1, 0) \ |
421 V(ConvertTaggedHoleToUndefined, Operator::kNoProperties, 1, 0) \ | 422 V(ConvertTaggedHoleToUndefined, Operator::kNoProperties, 1, 0) \ |
422 V(ReferenceEqual, Operator::kCommutative, 2, 0) \ | 423 V(ReferenceEqual, Operator::kCommutative, 2, 0) \ |
423 V(StringEqual, Operator::kCommutative, 2, 0) \ | 424 V(StringEqual, Operator::kCommutative, 2, 0) \ |
424 V(StringLessThan, Operator::kNoProperties, 2, 0) \ | 425 V(StringLessThan, Operator::kNoProperties, 2, 0) \ |
425 V(StringLessThanOrEqual, Operator::kNoProperties, 2, 0) | 426 V(StringLessThanOrEqual, Operator::kNoProperties, 2, 0) |
426 | 427 |
427 #define SPECULATIVE_NUMBER_BINOP_LIST(V) \ | 428 #define SPECULATIVE_NUMBER_BINOP_LIST(V) \ |
428 SIMPLIFIED_SPECULATIVE_NUMBER_BINOP_LIST(V) \ | 429 SIMPLIFIED_SPECULATIVE_NUMBER_BINOP_LIST(V) \ |
429 V(SpeculativeNumberEqual) \ | 430 V(SpeculativeNumberEqual) \ |
430 V(SpeculativeNumberLessThan) \ | 431 V(SpeculativeNumberLessThan) \ |
431 V(SpeculativeNumberLessThanOrEqual) | 432 V(SpeculativeNumberLessThanOrEqual) |
432 | 433 |
433 #define CHECKED_OP_LIST(V) \ | 434 #define CHECKED_OP_LIST(V) \ |
434 V(CheckBounds, 2, 1) \ | 435 V(CheckBounds, 2, 1) \ |
435 V(CheckHeapObject, 1, 1) \ | 436 V(CheckHeapObject, 1, 1) \ |
436 V(CheckIf, 1, 0) \ | 437 V(CheckIf, 1, 0) \ |
437 V(CheckNumber, 1, 1) \ | 438 V(CheckNumber, 1, 1) \ |
438 V(CheckSmi, 1, 1) \ | 439 V(CheckSmi, 1, 1) \ |
439 V(CheckString, 1, 1) \ | 440 V(CheckString, 1, 1) \ |
440 V(CheckTaggedHole, 1, 1) \ | 441 V(CheckTaggedHole, 1, 1) \ |
441 V(CheckedInt32Add, 2, 1) \ | 442 V(CheckedInt32Add, 2, 1) \ |
442 V(CheckedInt32Sub, 2, 1) \ | 443 V(CheckedInt32Sub, 2, 1) \ |
443 V(CheckedInt32Div, 2, 1) \ | 444 V(CheckedInt32Div, 2, 1) \ |
444 V(CheckedInt32Mod, 2, 1) \ | 445 V(CheckedInt32Mod, 2, 1) \ |
445 V(CheckedUint32Div, 2, 1) \ | 446 V(CheckedUint32Div, 2, 1) \ |
446 V(CheckedUint32Mod, 2, 1) \ | 447 V(CheckedUint32Mod, 2, 1) \ |
447 V(CheckedUint32ToInt32, 1, 1) \ | 448 V(CheckedUint32ToInt32, 1, 1) \ |
448 V(CheckedUint32ToTaggedSigned, 1, 1) \ | 449 V(CheckedUint32ToTaggedSigned, 1, 1) \ |
449 V(CheckedInt32ToTaggedSigned, 1, 1) \ | 450 V(CheckedInt32ToTaggedSigned, 1, 1) \ |
450 V(CheckedTaggedSignedToInt32, 1, 1) \ | 451 V(CheckedTaggedSignedToInt32, 1, 1) \ |
451 V(CheckedTaggedToTaggedSigned, 1, 1) \ | 452 V(CheckedTaggedToTaggedSigned, 1, 1) \ |
| 453 V(CheckedTaggedToTaggedPointer, 1, 1) \ |
452 V(CheckedTruncateTaggedToWord32, 1, 1) | 454 V(CheckedTruncateTaggedToWord32, 1, 1) |
453 | 455 |
454 struct SimplifiedOperatorGlobalCache final { | 456 struct SimplifiedOperatorGlobalCache final { |
455 #define PURE(Name, properties, value_input_count, control_input_count) \ | 457 #define PURE(Name, properties, value_input_count, control_input_count) \ |
456 struct Name##Operator final : public Operator { \ | 458 struct Name##Operator final : public Operator { \ |
457 Name##Operator() \ | 459 Name##Operator() \ |
458 : Operator(IrOpcode::k##Name, Operator::kPure | properties, #Name, \ | 460 : Operator(IrOpcode::k##Name, Operator::kPure | properties, #Name, \ |
459 value_input_count, 0, control_input_count, 1, 0, 0) {} \ | 461 value_input_count, 0, control_input_count, 1, 0, 0) {} \ |
460 }; \ | 462 }; \ |
461 Name##Operator k##Name; | 463 Name##Operator k##Name; |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 Operator::kNoDeopt | Operator::kNoThrow | properties, \ | 819 Operator::kNoDeopt | Operator::kNoThrow | properties, \ |
818 #Name, value_input_count, 1, control_input_count, \ | 820 #Name, value_input_count, 1, control_input_count, \ |
819 output_count, 1, 0, access); \ | 821 output_count, 1, 0, access); \ |
820 } | 822 } |
821 ACCESS_OP_LIST(ACCESS) | 823 ACCESS_OP_LIST(ACCESS) |
822 #undef ACCESS | 824 #undef ACCESS |
823 | 825 |
824 } // namespace compiler | 826 } // namespace compiler |
825 } // namespace internal | 827 } // namespace internal |
826 } // namespace v8 | 828 } // namespace v8 |
OLD | NEW |