| 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/ic/ic-state.h" | 5 #include "src/ic/ic-state.h" |
| 6 | 6 |
| 7 #include "src/ic/ic.h" | 7 #include "src/ic/ic.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 HasFixedRightArgField::encode(fixed_right_arg_.IsJust()); | 54 HasFixedRightArgField::encode(fixed_right_arg_.IsJust()); |
| 55 if (fixed_right_arg_.IsJust()) { | 55 if (fixed_right_arg_.IsJust()) { |
| 56 extra_ic_state = FixedRightArgValueField::update( | 56 extra_ic_state = FixedRightArgValueField::update( |
| 57 extra_ic_state, WhichPowerOf2(fixed_right_arg_.FromJust())); | 57 extra_ic_state, WhichPowerOf2(fixed_right_arg_.FromJust())); |
| 58 } else { | 58 } else { |
| 59 extra_ic_state = RightKindField::update(extra_ic_state, right_kind_); | 59 extra_ic_state = RightKindField::update(extra_ic_state, right_kind_); |
| 60 } | 60 } |
| 61 return extra_ic_state; | 61 return extra_ic_state; |
| 62 } | 62 } |
| 63 | 63 |
| 64 std::string BinaryOpICState::ToString() const { |
| 65 std::string ret = "("; |
| 66 ret += Token::Name(op_); |
| 67 if (CouldCreateAllocationMementos()) ret += "_CreateAllocationMementos"; |
| 68 ret += ":"; |
| 69 ret += BinaryOpICState::KindToString(left_kind_); |
| 70 ret += "*"; |
| 71 if (fixed_right_arg_.IsJust()) { |
| 72 ret += fixed_right_arg_.FromJust(); |
| 73 } else { |
| 74 ret += BinaryOpICState::KindToString(right_kind_); |
| 75 } |
| 76 ret += "->"; |
| 77 ret += BinaryOpICState::KindToString(result_kind_); |
| 78 ret += ")"; |
| 79 return ret; |
| 80 } |
| 64 | 81 |
| 65 // static | 82 // static |
| 66 void BinaryOpICState::GenerateAheadOfTime( | 83 void BinaryOpICState::GenerateAheadOfTime( |
| 67 Isolate* isolate, void (*Generate)(Isolate*, const BinaryOpICState&)) { | 84 Isolate* isolate, void (*Generate)(Isolate*, const BinaryOpICState&)) { |
| 68 // TODO(olivf) We should investigate why adding stubs to the snapshot is so | 85 // TODO(olivf) We should investigate why adding stubs to the snapshot is so |
| 69 // expensive at runtime. When solved we should be able to add most binops to | 86 // expensive at runtime. When solved we should be able to add most binops to |
| 70 // the snapshot instead of hand-picking them. | 87 // the snapshot instead of hand-picking them. |
| 71 // Generated list of commonly used stubs | 88 // Generated list of commonly used stubs |
| 72 #define GENERATE(op, left_kind, right_kind, result_kind) \ | 89 #define GENERATE(op, left_kind, right_kind, result_kind) \ |
| 73 do { \ | 90 do { \ |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 case RECEIVER: | 522 case RECEIVER: |
| 506 case GENERIC: | 523 case GENERIC: |
| 507 return GENERIC; | 524 return GENERIC; |
| 508 } | 525 } |
| 509 UNREACHABLE(); | 526 UNREACHABLE(); |
| 510 return GENERIC; // Make the compiler happy. | 527 return GENERIC; // Make the compiler happy. |
| 511 } | 528 } |
| 512 | 529 |
| 513 } // namespace internal | 530 } // namespace internal |
| 514 } // namespace v8 | 531 } // namespace v8 |
| OLD | NEW |