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

Side by Side Diff: src/x64/codegen-x64.cc

Issue 553843002: Replace our home-grown BitCast with bit_cast from Chrome/Google3. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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/assembler-x64.cc ('k') | src/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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/macro-assembler.h" 10 #include "src/macro-assembler.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 kDontSaveFPRegs, 279 kDontSaveFPRegs,
280 EMIT_REMEMBERED_SET, 280 EMIT_REMEMBERED_SET,
281 OMIT_SMI_CHECK); 281 OMIT_SMI_CHECK);
282 282
283 // Convert smis to doubles and holes to hole NaNs. The Array's length 283 // Convert smis to doubles and holes to hole NaNs. The Array's length
284 // remains unchanged. 284 // remains unchanged.
285 STATIC_ASSERT(FixedDoubleArray::kLengthOffset == FixedArray::kLengthOffset); 285 STATIC_ASSERT(FixedDoubleArray::kLengthOffset == FixedArray::kLengthOffset);
286 STATIC_ASSERT(FixedDoubleArray::kHeaderSize == FixedArray::kHeaderSize); 286 STATIC_ASSERT(FixedDoubleArray::kHeaderSize == FixedArray::kHeaderSize);
287 287
288 Label loop, entry, convert_hole; 288 Label loop, entry, convert_hole;
289 __ movq(r15, BitCast<int64_t, uint64_t>(kHoleNanInt64)); 289 __ movq(r15, bit_cast<int64_t, uint64_t>(kHoleNanInt64));
290 // r15: the-hole NaN 290 // r15: the-hole NaN
291 __ jmp(&entry); 291 __ jmp(&entry);
292 292
293 // Allocate new backing store. 293 // Allocate new backing store.
294 __ bind(&new_backing_store); 294 __ bind(&new_backing_store);
295 __ leap(rdi, Operand(r9, times_8, FixedArray::kHeaderSize)); 295 __ leap(rdi, Operand(r9, times_8, FixedArray::kHeaderSize));
296 __ Allocate(rdi, r14, r11, r15, fail, TAG_OBJECT); 296 __ Allocate(rdi, r14, r11, r15, fail, TAG_OBJECT);
297 // Set backing store's map 297 // Set backing store's map
298 __ LoadRoot(rdi, Heap::kFixedDoubleArrayMapRootIndex); 298 __ LoadRoot(rdi, Heap::kFixedDoubleArrayMapRootIndex);
299 __ movp(FieldOperand(r14, HeapObject::kMapOffset), rdi); 299 __ movp(FieldOperand(r14, HeapObject::kMapOffset), rdi);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 // r9 : number of elements 386 // r9 : number of elements
387 __ leap(rdi, Operand(r9, times_pointer_size, FixedArray::kHeaderSize)); 387 __ leap(rdi, Operand(r9, times_pointer_size, FixedArray::kHeaderSize));
388 __ Allocate(rdi, r11, r14, r15, &gc_required, TAG_OBJECT); 388 __ Allocate(rdi, r11, r14, r15, &gc_required, TAG_OBJECT);
389 // r11: destination FixedArray 389 // r11: destination FixedArray
390 __ LoadRoot(rdi, Heap::kFixedArrayMapRootIndex); 390 __ LoadRoot(rdi, Heap::kFixedArrayMapRootIndex);
391 __ movp(FieldOperand(r11, HeapObject::kMapOffset), rdi); 391 __ movp(FieldOperand(r11, HeapObject::kMapOffset), rdi);
392 __ Integer32ToSmi(r14, r9); 392 __ Integer32ToSmi(r14, r9);
393 __ movp(FieldOperand(r11, FixedArray::kLengthOffset), r14); 393 __ movp(FieldOperand(r11, FixedArray::kLengthOffset), r14);
394 394
395 // Prepare for conversion loop. 395 // Prepare for conversion loop.
396 __ movq(rsi, BitCast<int64_t, uint64_t>(kHoleNanInt64)); 396 __ movq(rsi, bit_cast<int64_t, uint64_t>(kHoleNanInt64));
397 __ LoadRoot(rdi, Heap::kTheHoleValueRootIndex); 397 __ LoadRoot(rdi, Heap::kTheHoleValueRootIndex);
398 // rsi: the-hole NaN 398 // rsi: the-hole NaN
399 // rdi: pointer to the-hole 399 // rdi: pointer to the-hole
400 __ jmp(&entry); 400 __ jmp(&entry);
401 401
402 // Call into runtime if GC is required. 402 // Call into runtime if GC is required.
403 __ bind(&gc_required); 403 __ bind(&gc_required);
404 __ Pop(rax); 404 __ Pop(rax);
405 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); 405 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
406 __ jmp(fail); 406 __ jmp(fail);
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 // argument_count_reg_ * times_pointer_size + (receiver - 1) * kPointerSize. 706 // argument_count_reg_ * times_pointer_size + (receiver - 1) * kPointerSize.
707 return Operand(base_reg_, argument_count_reg_, times_pointer_size, 707 return Operand(base_reg_, argument_count_reg_, times_pointer_size,
708 displacement_to_last_argument + (receiver - 1 - index) * kPointerSize); 708 displacement_to_last_argument + (receiver - 1 - index) * kPointerSize);
709 } 709 }
710 } 710 }
711 711
712 712
713 } } // namespace v8::internal 713 } } // namespace v8::internal
714 714
715 #endif // V8_TARGET_ARCH_X64 715 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698