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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 V(CompareObjectEqAndBranch) \ | 102 V(CompareObjectEqAndBranch) \ |
103 V(CompareMap) \ | 103 V(CompareMap) \ |
104 V(Constant) \ | 104 V(Constant) \ |
105 V(Context) \ | 105 V(Context) \ |
106 V(DateField) \ | 106 V(DateField) \ |
107 V(DebugBreak) \ | 107 V(DebugBreak) \ |
108 V(DeclareGlobals) \ | 108 V(DeclareGlobals) \ |
109 V(Deoptimize) \ | 109 V(Deoptimize) \ |
110 V(Div) \ | 110 V(Div) \ |
111 V(DummyUse) \ | 111 V(DummyUse) \ |
112 V(ElementsKind) \ | |
113 V(EnterInlined) \ | 112 V(EnterInlined) \ |
114 V(EnvironmentMarker) \ | 113 V(EnvironmentMarker) \ |
115 V(ForceRepresentation) \ | 114 V(ForceRepresentation) \ |
116 V(ForInCacheArray) \ | 115 V(ForInCacheArray) \ |
117 V(ForInPrepareMap) \ | 116 V(ForInPrepareMap) \ |
118 V(FunctionLiteral) \ | 117 V(FunctionLiteral) \ |
119 V(GetCachedArrayIndex) \ | 118 V(GetCachedArrayIndex) \ |
120 V(Goto) \ | 119 V(Goto) \ |
121 V(HasCachedArrayIndexAndBranch) \ | 120 V(HasCachedArrayIndexAndBranch) \ |
122 V(HasInstanceTypeAndBranch) \ | 121 V(HasInstanceTypeAndBranch) \ |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 V(StoreKeyed) \ | 164 V(StoreKeyed) \ |
166 V(StoreKeyedGeneric) \ | 165 V(StoreKeyedGeneric) \ |
167 V(StoreNamedField) \ | 166 V(StoreNamedField) \ |
168 V(StoreNamedGeneric) \ | 167 V(StoreNamedGeneric) \ |
169 V(StringAdd) \ | 168 V(StringAdd) \ |
170 V(StringCharCodeAt) \ | 169 V(StringCharCodeAt) \ |
171 V(StringCharFromCode) \ | 170 V(StringCharFromCode) \ |
172 V(StringCompareAndBranch) \ | 171 V(StringCompareAndBranch) \ |
173 V(Sub) \ | 172 V(Sub) \ |
174 V(ThisFunction) \ | 173 V(ThisFunction) \ |
175 V(Throw) \ | |
176 V(ToFastProperties) \ | 174 V(ToFastProperties) \ |
177 V(TransitionElementsKind) \ | 175 V(TransitionElementsKind) \ |
178 V(TrapAllocationMemento) \ | 176 V(TrapAllocationMemento) \ |
179 V(Typeof) \ | 177 V(Typeof) \ |
180 V(TypeofIsAndBranch) \ | 178 V(TypeofIsAndBranch) \ |
181 V(UnaryMathOperation) \ | 179 V(UnaryMathOperation) \ |
182 V(UnknownOSRValue) \ | 180 V(UnknownOSRValue) \ |
183 V(UseConst) \ | 181 V(UseConst) \ |
184 V(ValueOf) \ | |
185 V(WrapReceiver) | 182 V(WrapReceiver) |
186 | 183 |
187 #define GVN_TRACKED_FLAG_LIST(V) \ | 184 #define GVN_TRACKED_FLAG_LIST(V) \ |
188 V(Maps) \ | 185 V(Maps) \ |
189 V(NewSpacePromotion) | 186 V(NewSpacePromotion) |
190 | 187 |
191 #define GVN_UNTRACKED_FLAG_LIST(V) \ | 188 #define GVN_UNTRACKED_FLAG_LIST(V) \ |
192 V(ArrayElements) \ | 189 V(ArrayElements) \ |
193 V(ArrayLengths) \ | 190 V(ArrayLengths) \ |
194 V(StringLengths) \ | 191 V(StringLengths) \ |
(...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1635 | 1632 |
1636 static HUnaryOperation* cast(HValue* value) { | 1633 static HUnaryOperation* cast(HValue* value) { |
1637 return reinterpret_cast<HUnaryOperation*>(value); | 1634 return reinterpret_cast<HUnaryOperation*>(value); |
1638 } | 1635 } |
1639 | 1636 |
1640 HValue* value() const { return OperandAt(0); } | 1637 HValue* value() const { return OperandAt(0); } |
1641 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1638 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
1642 }; | 1639 }; |
1643 | 1640 |
1644 | 1641 |
1645 class HThrow V8_FINAL : public HTemplateInstruction<2> { | |
1646 public: | |
1647 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HThrow, HValue*); | |
1648 | |
1649 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | |
1650 return Representation::Tagged(); | |
1651 } | |
1652 | |
1653 HValue* context() { return OperandAt(0); } | |
1654 HValue* value() { return OperandAt(1); } | |
1655 | |
1656 DECLARE_CONCRETE_INSTRUCTION(Throw) | |
1657 | |
1658 private: | |
1659 HThrow(HValue* context, HValue* value) { | |
1660 SetOperandAt(0, context); | |
1661 SetOperandAt(1, value); | |
1662 SetAllSideEffects(); | |
1663 } | |
1664 }; | |
1665 | |
1666 | |
1667 class HUseConst V8_FINAL : public HUnaryOperation { | 1642 class HUseConst V8_FINAL : public HUnaryOperation { |
1668 public: | 1643 public: |
1669 DECLARE_INSTRUCTION_FACTORY_P1(HUseConst, HValue*); | 1644 DECLARE_INSTRUCTION_FACTORY_P1(HUseConst, HValue*); |
1670 | 1645 |
1671 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 1646 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
1672 return Representation::None(); | 1647 return Representation::None(); |
1673 } | 1648 } |
1674 | 1649 |
1675 DECLARE_CONCRETE_INSTRUCTION(UseConst) | 1650 DECLARE_CONCRETE_INSTRUCTION(UseConst) |
1676 | 1651 |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1973 HStackCheck(HValue* context, Type type) : type_(type) { | 1948 HStackCheck(HValue* context, Type type) : type_(type) { |
1974 SetOperandAt(0, context); | 1949 SetOperandAt(0, context); |
1975 SetGVNFlag(kChangesNewSpacePromotion); | 1950 SetGVNFlag(kChangesNewSpacePromotion); |
1976 } | 1951 } |
1977 | 1952 |
1978 Type type_; | 1953 Type type_; |
1979 }; | 1954 }; |
1980 | 1955 |
1981 | 1956 |
1982 enum InliningKind { | 1957 enum InliningKind { |
1983 NORMAL_RETURN, // Normal function/method call and return. | 1958 NORMAL_RETURN, // Drop the function from the environment on return. |
1984 DROP_EXTRA_ON_RETURN, // Drop an extra value from the environment on return. | |
1985 CONSTRUCT_CALL_RETURN, // Either use allocated receiver or return value. | 1959 CONSTRUCT_CALL_RETURN, // Either use allocated receiver or return value. |
1986 GETTER_CALL_RETURN, // Returning from a getter, need to restore context. | 1960 GETTER_CALL_RETURN, // Returning from a getter, need to restore context. |
1987 SETTER_CALL_RETURN // Use the RHS of the assignment as the return value. | 1961 SETTER_CALL_RETURN // Use the RHS of the assignment as the return value. |
1988 }; | 1962 }; |
1989 | 1963 |
1990 | 1964 |
1991 class HArgumentsObject; | 1965 class HArgumentsObject; |
1992 | 1966 |
1993 | 1967 |
1994 class HEnterInlined V8_FINAL : public HTemplateInstruction<0> { | 1968 class HEnterInlined V8_FINAL : public HTemplateInstruction<0> { |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2391 : HBinaryCall(context, function, argument_count), | 2365 : HBinaryCall(context, function, argument_count), |
2392 has_stack_check_(false) { | 2366 has_stack_check_(false) { |
2393 } | 2367 } |
2394 | 2368 |
2395 Handle<JSFunction> known_function_; | 2369 Handle<JSFunction> known_function_; |
2396 int formal_parameter_count_; | 2370 int formal_parameter_count_; |
2397 bool has_stack_check_; | 2371 bool has_stack_check_; |
2398 }; | 2372 }; |
2399 | 2373 |
2400 | 2374 |
2401 enum CallMode { | |
2402 NORMAL_CALL, | |
2403 TAIL_CALL, | |
2404 NORMAL_CONTEXTUAL_CALL | |
2405 }; | |
2406 | |
2407 | |
2408 class HCallFunction V8_FINAL : public HBinaryCall { | 2375 class HCallFunction V8_FINAL : public HBinaryCall { |
2409 public: | 2376 public: |
2410 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HCallFunction, HValue*, int); | 2377 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HCallFunction, HValue*, int); |
2411 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3( | 2378 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3( |
2412 HCallFunction, HValue*, int, CallMode); | 2379 HCallFunction, HValue*, int, CallFunctionFlags); |
2413 | 2380 |
2414 bool IsTailCall() const { return call_mode_ == TAIL_CALL; } | |
2415 bool IsContextualCall() const { return call_mode_ == NORMAL_CONTEXTUAL_CALL; } | |
2416 HValue* context() { return first(); } | 2381 HValue* context() { return first(); } |
2417 HValue* function() { return second(); } | 2382 HValue* function() { return second(); } |
| 2383 CallFunctionFlags function_flags() const { return function_flags_; } |
2418 | 2384 |
2419 DECLARE_CONCRETE_INSTRUCTION(CallFunction) | 2385 DECLARE_CONCRETE_INSTRUCTION(CallFunction) |
2420 | 2386 |
2421 virtual int argument_delta() const V8_OVERRIDE { | 2387 virtual int argument_delta() const V8_OVERRIDE { return -argument_count(); } |
2422 if (IsTailCall()) return 0; | |
2423 return -argument_count(); | |
2424 } | |
2425 | 2388 |
2426 private: | 2389 private: |
2427 HCallFunction(HValue* context, | 2390 HCallFunction(HValue* context, |
2428 HValue* function, | 2391 HValue* function, |
2429 int argument_count, | 2392 int argument_count, |
2430 CallMode mode = NORMAL_CALL) | 2393 CallFunctionFlags flags = NO_CALL_FUNCTION_FLAGS) |
2431 : HBinaryCall(context, function, argument_count), call_mode_(mode) { | 2394 : HBinaryCall(context, function, argument_count), function_flags_(flags) { |
2432 } | 2395 } |
2433 CallMode call_mode_; | 2396 CallFunctionFlags function_flags_; |
2434 }; | 2397 }; |
2435 | 2398 |
2436 | 2399 |
2437 class HCallNew V8_FINAL : public HBinaryCall { | 2400 class HCallNew V8_FINAL : public HBinaryCall { |
2438 public: | 2401 public: |
2439 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HCallNew, HValue*, int); | 2402 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HCallNew, HValue*, int); |
2440 | 2403 |
2441 HValue* context() { return first(); } | 2404 HValue* context() { return first(); } |
2442 HValue* constructor() { return second(); } | 2405 HValue* constructor() { return second(); } |
2443 | 2406 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2532 : HUnaryOperation(value, HType::Smi()) { | 2495 : HUnaryOperation(value, HType::Smi()) { |
2533 set_representation(Representation::Smi()); | 2496 set_representation(Representation::Smi()); |
2534 SetFlag(kUseGVN); | 2497 SetFlag(kUseGVN); |
2535 SetGVNFlag(kDependsOnMaps); | 2498 SetGVNFlag(kDependsOnMaps); |
2536 } | 2499 } |
2537 | 2500 |
2538 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 2501 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
2539 }; | 2502 }; |
2540 | 2503 |
2541 | 2504 |
2542 class HElementsKind V8_FINAL : public HUnaryOperation { | |
2543 public: | |
2544 explicit HElementsKind(HValue* value) : HUnaryOperation(value) { | |
2545 set_representation(Representation::Integer32()); | |
2546 SetFlag(kUseGVN); | |
2547 SetGVNFlag(kDependsOnElementsKind); | |
2548 } | |
2549 | |
2550 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | |
2551 return Representation::Tagged(); | |
2552 } | |
2553 | |
2554 DECLARE_CONCRETE_INSTRUCTION(ElementsKind) | |
2555 | |
2556 protected: | |
2557 virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; } | |
2558 | |
2559 private: | |
2560 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | |
2561 }; | |
2562 | |
2563 | |
2564 class HUnaryMathOperation V8_FINAL : public HTemplateInstruction<2> { | 2505 class HUnaryMathOperation V8_FINAL : public HTemplateInstruction<2> { |
2565 public: | 2506 public: |
2566 static HInstruction* New(Zone* zone, | 2507 static HInstruction* New(Zone* zone, |
2567 HValue* context, | 2508 HValue* context, |
2568 HValue* value, | 2509 HValue* value, |
2569 BuiltinFunctionId op); | 2510 BuiltinFunctionId op); |
2570 | 2511 |
2571 HValue* context() { return OperandAt(0); } | 2512 HValue* context() { return OperandAt(0); } |
2572 HValue* value() { return OperandAt(1); } | 2513 HValue* value() { return OperandAt(1); } |
2573 | 2514 |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3430 return has_double_value_ && | 3371 return has_double_value_ && |
3431 (BitCast<int64_t>(double_value_) == BitCast<int64_t>(-0.0) || | 3372 (BitCast<int64_t>(double_value_) == BitCast<int64_t>(-0.0) || |
3432 FixedDoubleArray::is_the_hole_nan(double_value_) || | 3373 FixedDoubleArray::is_the_hole_nan(double_value_) || |
3433 std::isnan(double_value_)); | 3374 std::isnan(double_value_)); |
3434 } | 3375 } |
3435 | 3376 |
3436 bool NotInNewSpace() const { | 3377 bool NotInNewSpace() const { |
3437 return is_not_in_new_space_; | 3378 return is_not_in_new_space_; |
3438 } | 3379 } |
3439 | 3380 |
3440 bool ImmortalImmovable() const { | 3381 bool ImmortalImmovable() const; |
3441 if (has_int32_value_) { | |
3442 return false; | |
3443 } | |
3444 if (has_double_value_) { | |
3445 if (IsSpecialDouble()) { | |
3446 return true; | |
3447 } | |
3448 return false; | |
3449 } | |
3450 if (has_external_reference_value_) { | |
3451 return false; | |
3452 } | |
3453 | |
3454 ASSERT(!object_.handle().is_null()); | |
3455 Heap* heap = isolate()->heap(); | |
3456 ASSERT(!object_.IsKnownGlobal(heap->minus_zero_value())); | |
3457 ASSERT(!object_.IsKnownGlobal(heap->nan_value())); | |
3458 return | |
3459 object_.IsKnownGlobal(heap->undefined_value()) || | |
3460 object_.IsKnownGlobal(heap->null_value()) || | |
3461 object_.IsKnownGlobal(heap->true_value()) || | |
3462 object_.IsKnownGlobal(heap->false_value()) || | |
3463 object_.IsKnownGlobal(heap->the_hole_value()) || | |
3464 object_.IsKnownGlobal(heap->empty_string()) || | |
3465 object_.IsKnownGlobal(heap->empty_fixed_array()); | |
3466 } | |
3467 | 3382 |
3468 bool IsCell() const { | 3383 bool IsCell() const { |
3469 return is_cell_; | 3384 return is_cell_; |
3470 } | 3385 } |
3471 | 3386 |
3472 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 3387 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
3473 return Representation::None(); | 3388 return Representation::None(); |
3474 } | 3389 } |
3475 | 3390 |
3476 virtual Representation KnownOptimalRepresentation() V8_OVERRIDE { | 3391 virtual Representation KnownOptimalRepresentation() V8_OVERRIDE { |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3731 | 3646 |
3732 Representation observed_input_representation_[2]; | 3647 Representation observed_input_representation_[2]; |
3733 Representation observed_output_representation_; | 3648 Representation observed_output_representation_; |
3734 }; | 3649 }; |
3735 | 3650 |
3736 | 3651 |
3737 class HWrapReceiver V8_FINAL : public HTemplateInstruction<2> { | 3652 class HWrapReceiver V8_FINAL : public HTemplateInstruction<2> { |
3738 public: | 3653 public: |
3739 DECLARE_INSTRUCTION_FACTORY_P2(HWrapReceiver, HValue*, HValue*); | 3654 DECLARE_INSTRUCTION_FACTORY_P2(HWrapReceiver, HValue*, HValue*); |
3740 | 3655 |
| 3656 virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; } |
| 3657 |
3741 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 3658 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
3742 return Representation::Tagged(); | 3659 return Representation::Tagged(); |
3743 } | 3660 } |
3744 | 3661 |
3745 HValue* receiver() { return OperandAt(0); } | 3662 HValue* receiver() { return OperandAt(0); } |
3746 HValue* function() { return OperandAt(1); } | 3663 HValue* function() { return OperandAt(1); } |
3747 | 3664 |
3748 virtual HValue* Canonicalize() V8_OVERRIDE; | 3665 virtual HValue* Canonicalize() V8_OVERRIDE; |
3749 | 3666 |
3750 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 3667 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 3668 bool known_function() const { return known_function_; } |
3751 | 3669 |
3752 DECLARE_CONCRETE_INSTRUCTION(WrapReceiver) | 3670 DECLARE_CONCRETE_INSTRUCTION(WrapReceiver) |
3753 | 3671 |
3754 private: | 3672 private: |
3755 HWrapReceiver(HValue* receiver, HValue* function) { | 3673 HWrapReceiver(HValue* receiver, HValue* function) { |
| 3674 known_function_ = function->IsConstant() && |
| 3675 HConstant::cast(function)->handle(function->isolate())->IsJSFunction(); |
3756 set_representation(Representation::Tagged()); | 3676 set_representation(Representation::Tagged()); |
3757 SetOperandAt(0, receiver); | 3677 SetOperandAt(0, receiver); |
3758 SetOperandAt(1, function); | 3678 SetOperandAt(1, function); |
| 3679 SetFlag(kUseGVN); |
3759 } | 3680 } |
| 3681 |
| 3682 bool known_function_; |
3760 }; | 3683 }; |
3761 | 3684 |
3762 | 3685 |
3763 class HApplyArguments V8_FINAL : public HTemplateInstruction<4> { | 3686 class HApplyArguments V8_FINAL : public HTemplateInstruction<4> { |
3764 public: | 3687 public: |
3765 DECLARE_INSTRUCTION_FACTORY_P4(HApplyArguments, HValue*, HValue*, HValue*, | 3688 DECLARE_INSTRUCTION_FACTORY_P4(HApplyArguments, HValue*, HValue*, HValue*, |
3766 HValue*); | 3689 HValue*); |
3767 | 3690 |
3768 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 3691 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
3769 // The length is untagged, all other inputs are tagged. | 3692 // The length is untagged, all other inputs are tagged. |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4309 DECLARE_INSTRUCTION_FACTORY_P1(HIsStringAndBranch, HValue*); | 4232 DECLARE_INSTRUCTION_FACTORY_P1(HIsStringAndBranch, HValue*); |
4310 DECLARE_INSTRUCTION_FACTORY_P3(HIsStringAndBranch, HValue*, | 4233 DECLARE_INSTRUCTION_FACTORY_P3(HIsStringAndBranch, HValue*, |
4311 HBasicBlock*, HBasicBlock*); | 4234 HBasicBlock*, HBasicBlock*); |
4312 | 4235 |
4313 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 4236 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
4314 return Representation::Tagged(); | 4237 return Representation::Tagged(); |
4315 } | 4238 } |
4316 | 4239 |
4317 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch) | 4240 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch) |
4318 | 4241 |
| 4242 protected: |
| 4243 virtual int RedefinedOperandIndex() { return 0; } |
| 4244 |
4319 private: | 4245 private: |
4320 HIsStringAndBranch(HValue* value, | 4246 HIsStringAndBranch(HValue* value, |
4321 HBasicBlock* true_target = NULL, | 4247 HBasicBlock* true_target = NULL, |
4322 HBasicBlock* false_target = NULL) | 4248 HBasicBlock* false_target = NULL) |
4323 : HUnaryControlInstruction(value, true_target, false_target) {} | 4249 : HUnaryControlInstruction(value, true_target, false_target) {} |
4324 }; | 4250 }; |
4325 | 4251 |
4326 | 4252 |
4327 class HIsSmiAndBranch V8_FINAL : public HUnaryControlInstruction { | 4253 class HIsSmiAndBranch V8_FINAL : public HUnaryControlInstruction { |
4328 public: | 4254 public: |
4329 DECLARE_INSTRUCTION_FACTORY_P1(HIsSmiAndBranch, HValue*); | 4255 DECLARE_INSTRUCTION_FACTORY_P1(HIsSmiAndBranch, HValue*); |
4330 DECLARE_INSTRUCTION_FACTORY_P3(HIsSmiAndBranch, HValue*, | 4256 DECLARE_INSTRUCTION_FACTORY_P3(HIsSmiAndBranch, HValue*, |
4331 HBasicBlock*, HBasicBlock*); | 4257 HBasicBlock*, HBasicBlock*); |
4332 | 4258 |
4333 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch) | 4259 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch) |
4334 | 4260 |
4335 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 4261 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
4336 return Representation::Tagged(); | 4262 return Representation::Tagged(); |
4337 } | 4263 } |
4338 | 4264 |
4339 protected: | 4265 protected: |
4340 virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; } | 4266 virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; } |
| 4267 virtual int RedefinedOperandIndex() { return 0; } |
4341 | 4268 |
4342 private: | 4269 private: |
4343 HIsSmiAndBranch(HValue* value, | 4270 HIsSmiAndBranch(HValue* value, |
4344 HBasicBlock* true_target = NULL, | 4271 HBasicBlock* true_target = NULL, |
4345 HBasicBlock* false_target = NULL) | 4272 HBasicBlock* false_target = NULL) |
4346 : HUnaryControlInstruction(value, true_target, false_target) {} | 4273 : HUnaryControlInstruction(value, true_target, false_target) {} |
4347 }; | 4274 }; |
4348 | 4275 |
4349 | 4276 |
4350 class HIsUndetectableAndBranch V8_FINAL : public HUnaryControlInstruction { | 4277 class HIsUndetectableAndBranch V8_FINAL : public HUnaryControlInstruction { |
(...skipping 2847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7198 #ifdef DEBUG | 7125 #ifdef DEBUG |
7199 const Runtime::Function* function = HCallRuntime::cast(value)->function(); | 7126 const Runtime::Function* function = HCallRuntime::cast(value)->function(); |
7200 ASSERT(function->function_id == Runtime::kCreateObjectLiteral); | 7127 ASSERT(function->function_id == Runtime::kCreateObjectLiteral); |
7201 #endif | 7128 #endif |
7202 } | 7129 } |
7203 | 7130 |
7204 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7131 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
7205 }; | 7132 }; |
7206 | 7133 |
7207 | 7134 |
7208 class HValueOf V8_FINAL : public HUnaryOperation { | |
7209 public: | |
7210 DECLARE_INSTRUCTION_FACTORY_P1(HValueOf, HValue*); | |
7211 | |
7212 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | |
7213 return Representation::Tagged(); | |
7214 } | |
7215 | |
7216 DECLARE_CONCRETE_INSTRUCTION(ValueOf) | |
7217 | |
7218 private: | |
7219 explicit HValueOf(HValue* value) : HUnaryOperation(value) { | |
7220 set_representation(Representation::Tagged()); | |
7221 } | |
7222 | |
7223 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | |
7224 }; | |
7225 | |
7226 | |
7227 class HDateField V8_FINAL : public HUnaryOperation { | 7135 class HDateField V8_FINAL : public HUnaryOperation { |
7228 public: | 7136 public: |
7229 DECLARE_INSTRUCTION_FACTORY_P2(HDateField, HValue*, Smi*); | 7137 DECLARE_INSTRUCTION_FACTORY_P2(HDateField, HValue*, Smi*); |
7230 | 7138 |
7231 Smi* index() const { return index_; } | 7139 Smi* index() const { return index_; } |
7232 | 7140 |
7233 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 7141 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
7234 return Representation::Tagged(); | 7142 return Representation::Tagged(); |
7235 } | 7143 } |
7236 | 7144 |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7472 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7380 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
7473 }; | 7381 }; |
7474 | 7382 |
7475 | 7383 |
7476 #undef DECLARE_INSTRUCTION | 7384 #undef DECLARE_INSTRUCTION |
7477 #undef DECLARE_CONCRETE_INSTRUCTION | 7385 #undef DECLARE_CONCRETE_INSTRUCTION |
7478 | 7386 |
7479 } } // namespace v8::internal | 7387 } } // namespace v8::internal |
7480 | 7388 |
7481 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7389 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |