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

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

Issue 17550005: Distinguish times_8 and times_pointer_size usage for X64 (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/x64/deoptimizer-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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 STATIC_ASSERT(FixedDoubleArray::kLengthOffset == FixedArray::kLengthOffset); 339 STATIC_ASSERT(FixedDoubleArray::kLengthOffset == FixedArray::kLengthOffset);
340 STATIC_ASSERT(FixedDoubleArray::kHeaderSize == FixedArray::kHeaderSize); 340 STATIC_ASSERT(FixedDoubleArray::kHeaderSize == FixedArray::kHeaderSize);
341 341
342 Label loop, entry, convert_hole; 342 Label loop, entry, convert_hole;
343 __ movq(r15, BitCast<int64_t, uint64_t>(kHoleNanInt64), RelocInfo::NONE64); 343 __ movq(r15, BitCast<int64_t, uint64_t>(kHoleNanInt64), RelocInfo::NONE64);
344 // r15: the-hole NaN 344 // r15: the-hole NaN
345 __ jmp(&entry); 345 __ jmp(&entry);
346 346
347 // Allocate new backing store. 347 // Allocate new backing store.
348 __ bind(&new_backing_store); 348 __ bind(&new_backing_store);
349 __ lea(rdi, Operand(r9, times_pointer_size, FixedArray::kHeaderSize)); 349 __ lea(rdi, Operand(r9, times_8, FixedArray::kHeaderSize));
350 __ Allocate(rdi, r14, r11, r15, fail, TAG_OBJECT); 350 __ Allocate(rdi, r14, r11, r15, fail, TAG_OBJECT);
351 // Set backing store's map 351 // Set backing store's map
352 __ LoadRoot(rdi, Heap::kFixedDoubleArrayMapRootIndex); 352 __ LoadRoot(rdi, Heap::kFixedDoubleArrayMapRootIndex);
353 __ movq(FieldOperand(r14, HeapObject::kMapOffset), rdi); 353 __ movq(FieldOperand(r14, HeapObject::kMapOffset), rdi);
354 // Set receiver's backing store. 354 // Set receiver's backing store.
355 __ movq(FieldOperand(rdx, JSObject::kElementsOffset), r14); 355 __ movq(FieldOperand(rdx, JSObject::kElementsOffset), r14);
356 __ movq(r11, r14); 356 __ movq(r11, r14);
357 __ RecordWriteField(rdx, 357 __ RecordWriteField(rdx,
358 JSObject::kElementsOffset, 358 JSObject::kElementsOffset,
359 r11, 359 r11,
(...skipping 14 matching lines...) Expand all
374 rbx, 374 rbx,
375 rdi, 375 rdi,
376 kDontSaveFPRegs, 376 kDontSaveFPRegs,
377 OMIT_REMEMBERED_SET, 377 OMIT_REMEMBERED_SET,
378 OMIT_SMI_CHECK); 378 OMIT_SMI_CHECK);
379 __ jmp(&done); 379 __ jmp(&done);
380 380
381 // Conversion loop. 381 // Conversion loop.
382 __ bind(&loop); 382 __ bind(&loop);
383 __ movq(rbx, 383 __ movq(rbx,
384 FieldOperand(r8, r9, times_8, FixedArray::kHeaderSize)); 384 FieldOperand(r8, r9, times_pointer_size, FixedArray::kHeaderSize));
385 // r9 : current element's index 385 // r9 : current element's index
386 // rbx: current element (smi-tagged) 386 // rbx: current element (smi-tagged)
387 __ JumpIfNotSmi(rbx, &convert_hole); 387 __ JumpIfNotSmi(rbx, &convert_hole);
388 __ SmiToInteger32(rbx, rbx); 388 __ SmiToInteger32(rbx, rbx);
389 __ cvtlsi2sd(xmm0, rbx); 389 __ cvtlsi2sd(xmm0, rbx);
390 __ movsd(FieldOperand(r14, r9, times_8, FixedDoubleArray::kHeaderSize), 390 __ movsd(FieldOperand(r14, r9, times_8, FixedDoubleArray::kHeaderSize),
391 xmm0); 391 xmm0);
392 __ jmp(&entry); 392 __ jmp(&entry);
393 __ bind(&convert_hole); 393 __ bind(&convert_hole);
394 394
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 // Call into runtime if GC is required. 452 // Call into runtime if GC is required.
453 __ bind(&gc_required); 453 __ bind(&gc_required);
454 __ pop(rax); 454 __ pop(rax);
455 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); 455 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
456 __ jmp(fail); 456 __ jmp(fail);
457 457
458 // Box doubles into heap numbers. 458 // Box doubles into heap numbers.
459 __ bind(&loop); 459 __ bind(&loop);
460 __ movq(r14, FieldOperand(r8, 460 __ movq(r14, FieldOperand(r8,
461 r9, 461 r9,
462 times_pointer_size, 462 times_8,
463 FixedDoubleArray::kHeaderSize)); 463 FixedDoubleArray::kHeaderSize));
464 // r9 : current element's index 464 // r9 : current element's index
465 // r14: current element 465 // r14: current element
466 __ cmpq(r14, rsi); 466 __ cmpq(r14, rsi);
467 __ j(equal, &convert_hole); 467 __ j(equal, &convert_hole);
468 468
469 // Non-hole double, copy value into a heap number. 469 // Non-hole double, copy value into a heap number.
470 __ AllocateHeapNumber(rax, r15, &gc_required); 470 __ AllocateHeapNumber(rax, r15, &gc_required);
471 // rax: new heap number 471 // rax: new heap number
472 __ movq(FieldOperand(rax, HeapNumber::kValueOffset), r14); 472 __ movq(FieldOperand(rax, HeapNumber::kValueOffset), r14);
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 CodePatcher patcher(sequence, young_length); 736 CodePatcher patcher(sequence, young_length);
737 patcher.masm()->call(stub->instruction_start()); 737 patcher.masm()->call(stub->instruction_start());
738 patcher.masm()->nop(); 738 patcher.masm()->nop();
739 } 739 }
740 } 740 }
741 741
742 742
743 } } // namespace v8::internal 743 } } // namespace v8::internal
744 744
745 #endif // V8_TARGET_ARCH_X64 745 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « no previous file | src/x64/deoptimizer-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698