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

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 153773002: A64: Synchronize with r16679. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | src/x64/regexp-macro-assembler-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 // 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 movq(kScratchRegister, ExternalReference::new_space_mask(isolate())); 278 movq(kScratchRegister, ExternalReference::new_space_mask(isolate()));
279 and_(scratch, kScratchRegister); 279 and_(scratch, kScratchRegister);
280 } else { 280 } else {
281 movq(scratch, ExternalReference::new_space_mask(isolate())); 281 movq(scratch, ExternalReference::new_space_mask(isolate()));
282 and_(scratch, object); 282 and_(scratch, object);
283 } 283 }
284 movq(kScratchRegister, ExternalReference::new_space_start(isolate())); 284 movq(kScratchRegister, ExternalReference::new_space_start(isolate()));
285 cmpq(scratch, kScratchRegister); 285 cmpq(scratch, kScratchRegister);
286 j(cc, branch, distance); 286 j(cc, branch, distance);
287 } else { 287 } else {
288 ASSERT(is_int32(static_cast<int64_t>(HEAP->NewSpaceMask()))); 288 ASSERT(is_int32(static_cast<int64_t>(isolate()->heap()->NewSpaceMask())));
289 intptr_t new_space_start = 289 intptr_t new_space_start =
290 reinterpret_cast<intptr_t>(HEAP->NewSpaceStart()); 290 reinterpret_cast<intptr_t>(isolate()->heap()->NewSpaceStart());
291 movq(kScratchRegister, -new_space_start, RelocInfo::NONE64); 291 movq(kScratchRegister, -new_space_start, RelocInfo::NONE64);
292 if (scratch.is(object)) { 292 if (scratch.is(object)) {
293 addq(scratch, kScratchRegister); 293 addq(scratch, kScratchRegister);
294 } else { 294 } else {
295 lea(scratch, Operand(object, kScratchRegister, times_1, 0)); 295 lea(scratch, Operand(object, kScratchRegister, times_1, 0));
296 } 296 }
297 and_(scratch, Immediate(static_cast<int32_t>(HEAP->NewSpaceMask()))); 297 and_(scratch,
298 Immediate(static_cast<int32_t>(isolate()->heap()->NewSpaceMask())));
298 j(cc, branch, distance); 299 j(cc, branch, distance);
299 } 300 }
300 } 301 }
301 302
302 303
303 void MacroAssembler::RecordWriteField( 304 void MacroAssembler::RecordWriteField(
304 Register object, 305 Register object,
305 int offset, 306 int offset,
306 Register value, 307 Register value,
307 Register dst, 308 Register dst,
(...skipping 2677 matching lines...) Expand 10 before | Expand all | Expand 10 after
2985 Register src, 2986 Register src,
2986 XMMRegister scratch) { 2987 XMMRegister scratch) {
2987 if (FLAG_debug_code) { 2988 if (FLAG_debug_code) {
2988 cmpq(src, Immediate(0xffffffff)); 2989 cmpq(src, Immediate(0xffffffff));
2989 Assert(below_equal, kInputGPRIsExpectedToHaveUpper32Cleared); 2990 Assert(below_equal, kInputGPRIsExpectedToHaveUpper32Cleared);
2990 } 2991 }
2991 cvtqsi2sd(dst, src); 2992 cvtqsi2sd(dst, src);
2992 } 2993 }
2993 2994
2994 2995
2996 void MacroAssembler::SlowTruncateToI(Register result_reg,
2997 Register input_reg,
2998 int offset) {
2999 DoubleToIStub stub(input_reg, result_reg, offset, true);
3000 call(stub.GetCode(isolate()), RelocInfo::CODE_TARGET);
3001 }
3002
3003
3004 void MacroAssembler::TruncateHeapNumberToI(Register result_reg,
3005 Register input_reg) {
3006 Label done;
3007 movsd(xmm0, FieldOperand(input_reg, HeapNumber::kValueOffset));
3008 cvttsd2siq(result_reg, xmm0);
3009 Set(kScratchRegister, V8_UINT64_C(0x8000000000000000));
3010 cmpq(result_reg, kScratchRegister);
3011 j(not_equal, &done, Label::kNear);
3012
3013 // Slow case.
3014 if (input_reg.is(result_reg)) {
3015 subq(rsp, Immediate(kDoubleSize));
3016 movsd(MemOperand(rsp, 0), xmm0);
3017 SlowTruncateToI(result_reg, rsp, 0);
3018 addq(rsp, Immediate(kDoubleSize));
3019 } else {
3020 SlowTruncateToI(result_reg, input_reg);
3021 }
3022
3023 bind(&done);
3024 }
3025
3026
3027 void MacroAssembler::TruncateDoubleToI(Register result_reg,
3028 XMMRegister input_reg) {
3029 Label done;
3030 cvttsd2siq(result_reg, input_reg);
3031 movq(kScratchRegister,
3032 V8_INT64_C(0x8000000000000000),
3033 RelocInfo::NONE64);
3034 cmpq(result_reg, kScratchRegister);
3035 j(not_equal, &done, Label::kNear);
3036
3037 subq(rsp, Immediate(kDoubleSize));
3038 movsd(MemOperand(rsp, 0), input_reg);
3039 SlowTruncateToI(result_reg, rsp, 0);
3040 addq(rsp, Immediate(kDoubleSize));
3041
3042 bind(&done);
3043 }
3044
3045
3046 void MacroAssembler::DoubleToI(Register result_reg,
3047 XMMRegister input_reg,
3048 XMMRegister scratch,
3049 MinusZeroMode minus_zero_mode,
3050 Label* conversion_failed,
3051 Label::Distance dst) {
3052 cvttsd2si(result_reg, input_reg);
3053 cvtlsi2sd(xmm0, result_reg);
3054 ucomisd(xmm0, input_reg);
3055 j(not_equal, conversion_failed, dst);
3056 j(parity_even, conversion_failed, dst); // NaN.
3057 if (minus_zero_mode == FAIL_ON_MINUS_ZERO) {
3058 Label done;
3059 // The integer converted back is equal to the original. We
3060 // only have to test if we got -0 as an input.
3061 testl(result_reg, result_reg);
3062 j(not_zero, &done, Label::kNear);
3063 movmskpd(result_reg, input_reg);
3064 // Bit 0 contains the sign of the double in input_reg.
3065 // If input was positive, we are ok and return 0, otherwise
3066 // jump to conversion_failed.
3067 andl(result_reg, Immediate(1));
3068 j(not_zero, conversion_failed, dst);
3069 bind(&done);
3070 }
3071 }
3072
3073
3074 void MacroAssembler::TaggedToI(Register result_reg,
3075 Register input_reg,
3076 XMMRegister temp,
3077 MinusZeroMode minus_zero_mode,
3078 Label* lost_precision,
3079 Label::Distance dst) {
3080 Label done;
3081 ASSERT(!temp.is(xmm0));
3082
3083 // Heap number map check.
3084 CompareRoot(FieldOperand(input_reg, HeapObject::kMapOffset),
3085 Heap::kHeapNumberMapRootIndex);
3086 j(not_equal, lost_precision, dst);
3087
3088 movsd(xmm0, FieldOperand(input_reg, HeapNumber::kValueOffset));
3089 cvttsd2si(result_reg, xmm0);
3090 cvtlsi2sd(temp, result_reg);
3091 ucomisd(xmm0, temp);
3092 RecordComment("Deferred TaggedToI: lost precision");
3093 j(not_equal, lost_precision, dst);
3094 RecordComment("Deferred TaggedToI: NaN");
3095 j(parity_even, lost_precision, dst); // NaN.
3096 if (minus_zero_mode == FAIL_ON_MINUS_ZERO) {
3097 testl(result_reg, result_reg);
3098 j(not_zero, &done, Label::kNear);
3099 movmskpd(result_reg, xmm0);
3100 andl(result_reg, Immediate(1));
3101 j(not_zero, lost_precision, dst);
3102 }
3103 bind(&done);
3104 }
3105
3106
2995 void MacroAssembler::LoadInstanceDescriptors(Register map, 3107 void MacroAssembler::LoadInstanceDescriptors(Register map,
2996 Register descriptors) { 3108 Register descriptors) {
2997 movq(descriptors, FieldOperand(map, Map::kDescriptorsOffset)); 3109 movq(descriptors, FieldOperand(map, Map::kDescriptorsOffset));
2998 } 3110 }
2999 3111
3000 3112
3001 void MacroAssembler::NumberOfOwnDescriptors(Register dst, Register map) { 3113 void MacroAssembler::NumberOfOwnDescriptors(Register dst, Register map) {
3002 movq(dst, FieldOperand(map, Map::kBitField3Offset)); 3114 movq(dst, FieldOperand(map, Map::kBitField3Offset));
3003 DecodeField<Map::NumberOfOwnDescriptorsBits>(dst); 3115 DecodeField<Map::NumberOfOwnDescriptorsBits>(dst);
3004 } 3116 }
(...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after
4695 j(greater, &no_memento_available); 4807 j(greater, &no_memento_available);
4696 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize), 4808 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize),
4697 Heap::kAllocationMementoMapRootIndex); 4809 Heap::kAllocationMementoMapRootIndex);
4698 bind(&no_memento_available); 4810 bind(&no_memento_available);
4699 } 4811 }
4700 4812
4701 4813
4702 } } // namespace v8::internal 4814 } } // namespace v8::internal
4703 4815
4704 #endif // V8_TARGET_ARCH_X64 4816 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | src/x64/regexp-macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698