Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/crankshaft/ia32/lithium-codegen-ia32.cc

Issue 2033413002: [crankshaft] Fix DoDeferredMathAbsTaggedHeapNumber overwriting the context with some temporary valu… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/crankshaft/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #if V8_TARGET_ARCH_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h"
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 3057 matching lines...) Expand 10 before | Expand all | Expand 10 after
3068 void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr) { 3068 void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr) {
3069 Register input_reg = ToRegister(instr->value()); 3069 Register input_reg = ToRegister(instr->value());
3070 __ cmp(FieldOperand(input_reg, HeapObject::kMapOffset), 3070 __ cmp(FieldOperand(input_reg, HeapObject::kMapOffset),
3071 factory()->heap_number_map()); 3071 factory()->heap_number_map());
3072 DeoptimizeIf(not_equal, instr, Deoptimizer::kNotAHeapNumber); 3072 DeoptimizeIf(not_equal, instr, Deoptimizer::kNotAHeapNumber);
3073 3073
3074 Label slow, allocated, done; 3074 Label slow, allocated, done;
3075 Register tmp = input_reg.is(eax) ? ecx : eax; 3075 Register tmp = input_reg.is(eax) ? ecx : eax;
3076 Register tmp2 = tmp.is(ecx) ? edx : input_reg.is(ecx) ? edx : ecx; 3076 Register tmp2 = tmp.is(ecx) ? edx : input_reg.is(ecx) ? edx : ecx;
3077 3077
3078 // Make sure that the context isn't overwritten in the AllocateHeapNumber
3079 // macro below.
3080 if (instr->context()->IsRegister()) {
3081 Register context_reg = ToRegister(instr->context());
3082 if (tmp.is(context_reg)) {
3083 tmp = ebx;
3084 } else if (tmp2.is(context_reg)) {
3085 tmp2 = ebx;
3086 }
3087 }
Jarin 2016/06/03 13:54:56 It is not obvious that tmp/tmp2 cannot alias the i
epertoso 2016/06/03 15:39:06 Changed it a bit. Feel free to Commit if you still
3088
3078 // Preserve the value of all registers. 3089 // Preserve the value of all registers.
3079 PushSafepointRegistersScope scope(this); 3090 PushSafepointRegistersScope scope(this);
3080 3091
3081 __ mov(tmp, FieldOperand(input_reg, HeapNumber::kExponentOffset)); 3092 __ mov(tmp, FieldOperand(input_reg, HeapNumber::kExponentOffset));
3082 // Check the sign of the argument. If the argument is positive, just 3093 // Check the sign of the argument. If the argument is positive, just
3083 // return it. We do not need to patch the stack since |input| and 3094 // return it. We do not need to patch the stack since |input| and
3084 // |result| are the same register and |input| will be restored 3095 // |result| are the same register and |input| will be restored
3085 // unchanged by popping safepoint registers. 3096 // unchanged by popping safepoint registers.
3086 __ test(tmp, Immediate(HeapNumber::kSignMask)); 3097 __ test(tmp, Immediate(HeapNumber::kSignMask));
3087 __ j(zero, &done, Label::kNear); 3098 __ j(zero, &done, Label::kNear);
(...skipping 2221 matching lines...) Expand 10 before | Expand all | Expand 10 after
5309 __ bind(deferred->exit()); 5320 __ bind(deferred->exit());
5310 __ bind(&done); 5321 __ bind(&done);
5311 } 5322 }
5312 5323
5313 #undef __ 5324 #undef __
5314 5325
5315 } // namespace internal 5326 } // namespace internal
5316 } // namespace v8 5327 } // namespace v8
5317 5328
5318 #endif // V8_TARGET_ARCH_IA32 5329 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | src/crankshaft/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698