Chromium Code Reviews| 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/compiler/simplified-lowering.h" | 5 #include "src/compiler/simplified-lowering.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "src/address-map.h" | 9 #include "src/address-map.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 2910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2921 | 2921 |
| 2922 | 2922 |
| 2923 void SimplifiedLowering::DoStoreBuffer(Node* node) { | 2923 void SimplifiedLowering::DoStoreBuffer(Node* node) { |
| 2924 DCHECK_EQ(IrOpcode::kStoreBuffer, node->opcode()); | 2924 DCHECK_EQ(IrOpcode::kStoreBuffer, node->opcode()); |
| 2925 MachineRepresentation const rep = | 2925 MachineRepresentation const rep = |
| 2926 BufferAccessOf(node->op()).machine_type().representation(); | 2926 BufferAccessOf(node->op()).machine_type().representation(); |
| 2927 NodeProperties::ChangeOp(node, machine()->CheckedStore(rep)); | 2927 NodeProperties::ChangeOp(node, machine()->CheckedStore(rep)); |
| 2928 } | 2928 } |
| 2929 | 2929 |
| 2930 Node* SimplifiedLowering::Float64Ceil(Node* const node) { | 2930 Node* SimplifiedLowering::Float64Ceil(Node* const node) { |
| 2931 Node* const one = jsgraph()->Float64Constant(1.0); | 2931 return graph()->NewNode(machine()->Float64RoundUp().placeholder(), |
|
Benedikt Meurer
2016/08/05 09:00:26
Nit: Can you remove the helper functions and use t
epertoso
2016/08/05 09:42:26
Done.
| |
| 2932 Node* const zero = jsgraph()->Float64Constant(0.0); | 2932 node->InputAt(0)); |
| 2933 Node* const minus_zero = jsgraph()->Float64Constant(-0.0); | |
| 2934 Node* const two_52 = jsgraph()->Float64Constant(4503599627370496.0E0); | |
| 2935 Node* const minus_two_52 = jsgraph()->Float64Constant(-4503599627370496.0E0); | |
| 2936 Node* const input = node->InputAt(0); | |
| 2937 | |
| 2938 // Use fast hardware instruction if available. | |
| 2939 if (machine()->Float64RoundUp().IsSupported()) { | |
| 2940 return graph()->NewNode(machine()->Float64RoundUp().op(), input); | |
| 2941 } | |
| 2942 | |
| 2943 // General case for ceil. | |
| 2944 // | |
| 2945 // if 0.0 < input then | |
| 2946 // if 2^52 <= input then | |
| 2947 // input | |
| 2948 // else | |
| 2949 // let temp1 = (2^52 + input) - 2^52 in | |
| 2950 // if temp1 < input then | |
| 2951 // temp1 + 1 | |
| 2952 // else | |
| 2953 // temp1 | |
| 2954 // else | |
| 2955 // if input == 0 then | |
| 2956 // input | |
| 2957 // else | |
| 2958 // if input <= -2^52 then | |
| 2959 // input | |
| 2960 // else | |
| 2961 // let temp1 = -0 - input in | |
| 2962 // let temp2 = (2^52 + temp1) - 2^52 in | |
| 2963 // let temp3 = (if temp1 < temp2 then temp2 - 1 else temp2) in | |
| 2964 // -0 - temp3 | |
| 2965 // | |
| 2966 // Note: We do not use the Diamond helper class here, because it really hurts | |
| 2967 // readability with nested diamonds. | |
| 2968 | |
| 2969 Node* check0 = graph()->NewNode(machine()->Float64LessThan(), zero, input); | |
| 2970 Node* branch0 = graph()->NewNode(common()->Branch(BranchHint::kTrue), check0, | |
| 2971 graph()->start()); | |
| 2972 | |
| 2973 Node* if_true0 = graph()->NewNode(common()->IfTrue(), branch0); | |
| 2974 Node* vtrue0; | |
| 2975 { | |
| 2976 Node* check1 = | |
| 2977 graph()->NewNode(machine()->Float64LessThanOrEqual(), two_52, input); | |
| 2978 Node* branch1 = graph()->NewNode(common()->Branch(), check1, if_true0); | |
| 2979 | |
| 2980 Node* if_true1 = graph()->NewNode(common()->IfTrue(), branch1); | |
| 2981 Node* vtrue1 = input; | |
| 2982 | |
| 2983 Node* if_false1 = graph()->NewNode(common()->IfFalse(), branch1); | |
| 2984 Node* vfalse1; | |
| 2985 { | |
| 2986 Node* temp1 = graph()->NewNode( | |
| 2987 machine()->Float64Sub(), | |
| 2988 graph()->NewNode(machine()->Float64Add(), two_52, input), two_52); | |
| 2989 vfalse1 = graph()->NewNode( | |
| 2990 common()->Select(MachineRepresentation::kFloat64), | |
| 2991 graph()->NewNode(machine()->Float64LessThan(), temp1, input), | |
| 2992 graph()->NewNode(machine()->Float64Add(), temp1, one), temp1); | |
| 2993 } | |
| 2994 | |
| 2995 if_true0 = graph()->NewNode(common()->Merge(2), if_true1, if_false1); | |
| 2996 vtrue0 = graph()->NewNode(common()->Phi(MachineRepresentation::kFloat64, 2), | |
| 2997 vtrue1, vfalse1, if_true0); | |
| 2998 } | |
| 2999 | |
| 3000 Node* if_false0 = graph()->NewNode(common()->IfFalse(), branch0); | |
| 3001 Node* vfalse0; | |
| 3002 { | |
| 3003 Node* check1 = graph()->NewNode(machine()->Float64Equal(), input, zero); | |
| 3004 Node* branch1 = graph()->NewNode(common()->Branch(BranchHint::kFalse), | |
| 3005 check1, if_false0); | |
| 3006 | |
| 3007 Node* if_true1 = graph()->NewNode(common()->IfTrue(), branch1); | |
| 3008 Node* vtrue1 = input; | |
| 3009 | |
| 3010 Node* if_false1 = graph()->NewNode(common()->IfFalse(), branch1); | |
| 3011 Node* vfalse1; | |
| 3012 { | |
| 3013 Node* check2 = graph()->NewNode(machine()->Float64LessThanOrEqual(), | |
| 3014 input, minus_two_52); | |
| 3015 Node* branch2 = graph()->NewNode(common()->Branch(BranchHint::kFalse), | |
| 3016 check2, if_false1); | |
| 3017 | |
| 3018 Node* if_true2 = graph()->NewNode(common()->IfTrue(), branch2); | |
| 3019 Node* vtrue2 = input; | |
| 3020 | |
| 3021 Node* if_false2 = graph()->NewNode(common()->IfFalse(), branch2); | |
| 3022 Node* vfalse2; | |
| 3023 { | |
| 3024 Node* temp1 = | |
| 3025 graph()->NewNode(machine()->Float64Sub(), minus_zero, input); | |
| 3026 Node* temp2 = graph()->NewNode( | |
| 3027 machine()->Float64Sub(), | |
| 3028 graph()->NewNode(machine()->Float64Add(), two_52, temp1), two_52); | |
| 3029 Node* temp3 = graph()->NewNode( | |
| 3030 common()->Select(MachineRepresentation::kFloat64), | |
| 3031 graph()->NewNode(machine()->Float64LessThan(), temp1, temp2), | |
| 3032 graph()->NewNode(machine()->Float64Sub(), temp2, one), temp2); | |
| 3033 vfalse2 = graph()->NewNode(machine()->Float64Sub(), minus_zero, temp3); | |
| 3034 } | |
| 3035 | |
| 3036 if_false1 = graph()->NewNode(common()->Merge(2), if_true2, if_false2); | |
| 3037 vfalse1 = | |
| 3038 graph()->NewNode(common()->Phi(MachineRepresentation::kFloat64, 2), | |
| 3039 vtrue2, vfalse2, if_false1); | |
| 3040 } | |
| 3041 | |
| 3042 if_false0 = graph()->NewNode(common()->Merge(2), if_true1, if_false1); | |
| 3043 vfalse0 = | |
| 3044 graph()->NewNode(common()->Phi(MachineRepresentation::kFloat64, 2), | |
| 3045 vtrue1, vfalse1, if_false0); | |
| 3046 } | |
| 3047 | |
| 3048 Node* merge0 = graph()->NewNode(common()->Merge(2), if_true0, if_false0); | |
| 3049 return graph()->NewNode(common()->Phi(MachineRepresentation::kFloat64, 2), | |
| 3050 vtrue0, vfalse0, merge0); | |
| 3051 } | 2933 } |
| 3052 | 2934 |
| 3053 Node* SimplifiedLowering::Float64Floor(Node* const node) { | 2935 Node* SimplifiedLowering::Float64Floor(Node* const node) { |
| 3054 Node* const one = jsgraph()->Float64Constant(1.0); | 2936 return graph()->NewNode(machine()->Float64RoundDown().placeholder(), |
| 3055 Node* const zero = jsgraph()->Float64Constant(0.0); | 2937 node->InputAt(0)); |
| 3056 Node* const minus_one = jsgraph()->Float64Constant(-1.0); | |
| 3057 Node* const minus_zero = jsgraph()->Float64Constant(-0.0); | |
| 3058 Node* const two_52 = jsgraph()->Float64Constant(4503599627370496.0E0); | |
| 3059 Node* const minus_two_52 = jsgraph()->Float64Constant(-4503599627370496.0E0); | |
| 3060 Node* const input = node->InputAt(0); | |
| 3061 | |
| 3062 // Use fast hardware instruction if available. | |
| 3063 if (machine()->Float64RoundDown().IsSupported()) { | |
| 3064 return graph()->NewNode(machine()->Float64RoundDown().op(), input); | |
| 3065 } | |
| 3066 | |
| 3067 // General case for floor. | |
| 3068 // | |
| 3069 // if 0.0 < input then | |
| 3070 // if 2^52 <= input then | |
| 3071 // input | |
| 3072 // else | |
| 3073 // let temp1 = (2^52 + input) - 2^52 in | |
| 3074 // if input < temp1 then | |
| 3075 // temp1 - 1 | |
| 3076 // else | |
| 3077 // temp1 | |
| 3078 // else | |
| 3079 // if input == 0 then | |
| 3080 // input | |
| 3081 // else | |
| 3082 // if input <= -2^52 then | |
| 3083 // input | |
| 3084 // else | |
| 3085 // let temp1 = -0 - input in | |
| 3086 // let temp2 = (2^52 + temp1) - 2^52 in | |
| 3087 // if temp2 < temp1 then | |
| 3088 // -1 - temp2 | |
| 3089 // else | |
| 3090 // -0 - temp2 | |
| 3091 // | |
| 3092 // Note: We do not use the Diamond helper class here, because it really hurts | |
| 3093 // readability with nested diamonds. | |
| 3094 | |
| 3095 Node* check0 = graph()->NewNode(machine()->Float64LessThan(), zero, input); | |
| 3096 Node* branch0 = graph()->NewNode(common()->Branch(BranchHint::kTrue), check0, | |
| 3097 graph()->start()); | |
| 3098 | |
| 3099 Node* if_true0 = graph()->NewNode(common()->IfTrue(), branch0); | |
| 3100 Node* vtrue0; | |
| 3101 { | |
| 3102 Node* check1 = | |
| 3103 graph()->NewNode(machine()->Float64LessThanOrEqual(), two_52, input); | |
| 3104 Node* branch1 = graph()->NewNode(common()->Branch(), check1, if_true0); | |
| 3105 | |
| 3106 Node* if_true1 = graph()->NewNode(common()->IfTrue(), branch1); | |
| 3107 Node* vtrue1 = input; | |
| 3108 | |
| 3109 Node* if_false1 = graph()->NewNode(common()->IfFalse(), branch1); | |
| 3110 Node* vfalse1; | |
| 3111 { | |
| 3112 Node* temp1 = graph()->NewNode( | |
| 3113 machine()->Float64Sub(), | |
| 3114 graph()->NewNode(machine()->Float64Add(), two_52, input), two_52); | |
| 3115 vfalse1 = graph()->NewNode( | |
| 3116 common()->Select(MachineRepresentation::kFloat64), | |
| 3117 graph()->NewNode(machine()->Float64LessThan(), input, temp1), | |
| 3118 graph()->NewNode(machine()->Float64Sub(), temp1, one), temp1); | |
| 3119 } | |
| 3120 | |
| 3121 if_true0 = graph()->NewNode(common()->Merge(2), if_true1, if_false1); | |
| 3122 vtrue0 = graph()->NewNode(common()->Phi(MachineRepresentation::kFloat64, 2), | |
| 3123 vtrue1, vfalse1, if_true0); | |
| 3124 } | |
| 3125 | |
| 3126 Node* if_false0 = graph()->NewNode(common()->IfFalse(), branch0); | |
| 3127 Node* vfalse0; | |
| 3128 { | |
| 3129 Node* check1 = graph()->NewNode(machine()->Float64Equal(), input, zero); | |
| 3130 Node* branch1 = graph()->NewNode(common()->Branch(BranchHint::kFalse), | |
| 3131 check1, if_false0); | |
| 3132 | |
| 3133 Node* if_true1 = graph()->NewNode(common()->IfTrue(), branch1); | |
| 3134 Node* vtrue1 = input; | |
| 3135 | |
| 3136 Node* if_false1 = graph()->NewNode(common()->IfFalse(), branch1); | |
| 3137 Node* vfalse1; | |
| 3138 { | |
| 3139 Node* check2 = graph()->NewNode(machine()->Float64LessThanOrEqual(), | |
| 3140 input, minus_two_52); | |
| 3141 Node* branch2 = graph()->NewNode(common()->Branch(BranchHint::kFalse), | |
| 3142 check2, if_false1); | |
| 3143 | |
| 3144 Node* if_true2 = graph()->NewNode(common()->IfTrue(), branch2); | |
| 3145 Node* vtrue2 = input; | |
| 3146 | |
| 3147 Node* if_false2 = graph()->NewNode(common()->IfFalse(), branch2); | |
| 3148 Node* vfalse2; | |
| 3149 { | |
| 3150 Node* temp1 = | |
| 3151 graph()->NewNode(machine()->Float64Sub(), minus_zero, input); | |
| 3152 Node* temp2 = graph()->NewNode( | |
| 3153 machine()->Float64Sub(), | |
| 3154 graph()->NewNode(machine()->Float64Add(), two_52, temp1), two_52); | |
| 3155 vfalse2 = graph()->NewNode( | |
| 3156 common()->Select(MachineRepresentation::kFloat64), | |
| 3157 graph()->NewNode(machine()->Float64LessThan(), temp2, temp1), | |
| 3158 graph()->NewNode(machine()->Float64Sub(), minus_one, temp2), | |
| 3159 graph()->NewNode(machine()->Float64Sub(), minus_zero, temp2)); | |
| 3160 } | |
| 3161 | |
| 3162 if_false1 = graph()->NewNode(common()->Merge(2), if_true2, if_false2); | |
| 3163 vfalse1 = | |
| 3164 graph()->NewNode(common()->Phi(MachineRepresentation::kFloat64, 2), | |
| 3165 vtrue2, vfalse2, if_false1); | |
| 3166 } | |
| 3167 | |
| 3168 if_false0 = graph()->NewNode(common()->Merge(2), if_true1, if_false1); | |
| 3169 vfalse0 = | |
| 3170 graph()->NewNode(common()->Phi(MachineRepresentation::kFloat64, 2), | |
| 3171 vtrue1, vfalse1, if_false0); | |
| 3172 } | |
| 3173 | |
| 3174 Node* merge0 = graph()->NewNode(common()->Merge(2), if_true0, if_false0); | |
| 3175 return graph()->NewNode(common()->Phi(MachineRepresentation::kFloat64, 2), | |
| 3176 vtrue0, vfalse0, merge0); | |
| 3177 } | 2938 } |
| 3178 | 2939 |
| 3179 Node* SimplifiedLowering::Float64Round(Node* const node) { | 2940 Node* SimplifiedLowering::Float64Round(Node* const node) { |
| 3180 Node* const one = jsgraph()->Float64Constant(1.0); | 2941 Node* const one = jsgraph()->Float64Constant(1.0); |
| 3181 Node* const one_half = jsgraph()->Float64Constant(0.5); | 2942 Node* const one_half = jsgraph()->Float64Constant(0.5); |
| 3182 Node* const input = node->InputAt(0); | 2943 Node* const input = node->InputAt(0); |
| 3183 | 2944 |
| 3184 // Round up towards Infinity, and adjust if the difference exceeds 0.5. | 2945 // Round up towards Infinity, and adjust if the difference exceeds 0.5. |
| 3185 Node* result = Float64Ceil(node); | 2946 Node* result = Float64Ceil(node); |
| 3186 return graph()->NewNode( | 2947 return graph()->NewNode( |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 3201 return graph()->NewNode( | 2962 return graph()->NewNode( |
| 3202 common()->Select(MachineRepresentation::kFloat64), | 2963 common()->Select(MachineRepresentation::kFloat64), |
| 3203 graph()->NewNode(machine()->Float64LessThan(), input, zero), minus_one, | 2964 graph()->NewNode(machine()->Float64LessThan(), input, zero), minus_one, |
| 3204 graph()->NewNode( | 2965 graph()->NewNode( |
| 3205 common()->Select(MachineRepresentation::kFloat64), | 2966 common()->Select(MachineRepresentation::kFloat64), |
| 3206 graph()->NewNode(machine()->Float64LessThan(), zero, input), one, | 2967 graph()->NewNode(machine()->Float64LessThan(), zero, input), one, |
| 3207 zero)); | 2968 zero)); |
| 3208 } | 2969 } |
| 3209 | 2970 |
| 3210 Node* SimplifiedLowering::Float64Trunc(Node* const node) { | 2971 Node* SimplifiedLowering::Float64Trunc(Node* const node) { |
| 3211 Node* const one = jsgraph()->Float64Constant(1.0); | 2972 return graph()->NewNode(machine()->Float64RoundTruncate().placeholder(), |
| 3212 Node* const zero = jsgraph()->Float64Constant(0.0); | 2973 node->InputAt(0)); |
| 3213 Node* const minus_zero = jsgraph()->Float64Constant(-0.0); | |
| 3214 Node* const two_52 = jsgraph()->Float64Constant(4503599627370496.0E0); | |
| 3215 Node* const minus_two_52 = jsgraph()->Float64Constant(-4503599627370496.0E0); | |
| 3216 Node* const input = node->InputAt(0); | |
| 3217 | |
| 3218 // Use fast hardware instruction if available. | |
| 3219 if (machine()->Float64RoundTruncate().IsSupported()) { | |
| 3220 return graph()->NewNode(machine()->Float64RoundTruncate().op(), input); | |
| 3221 } | |
| 3222 | |
| 3223 // General case for trunc. | |
| 3224 // | |
| 3225 // if 0.0 < input then | |
| 3226 // if 2^52 <= input then | |
| 3227 // input | |
| 3228 // else | |
| 3229 // let temp1 = (2^52 + input) - 2^52 in | |
| 3230 // if input < temp1 then | |
| 3231 // temp1 - 1 | |
| 3232 // else | |
| 3233 // temp1 | |
| 3234 // else | |
| 3235 // if input == 0 then | |
| 3236 // input | |
| 3237 // else | |
| 3238 // if input <= -2^52 then | |
| 3239 // input | |
| 3240 // else | |
| 3241 // let temp1 = -0 - input in | |
| 3242 // let temp2 = (2^52 + temp1) - 2^52 in | |
| 3243 // let temp3 = (if temp1 < temp2 then temp2 - 1 else temp2) in | |
| 3244 // -0 - temp3 | |
| 3245 // | |
| 3246 // Note: We do not use the Diamond helper class here, because it really hurts | |
| 3247 // readability with nested diamonds. | |
| 3248 | |
| 3249 Node* check0 = graph()->NewNode(machine()->Float64LessThan(), zero, input); | |
| 3250 Node* branch0 = graph()->NewNode(common()->Branch(BranchHint::kTrue), check0, | |
| 3251 graph()->start()); | |
| 3252 | |
| 3253 Node* if_true0 = graph()->NewNode(common()->IfTrue(), branch0); | |
| 3254 Node* vtrue0; | |
| 3255 { | |
| 3256 Node* check1 = | |
| 3257 graph()->NewNode(machine()->Float64LessThanOrEqual(), two_52, input); | |
| 3258 Node* branch1 = graph()->NewNode(common()->Branch(), check1, if_true0); | |
| 3259 | |
| 3260 Node* if_true1 = graph()->NewNode(common()->IfTrue(), branch1); | |
| 3261 Node* vtrue1 = input; | |
| 3262 | |
| 3263 Node* if_false1 = graph()->NewNode(common()->IfFalse(), branch1); | |
| 3264 Node* vfalse1; | |
| 3265 { | |
| 3266 Node* temp1 = graph()->NewNode( | |
| 3267 machine()->Float64Sub(), | |
| 3268 graph()->NewNode(machine()->Float64Add(), two_52, input), two_52); | |
| 3269 vfalse1 = graph()->NewNode( | |
| 3270 common()->Select(MachineRepresentation::kFloat64), | |
| 3271 graph()->NewNode(machine()->Float64LessThan(), input, temp1), | |
| 3272 graph()->NewNode(machine()->Float64Sub(), temp1, one), temp1); | |
| 3273 } | |
| 3274 | |
| 3275 if_true0 = graph()->NewNode(common()->Merge(2), if_true1, if_false1); | |
| 3276 vtrue0 = graph()->NewNode(common()->Phi(MachineRepresentation::kFloat64, 2), | |
| 3277 vtrue1, vfalse1, if_true0); | |
| 3278 } | |
| 3279 | |
| 3280 Node* if_false0 = graph()->NewNode(common()->IfFalse(), branch0); | |
| 3281 Node* vfalse0; | |
| 3282 { | |
| 3283 Node* check1 = graph()->NewNode(machine()->Float64Equal(), input, zero); | |
| 3284 Node* branch1 = graph()->NewNode(common()->Branch(BranchHint::kFalse), | |
| 3285 check1, if_false0); | |
| 3286 | |
| 3287 Node* if_true1 = graph()->NewNode(common()->IfTrue(), branch1); | |
| 3288 Node* vtrue1 = input; | |
| 3289 | |
| 3290 Node* if_false1 = graph()->NewNode(common()->IfFalse(), branch1); | |
| 3291 Node* vfalse1; | |
| 3292 { | |
| 3293 Node* check2 = graph()->NewNode(machine()->Float64LessThanOrEqual(), | |
| 3294 input, minus_two_52); | |
| 3295 Node* branch2 = graph()->NewNode(common()->Branch(BranchHint::kFalse), | |
| 3296 check2, if_false1); | |
| 3297 | |
| 3298 Node* if_true2 = graph()->NewNode(common()->IfTrue(), branch2); | |
| 3299 Node* vtrue2 = input; | |
| 3300 | |
| 3301 Node* if_false2 = graph()->NewNode(common()->IfFalse(), branch2); | |
| 3302 Node* vfalse2; | |
| 3303 { | |
| 3304 Node* temp1 = | |
| 3305 graph()->NewNode(machine()->Float64Sub(), minus_zero, input); | |
| 3306 Node* temp2 = graph()->NewNode( | |
| 3307 machine()->Float64Sub(), | |
| 3308 graph()->NewNode(machine()->Float64Add(), two_52, temp1), two_52); | |
| 3309 Node* temp3 = graph()->NewNode( | |
| 3310 common()->Select(MachineRepresentation::kFloat64), | |
| 3311 graph()->NewNode(machine()->Float64LessThan(), temp1, temp2), | |
| 3312 graph()->NewNode(machine()->Float64Sub(), temp2, one), temp2); | |
| 3313 vfalse2 = graph()->NewNode(machine()->Float64Sub(), minus_zero, temp3); | |
| 3314 } | |
| 3315 | |
| 3316 if_false1 = graph()->NewNode(common()->Merge(2), if_true2, if_false2); | |
| 3317 vfalse1 = | |
| 3318 graph()->NewNode(common()->Phi(MachineRepresentation::kFloat64, 2), | |
| 3319 vtrue2, vfalse2, if_false1); | |
| 3320 } | |
| 3321 | |
| 3322 if_false0 = graph()->NewNode(common()->Merge(2), if_true1, if_false1); | |
| 3323 vfalse0 = | |
| 3324 graph()->NewNode(common()->Phi(MachineRepresentation::kFloat64, 2), | |
| 3325 vtrue1, vfalse1, if_false0); | |
| 3326 } | |
| 3327 | |
| 3328 Node* merge0 = graph()->NewNode(common()->Merge(2), if_true0, if_false0); | |
| 3329 return graph()->NewNode(common()->Phi(MachineRepresentation::kFloat64, 2), | |
| 3330 vtrue0, vfalse0, merge0); | |
| 3331 } | 2974 } |
| 3332 | 2975 |
| 3333 Node* SimplifiedLowering::Int32Abs(Node* const node) { | 2976 Node* SimplifiedLowering::Int32Abs(Node* const node) { |
| 3334 Node* const input = node->InputAt(0); | 2977 Node* const input = node->InputAt(0); |
| 3335 | 2978 |
| 3336 // Generate case for absolute integer value. | 2979 // Generate case for absolute integer value. |
| 3337 // | 2980 // |
| 3338 // let sign = input >> 31 in | 2981 // let sign = input >> 31 in |
| 3339 // (input ^ sign) - sign | 2982 // (input ^ sign) - sign |
| 3340 | 2983 |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3673 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 3316 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
| 3674 Operator::kNoProperties); | 3317 Operator::kNoProperties); |
| 3675 to_number_operator_.set(common()->Call(desc)); | 3318 to_number_operator_.set(common()->Call(desc)); |
| 3676 } | 3319 } |
| 3677 return to_number_operator_.get(); | 3320 return to_number_operator_.get(); |
| 3678 } | 3321 } |
| 3679 | 3322 |
| 3680 } // namespace compiler | 3323 } // namespace compiler |
| 3681 } // namespace internal | 3324 } // namespace internal |
| 3682 } // namespace v8 | 3325 } // namespace v8 |
| OLD | NEW |