OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1489 GETTER_CALL_RETURN, // Returning from a getter, need to restore context. | 1489 GETTER_CALL_RETURN, // Returning from a getter, need to restore context. |
1490 SETTER_CALL_RETURN // Use the RHS of the assignment as the return value. | 1490 SETTER_CALL_RETURN // Use the RHS of the assignment as the return value. |
1491 }; | 1491 }; |
1492 | 1492 |
1493 | 1493 |
1494 class HEnterInlined: public HTemplateInstruction<0> { | 1494 class HEnterInlined: public HTemplateInstruction<0> { |
1495 public: | 1495 public: |
1496 HEnterInlined(Handle<JSFunction> closure, | 1496 HEnterInlined(Handle<JSFunction> closure, |
1497 int arguments_count, | 1497 int arguments_count, |
1498 FunctionLiteral* function, | 1498 FunctionLiteral* function, |
1499 CallKind call_kind, | |
1500 InliningKind inlining_kind, | 1499 InliningKind inlining_kind, |
1501 Variable* arguments_var, | 1500 Variable* arguments_var, |
1502 ZoneList<HValue*>* arguments_values) | 1501 ZoneList<HValue*>* arguments_values, |
1502 bool undefined_receiver) | |
1503 : closure_(closure), | 1503 : closure_(closure), |
1504 arguments_count_(arguments_count), | 1504 arguments_count_(arguments_count), |
1505 arguments_pushed_(false), | 1505 arguments_pushed_(false), |
1506 function_(function), | 1506 function_(function), |
1507 call_kind_(call_kind), | |
1508 inlining_kind_(inlining_kind), | 1507 inlining_kind_(inlining_kind), |
1509 arguments_var_(arguments_var), | 1508 arguments_var_(arguments_var), |
1510 arguments_values_(arguments_values) { | 1509 arguments_values_(arguments_values), |
1510 undefined_receiver_(undefined_receiver) { | |
1511 } | 1511 } |
1512 | 1512 |
1513 virtual void PrintDataTo(StringStream* stream); | 1513 virtual void PrintDataTo(StringStream* stream); |
1514 | 1514 |
1515 Handle<JSFunction> closure() const { return closure_; } | 1515 Handle<JSFunction> closure() const { return closure_; } |
1516 int arguments_count() const { return arguments_count_; } | 1516 int arguments_count() const { return arguments_count_; } |
1517 bool arguments_pushed() const { return arguments_pushed_; } | 1517 bool arguments_pushed() const { return arguments_pushed_; } |
1518 void set_arguments_pushed() { arguments_pushed_ = true; } | 1518 void set_arguments_pushed() { arguments_pushed_ = true; } |
1519 FunctionLiteral* function() const { return function_; } | 1519 FunctionLiteral* function() const { return function_; } |
1520 CallKind call_kind() const { return call_kind_; } | |
1521 InliningKind inlining_kind() const { return inlining_kind_; } | 1520 InliningKind inlining_kind() const { return inlining_kind_; } |
1521 bool undefined_receiver() const { return undefined_receiver_; } | |
1522 | 1522 |
1523 virtual Representation RequiredInputRepresentation(int index) { | 1523 virtual Representation RequiredInputRepresentation(int index) { |
1524 return Representation::None(); | 1524 return Representation::None(); |
1525 } | 1525 } |
1526 | 1526 |
1527 Variable* arguments_var() { return arguments_var_; } | 1527 Variable* arguments_var() { return arguments_var_; } |
1528 ZoneList<HValue*>* arguments_values() { return arguments_values_; } | 1528 ZoneList<HValue*>* arguments_values() { return arguments_values_; } |
1529 | 1529 |
1530 DECLARE_CONCRETE_INSTRUCTION(EnterInlined) | 1530 DECLARE_CONCRETE_INSTRUCTION(EnterInlined) |
1531 | 1531 |
1532 private: | 1532 private: |
1533 Handle<JSFunction> closure_; | 1533 Handle<JSFunction> closure_; |
1534 int arguments_count_; | 1534 int arguments_count_; |
1535 bool arguments_pushed_; | 1535 bool arguments_pushed_; |
1536 FunctionLiteral* function_; | 1536 FunctionLiteral* function_; |
1537 CallKind call_kind_; | |
1538 InliningKind inlining_kind_; | 1537 InliningKind inlining_kind_; |
1539 Variable* arguments_var_; | 1538 Variable* arguments_var_; |
1540 ZoneList<HValue*>* arguments_values_; | 1539 ZoneList<HValue*>* arguments_values_; |
1540 bool undefined_receiver_; | |
1541 }; | 1541 }; |
1542 | 1542 |
1543 | 1543 |
1544 class HLeaveInlined: public HTemplateInstruction<0> { | 1544 class HLeaveInlined: public HTemplateInstruction<0> { |
1545 public: | 1545 public: |
1546 HLeaveInlined() { } | 1546 HLeaveInlined() { } |
1547 | 1547 |
1548 virtual Representation RequiredInputRepresentation(int index) { | 1548 virtual Representation RequiredInputRepresentation(int index) { |
1549 return Representation::None(); | 1549 return Representation::None(); |
1550 } | 1550 } |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2315 SmallMapList map_set_; | 2315 SmallMapList map_set_; |
2316 }; | 2316 }; |
2317 | 2317 |
2318 | 2318 |
2319 class HCheckFunction: public HUnaryOperation { | 2319 class HCheckFunction: public HUnaryOperation { |
2320 public: | 2320 public: |
2321 HCheckFunction(HValue* value, Handle<JSFunction> function) | 2321 HCheckFunction(HValue* value, Handle<JSFunction> function) |
2322 : HUnaryOperation(value), target_(function) { | 2322 : HUnaryOperation(value), target_(function) { |
2323 set_representation(Representation::Tagged()); | 2323 set_representation(Representation::Tagged()); |
2324 SetFlag(kUseGVN); | 2324 SetFlag(kUseGVN); |
2325 target_in_new_space_ = Isolate::Current()->heap()->InNewSpace(*function); | |
2325 } | 2326 } |
2326 | 2327 |
2327 virtual Representation RequiredInputRepresentation(int index) { | 2328 virtual Representation RequiredInputRepresentation(int index) { |
2328 return Representation::Tagged(); | 2329 return Representation::Tagged(); |
2329 } | 2330 } |
2330 virtual void PrintDataTo(StringStream* stream); | 2331 virtual void PrintDataTo(StringStream* stream); |
2331 virtual HType CalculateInferredType(); | 2332 virtual HType CalculateInferredType(); |
2332 | 2333 |
2333 #ifdef DEBUG | 2334 #ifdef DEBUG |
2334 virtual void Verify(); | 2335 virtual void Verify(); |
2335 #endif | 2336 #endif |
2336 | 2337 |
2337 Handle<JSFunction> target() const { return target_; } | 2338 Handle<JSFunction> target() const { return target_; } |
2339 bool target_in_new_space() const { return target_in_new_space_; } | |
2338 | 2340 |
2339 DECLARE_CONCRETE_INSTRUCTION(CheckFunction) | 2341 DECLARE_CONCRETE_INSTRUCTION(CheckFunction) |
2340 | 2342 |
2341 protected: | 2343 protected: |
2342 virtual bool DataEquals(HValue* other) { | 2344 virtual bool DataEquals(HValue* other) { |
2343 HCheckFunction* b = HCheckFunction::cast(other); | 2345 HCheckFunction* b = HCheckFunction::cast(other); |
2344 return target_.is_identical_to(b->target()); | 2346 return target_.is_identical_to(b->target()); |
2345 } | 2347 } |
2346 | 2348 |
2347 private: | 2349 private: |
2348 Handle<JSFunction> target_; | 2350 Handle<JSFunction> target_; |
2351 bool target_in_new_space_; | |
2349 }; | 2352 }; |
2350 | 2353 |
2351 | 2354 |
2352 class HCheckInstanceType: public HUnaryOperation { | 2355 class HCheckInstanceType: public HUnaryOperation { |
2353 public: | 2356 public: |
2354 static HCheckInstanceType* NewIsSpecObject(HValue* value, Zone* zone) { | 2357 static HCheckInstanceType* NewIsSpecObject(HValue* value, Zone* zone) { |
2355 return new(zone) HCheckInstanceType(value, IS_SPEC_OBJECT); | 2358 return new(zone) HCheckInstanceType(value, IS_SPEC_OBJECT); |
2356 } | 2359 } |
2357 static HCheckInstanceType* NewIsJSArray(HValue* value, Zone* zone) { | 2360 static HCheckInstanceType* NewIsJSArray(HValue* value, Zone* zone) { |
2358 return new(zone) HCheckInstanceType(value, IS_JS_ARRAY); | 2361 return new(zone) HCheckInstanceType(value, IS_JS_ARRAY); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2470 virtual Representation RequiredInputRepresentation(int index) { | 2473 virtual Representation RequiredInputRepresentation(int index) { |
2471 return Representation::None(); | 2474 return Representation::None(); |
2472 } | 2475 } |
2473 | 2476 |
2474 virtual void PrintDataTo(StringStream* stream); | 2477 virtual void PrintDataTo(StringStream* stream); |
2475 | 2478 |
2476 virtual intptr_t Hashcode() { | 2479 virtual intptr_t Hashcode() { |
2477 ASSERT_ALLOCATION_DISABLED; | 2480 ASSERT_ALLOCATION_DISABLED; |
2478 intptr_t hash = 0; | 2481 intptr_t hash = 0; |
2479 for (int i = 0; i < prototypes_.length(); i++) { | 2482 for (int i = 0; i < prototypes_.length(); i++) { |
2480 hash = 17 * hash + reinterpret_cast<intptr_t>(*prototypes_[i]); | 2483 hash = 17 * hash + reinterpret_cast<intptr_t>(*prototypes_[i].location()); |
2481 hash = 17 * hash + reinterpret_cast<intptr_t>(*maps_[i]); | 2484 hash = 17 * hash + reinterpret_cast<intptr_t>(*maps_[i].location()); |
2482 } | 2485 } |
2483 return hash; | 2486 return hash; |
2484 } | 2487 } |
2485 | 2488 |
2486 protected: | 2489 protected: |
2487 virtual bool DataEquals(HValue* other) { | 2490 virtual bool DataEquals(HValue* other) { |
2488 HCheckPrototypeMaps* b = HCheckPrototypeMaps::cast(other); | 2491 HCheckPrototypeMaps* b = HCheckPrototypeMaps::cast(other); |
2489 #ifdef DEBUG | 2492 #ifdef DEBUG |
2490 if (prototypes_.length() != b->prototypes()->length()) return false; | 2493 if (prototypes_.length() != b->prototypes()->length()) return false; |
2491 for (int i = 0; i < prototypes_.length(); i++) { | 2494 for (int i = 0; i < prototypes_.length(); i++) { |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2658 private: | 2661 private: |
2659 virtual bool IsDeletable() const { return true; } | 2662 virtual bool IsDeletable() const { return true; } |
2660 }; | 2663 }; |
2661 | 2664 |
2662 | 2665 |
2663 class HConstant: public HTemplateInstruction<0> { | 2666 class HConstant: public HTemplateInstruction<0> { |
2664 public: | 2667 public: |
2665 HConstant(Handle<Object> handle, Representation r); | 2668 HConstant(Handle<Object> handle, Representation r); |
2666 HConstant(int32_t value, Representation r); | 2669 HConstant(int32_t value, Representation r); |
2667 HConstant(double value, Representation r); | 2670 HConstant(double value, Representation r); |
2671 // HConstant(const HConstant&); | |
Jakob Kummerow
2013/01/23 12:09:18
what's this?
Yang
2013/01/23 13:34:25
stray edit. gone now.
| |
2668 | 2672 |
2669 Handle<Object> handle() { | 2673 Handle<Object> handle() { |
2670 if (handle_.is_null()) { | 2674 if (handle_.is_null()) { |
2671 handle_ = FACTORY->NewNumber(double_value_, TENURED); | 2675 handle_ = FACTORY->NewNumber(double_value_, TENURED); |
2672 } | 2676 } |
2673 ASSERT(has_int32_value_ || !handle_->IsSmi()); | 2677 ASSERT(has_int32_value_ || !handle_->IsSmi()); |
2674 return handle_; | 2678 return handle_; |
2675 } | 2679 } |
2676 | 2680 |
2677 bool InOldSpace() const { return !HEAP->InNewSpace(*handle_); } | 2681 bool InOldSpace() const { return !HEAP->InNewSpace(*handle_); } |
2678 | 2682 |
2679 bool ImmortalImmovable() const { | 2683 bool ImmortalImmovable() const { |
2680 if (has_int32_value_) { | 2684 if (has_int32_value_) { |
2681 return false; | 2685 return false; |
2682 } | 2686 } |
2683 if (has_double_value_) { | 2687 if (has_double_value_) { |
2684 if (BitCast<int64_t>(double_value_) == BitCast<int64_t>(-0.0) || | 2688 if (BitCast<int64_t>(double_value_) == BitCast<int64_t>(-0.0) || |
2685 isnan(double_value_)) { | 2689 isnan(double_value_)) { |
2686 return true; | 2690 return true; |
2687 } | 2691 } |
2688 return false; | 2692 return false; |
2689 } | 2693 } |
2690 | 2694 |
2691 ASSERT(!handle_.is_null()); | 2695 ASSERT(!handle_.is_null()); |
2692 Heap* heap = HEAP; | 2696 Heap* heap = HEAP; |
2693 // We should have handled minus_zero_value and nan_value in the | 2697 // We should have handled minus_zero_value and nan_value in the |
2694 // has_double_value_ clause above. | 2698 // has_double_value_ clause above. |
2695 ASSERT(*handle_ != heap->minus_zero_value()); | 2699 ASSERT(*handle_.location() != Object::cast(heap->minus_zero_value())); |
2696 ASSERT(*handle_ != heap->nan_value()); | 2700 ASSERT(*handle_.location() != Object::cast(heap->nan_value())); |
2697 if (*handle_ == heap->undefined_value()) return true; | 2701 if (*handle_.location() == Object::cast(heap->undefined_value()) || |
Jakob Kummerow
2013/01/23 12:09:18
"if (a || b) {return true;} return false;" is kind
Yang
2013/01/23 13:34:25
completely overlooked this. done.
| |
2698 if (*handle_ == heap->null_value()) return true; | 2702 *handle_.location() == Object::cast(heap->null_value()) || |
2699 if (*handle_ == heap->true_value()) return true; | 2703 *handle_.location() == Object::cast(heap->true_value()) || |
2700 if (*handle_ == heap->false_value()) return true; | 2704 *handle_.location() == Object::cast(heap->false_value()) || |
2701 if (*handle_ == heap->the_hole_value()) return true; | 2705 *handle_.location() == Object::cast(heap->the_hole_value()) || |
2702 if (*handle_ == heap->empty_string()) return true; | 2706 *handle_.location() == Object::cast(heap->empty_string())) { |
2707 return true; | |
2708 } | |
2703 return false; | 2709 return false; |
2704 } | 2710 } |
2705 | 2711 |
2706 virtual Representation RequiredInputRepresentation(int index) { | 2712 virtual Representation RequiredInputRepresentation(int index) { |
2707 return Representation::None(); | 2713 return Representation::None(); |
2708 } | 2714 } |
2709 | 2715 |
2710 virtual bool IsConvertibleToInteger() const { | 2716 virtual bool IsConvertibleToInteger() const { |
2711 return has_int32_value_; | 2717 return has_int32_value_; |
2712 } | 2718 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2745 virtual intptr_t Hashcode() { | 2751 virtual intptr_t Hashcode() { |
2746 ASSERT_ALLOCATION_DISABLED; | 2752 ASSERT_ALLOCATION_DISABLED; |
2747 intptr_t hash; | 2753 intptr_t hash; |
2748 | 2754 |
2749 if (has_int32_value_) { | 2755 if (has_int32_value_) { |
2750 hash = static_cast<intptr_t>(int32_value_); | 2756 hash = static_cast<intptr_t>(int32_value_); |
2751 } else if (has_double_value_) { | 2757 } else if (has_double_value_) { |
2752 hash = static_cast<intptr_t>(BitCast<int64_t>(double_value_)); | 2758 hash = static_cast<intptr_t>(BitCast<int64_t>(double_value_)); |
2753 } else { | 2759 } else { |
2754 ASSERT(!handle_.is_null()); | 2760 ASSERT(!handle_.is_null()); |
2755 hash = reinterpret_cast<intptr_t>(*handle_); | 2761 hash = reinterpret_cast<intptr_t>(*handle_.location()); |
Jakob Kummerow
2013/01/23 12:09:18
So, dereferencing the handle is not allowed, but d
Yang
2013/01/23 13:34:25
like we discussed offline, I added the guard to lo
| |
2756 } | 2762 } |
2757 | 2763 |
2758 return hash; | 2764 return hash; |
2759 } | 2765 } |
2760 | 2766 |
2761 #ifdef DEBUG | 2767 #ifdef DEBUG |
2762 virtual void Verify() { } | 2768 virtual void Verify() { } |
2763 #endif | 2769 #endif |
2764 | 2770 |
2765 DECLARE_CONCRETE_INSTRUCTION(Constant) | 2771 DECLARE_CONCRETE_INSTRUCTION(Constant) |
2766 | 2772 |
2767 protected: | 2773 protected: |
2768 virtual Range* InferRange(Zone* zone); | 2774 virtual Range* InferRange(Zone* zone); |
2769 | 2775 |
2770 virtual bool DataEquals(HValue* other) { | 2776 virtual bool DataEquals(HValue* other) { |
2771 HConstant* other_constant = HConstant::cast(other); | 2777 HConstant* other_constant = HConstant::cast(other); |
2772 if (has_int32_value_) { | 2778 if (has_int32_value_) { |
2773 return other_constant->has_int32_value_ && | 2779 return other_constant->has_int32_value_ && |
2774 int32_value_ == other_constant->int32_value_; | 2780 int32_value_ == other_constant->int32_value_; |
2775 } else if (has_double_value_) { | 2781 } else if (has_double_value_) { |
2776 return other_constant->has_double_value_ && | 2782 return other_constant->has_double_value_ && |
2777 BitCast<int64_t>(double_value_) == | 2783 BitCast<int64_t>(double_value_) == |
2778 BitCast<int64_t>(other_constant->double_value_); | 2784 BitCast<int64_t>(other_constant->double_value_); |
2779 } else { | 2785 } else { |
2780 ASSERT(!handle_.is_null()); | 2786 ASSERT(!handle_.is_null()); |
2781 return !other_constant->handle_.is_null() && | 2787 return !other_constant->handle_.is_null() && |
2782 *handle_ == *other_constant->handle_; | 2788 handle_.is_identical_to(other_constant->handle_); |
2783 } | 2789 } |
2784 } | 2790 } |
2785 | 2791 |
2786 private: | 2792 private: |
2787 virtual bool IsDeletable() const { return true; } | 2793 virtual bool IsDeletable() const { return true; } |
2788 | 2794 |
2789 // If this is a numerical constant, handle_ either points to to the | 2795 // If this is a numerical constant, handle_ either points to to the |
2790 // HeapObject the constant originated from or is null. If the | 2796 // HeapObject the constant originated from or is null. If the |
2791 // constant is non-numeric, handle_ always points to a valid | 2797 // constant is non-numeric, handle_ always points to a valid |
2792 // constant HeapObject. | 2798 // constant HeapObject. |
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4006 | 4012 |
4007 class HLoadGlobalCell: public HTemplateInstruction<0> { | 4013 class HLoadGlobalCell: public HTemplateInstruction<0> { |
4008 public: | 4014 public: |
4009 HLoadGlobalCell(Handle<JSGlobalPropertyCell> cell, PropertyDetails details) | 4015 HLoadGlobalCell(Handle<JSGlobalPropertyCell> cell, PropertyDetails details) |
4010 : cell_(cell), details_(details) { | 4016 : cell_(cell), details_(details) { |
4011 set_representation(Representation::Tagged()); | 4017 set_representation(Representation::Tagged()); |
4012 SetFlag(kUseGVN); | 4018 SetFlag(kUseGVN); |
4013 SetGVNFlag(kDependsOnGlobalVars); | 4019 SetGVNFlag(kDependsOnGlobalVars); |
4014 } | 4020 } |
4015 | 4021 |
4016 Handle<JSGlobalPropertyCell> cell() const { return cell_; } | 4022 Handle<JSGlobalPropertyCell> cell() const { return cell_; } |
4017 bool RequiresHoleCheck() const; | 4023 bool RequiresHoleCheck() const; |
4018 | 4024 |
4019 virtual void PrintDataTo(StringStream* stream); | 4025 virtual void PrintDataTo(StringStream* stream); |
4020 | 4026 |
4021 virtual intptr_t Hashcode() { | 4027 virtual intptr_t Hashcode() { |
4022 ASSERT_ALLOCATION_DISABLED; | 4028 ASSERT_ALLOCATION_DISABLED; |
4023 return reinterpret_cast<intptr_t>(*cell_); | 4029 return reinterpret_cast<intptr_t>(*cell_.location()); |
4024 } | 4030 } |
4025 | 4031 |
4026 virtual Representation RequiredInputRepresentation(int index) { | 4032 virtual Representation RequiredInputRepresentation(int index) { |
4027 return Representation::None(); | 4033 return Representation::None(); |
4028 } | 4034 } |
4029 | 4035 |
4030 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell) | 4036 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell) |
4031 | 4037 |
4032 protected: | 4038 protected: |
4033 virtual bool DataEquals(HValue* other) { | 4039 virtual bool DataEquals(HValue* other) { |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4805 StrictModeFlag strict_mode_flag_; | 4811 StrictModeFlag strict_mode_flag_; |
4806 }; | 4812 }; |
4807 | 4813 |
4808 | 4814 |
4809 class HTransitionElementsKind: public HTemplateInstruction<1> { | 4815 class HTransitionElementsKind: public HTemplateInstruction<1> { |
4810 public: | 4816 public: |
4811 HTransitionElementsKind(HValue* object, | 4817 HTransitionElementsKind(HValue* object, |
4812 Handle<Map> original_map, | 4818 Handle<Map> original_map, |
4813 Handle<Map> transitioned_map) | 4819 Handle<Map> transitioned_map) |
4814 : original_map_(original_map), | 4820 : original_map_(original_map), |
4815 transitioned_map_(transitioned_map) { | 4821 transitioned_map_(transitioned_map), |
4822 from_kind_(original_map->elements_kind()), | |
4823 to_kind_(transitioned_map->elements_kind()) { | |
4816 SetOperandAt(0, object); | 4824 SetOperandAt(0, object); |
4817 SetFlag(kUseGVN); | 4825 SetFlag(kUseGVN); |
4818 SetGVNFlag(kChangesElementsKind); | 4826 SetGVNFlag(kChangesElementsKind); |
4819 if (original_map->has_fast_double_elements()) { | 4827 if (original_map->has_fast_double_elements()) { |
4820 SetGVNFlag(kChangesElementsPointer); | 4828 SetGVNFlag(kChangesElementsPointer); |
4821 SetGVNFlag(kChangesNewSpacePromotion); | 4829 SetGVNFlag(kChangesNewSpacePromotion); |
4822 } | 4830 } |
4823 if (transitioned_map->has_fast_double_elements()) { | 4831 if (transitioned_map->has_fast_double_elements()) { |
4824 SetGVNFlag(kChangesElementsPointer); | 4832 SetGVNFlag(kChangesElementsPointer); |
4825 SetGVNFlag(kChangesNewSpacePromotion); | 4833 SetGVNFlag(kChangesNewSpacePromotion); |
4826 } | 4834 } |
4827 set_representation(Representation::Tagged()); | 4835 set_representation(Representation::Tagged()); |
4828 } | 4836 } |
4829 | 4837 |
4830 virtual Representation RequiredInputRepresentation(int index) { | 4838 virtual Representation RequiredInputRepresentation(int index) { |
4831 return Representation::Tagged(); | 4839 return Representation::Tagged(); |
4832 } | 4840 } |
4833 | 4841 |
4834 HValue* object() { return OperandAt(0); } | 4842 HValue* object() { return OperandAt(0); } |
4835 Handle<Map> original_map() { return original_map_; } | 4843 Handle<Map> original_map() { return original_map_; } |
4836 Handle<Map> transitioned_map() { return transitioned_map_; } | 4844 Handle<Map> transitioned_map() { return transitioned_map_; } |
4845 ElementsKind from_kind() { return from_kind_; } | |
4846 ElementsKind to_kind() { return to_kind_; } | |
4837 | 4847 |
4838 virtual void PrintDataTo(StringStream* stream); | 4848 virtual void PrintDataTo(StringStream* stream); |
4839 | 4849 |
4840 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind) | 4850 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind) |
4841 | 4851 |
4842 protected: | 4852 protected: |
4843 virtual bool DataEquals(HValue* other) { | 4853 virtual bool DataEquals(HValue* other) { |
4844 HTransitionElementsKind* instr = HTransitionElementsKind::cast(other); | 4854 HTransitionElementsKind* instr = HTransitionElementsKind::cast(other); |
4845 return original_map_.is_identical_to(instr->original_map()) && | 4855 return original_map_.is_identical_to(instr->original_map()) && |
4846 transitioned_map_.is_identical_to(instr->transitioned_map()); | 4856 transitioned_map_.is_identical_to(instr->transitioned_map()); |
4847 } | 4857 } |
4848 | 4858 |
4849 private: | 4859 private: |
4850 Handle<Map> original_map_; | 4860 Handle<Map> original_map_; |
4851 Handle<Map> transitioned_map_; | 4861 Handle<Map> transitioned_map_; |
4862 ElementsKind from_kind_; | |
4863 ElementsKind to_kind_; | |
4852 }; | 4864 }; |
4853 | 4865 |
4854 | 4866 |
4855 class HStringAdd: public HBinaryOperation { | 4867 class HStringAdd: public HBinaryOperation { |
4856 public: | 4868 public: |
4857 HStringAdd(HValue* context, HValue* left, HValue* right) | 4869 HStringAdd(HValue* context, HValue* left, HValue* right) |
4858 : HBinaryOperation(context, left, right) { | 4870 : HBinaryOperation(context, left, right) { |
4859 set_representation(Representation::Tagged()); | 4871 set_representation(Representation::Tagged()); |
4860 SetFlag(kUseGVN); | 4872 SetFlag(kUseGVN); |
4861 SetGVNFlag(kDependsOnMaps); | 4873 SetGVNFlag(kDependsOnMaps); |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5503 virtual bool IsDeletable() const { return true; } | 5515 virtual bool IsDeletable() const { return true; } |
5504 }; | 5516 }; |
5505 | 5517 |
5506 | 5518 |
5507 #undef DECLARE_INSTRUCTION | 5519 #undef DECLARE_INSTRUCTION |
5508 #undef DECLARE_CONCRETE_INSTRUCTION | 5520 #undef DECLARE_CONCRETE_INSTRUCTION |
5509 | 5521 |
5510 } } // namespace v8::internal | 5522 } } // namespace v8::internal |
5511 | 5523 |
5512 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 5524 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |