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

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 8344045: Fast elements conversions in crankshaft using generated code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 5945 matching lines...) Expand 10 before | Expand all | Expand 10 after
5956 HeapObject::kMapOffset, 5956 HeapObject::kMapOffset,
5957 rbx, 5957 rbx,
5958 rdi, 5958 rdi,
5959 kDontSaveFPRegs, 5959 kDontSaveFPRegs,
5960 EMIT_REMEMBERED_SET, 5960 EMIT_REMEMBERED_SET,
5961 OMIT_SMI_CHECK); 5961 OMIT_SMI_CHECK);
5962 } 5962 }
5963 5963
5964 5964
5965 void FastElementsConversionStub::GenerateSmiOnlyToDouble( 5965 void FastElementsConversionStub::GenerateSmiOnlyToDouble(
5966 MacroAssembler* masm, StrictModeFlag strict_mode) { 5966 MacroAssembler* masm, Type type, StrictModeFlag strict_mode) {
5967 // ----------- S t a t e ------------- 5967 // ----------- S t a t e -------------
5968 // -- rax : value 5968 // -- rax : value
5969 // -- rbx : target map 5969 // -- rbx : target map
5970 // -- rcx : key 5970 // -- rcx : key
5971 // -- rdx : receiver 5971 // -- rdx : receiver
5972 // -- rsp[0] : return address 5972 // -- rsp[0] : return address
5973 // ----------------------------------- 5973 // -----------------------------------
5974 // Set transitioned map. 5974 // Set transitioned map.
5975 __ movq(FieldOperand(rdx, HeapObject::kMapOffset), rbx); 5975 __ movq(FieldOperand(rdx, HeapObject::kMapOffset), rbx);
5976 __ RecordWriteField(rdx, 5976 __ RecordWriteField(rdx,
(...skipping 29 matching lines...) Expand all
6006 __ SmiToInteger32(rbx, rbx); 6006 __ SmiToInteger32(rbx, rbx);
6007 __ cvtlsi2sd(xmm0, rbx); 6007 __ cvtlsi2sd(xmm0, rbx);
6008 __ movsd(FieldOperand(r8, r9, times_8, FixedDoubleArray::kHeaderSize), 6008 __ movsd(FieldOperand(r8, r9, times_8, FixedDoubleArray::kHeaderSize),
6009 xmm0); 6009 xmm0);
6010 __ jmp(&entry); 6010 __ jmp(&entry);
6011 __ bind(&convert_hole); 6011 __ bind(&convert_hole);
6012 __ movq(FieldOperand(r8, r9, times_8, FixedDoubleArray::kHeaderSize), r15); 6012 __ movq(FieldOperand(r8, r9, times_8, FixedDoubleArray::kHeaderSize), r15);
6013 __ bind(&entry); 6013 __ bind(&entry);
6014 __ testq(r9, r9); 6014 __ testq(r9, r9);
6015 __ j(not_zero, &loop); 6015 __ j(not_zero, &loop);
6016
6017 if (type == TRANSITION_ONLY) {
6018 __ movq(rax, rdx);
6019 __ Ret();
6020 }
6016 } 6021 }
6017 6022
6018 6023
6019 void FastElementsConversionStub::GenerateDoubleToObject( 6024 void FastElementsConversionStub::GenerateDoubleToObject(
6020 MacroAssembler* masm, StrictModeFlag strict_mode) { 6025 MacroAssembler* masm, Type type, StrictModeFlag strict_mode) {
6021 // ----------- S t a t e ------------- 6026 // ----------- S t a t e -------------
6022 // -- rax : value 6027 // -- rax : value
6023 // -- rbx : target map 6028 // -- rbx : target map
6024 // -- rcx : key 6029 // -- rcx : key
6025 // -- rdx : receiver 6030 // -- rdx : receiver
6026 // -- rsp[0] : return address 6031 // -- rsp[0] : return address
6027 // ----------------------------------- 6032 // -----------------------------------
6028 Label loop, entry, convert_hole, gc_required; 6033 Label loop, entry, convert_hole, gc_required;
6029 __ push(rax); 6034 __ push(rax);
6030 6035
(...skipping 13 matching lines...) Expand all
6044 __ movq(rsi, BitCast<int64_t, uint64_t>(kHoleNanInt64), RelocInfo::NONE); 6049 __ movq(rsi, BitCast<int64_t, uint64_t>(kHoleNanInt64), RelocInfo::NONE);
6045 __ LoadRoot(rdi, Heap::kTheHoleValueRootIndex); 6050 __ LoadRoot(rdi, Heap::kTheHoleValueRootIndex);
6046 // rsi: the-hole NaN 6051 // rsi: the-hole NaN
6047 // rdi: pointer to the-hole 6052 // rdi: pointer to the-hole
6048 __ jmp(&entry); 6053 __ jmp(&entry);
6049 6054
6050 // Call into runtime if GC is required. 6055 // Call into runtime if GC is required.
6051 __ bind(&gc_required); 6056 __ bind(&gc_required);
6052 __ pop(rax); 6057 __ pop(rax);
6053 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); 6058 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
6054 KeyedStoreIC::GenerateRuntimeSetProperty(masm, strict_mode); 6059 if (type == TRANSITION_ONLY) {
6060 __ pop(rbx);
6061 __ push(rdx);
6062 __ push(rbx); // return address
6063 __ TailCallRuntime(Runtime::kTransitionElementsDoubleToObject, 1, 1);
6064 } else {
6065 ASSERT(type == TRANSITION_AND_STORE);
6066 KeyedStoreIC::GenerateRuntimeSetProperty(masm, strict_mode);
6067 }
6055 6068
6056 // Box doubles into heap numbers. 6069 // Box doubles into heap numbers.
6057 __ bind(&loop); 6070 __ bind(&loop);
6058 __ decq(r9); 6071 __ decq(r9);
6059 __ movq(r14, FieldOperand(r8, 6072 __ movq(r14, FieldOperand(r8,
6060 r9, 6073 r9,
6061 times_pointer_size, 6074 times_pointer_size,
6062 FixedDoubleArray::kHeaderSize)); 6075 FixedDoubleArray::kHeaderSize));
6063 // r9 : current element's index 6076 // r9 : current element's index
6064 // r14: current element 6077 // r14: current element
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
6108 __ movq(FieldOperand(rdx, JSObject::kElementsOffset), rax); 6121 __ movq(FieldOperand(rdx, JSObject::kElementsOffset), rax);
6109 __ RecordWriteField(rdx, 6122 __ RecordWriteField(rdx,
6110 JSObject::kElementsOffset, 6123 JSObject::kElementsOffset,
6111 rax, 6124 rax,
6112 rdi, 6125 rdi,
6113 kDontSaveFPRegs, 6126 kDontSaveFPRegs,
6114 EMIT_REMEMBERED_SET, 6127 EMIT_REMEMBERED_SET,
6115 OMIT_SMI_CHECK); 6128 OMIT_SMI_CHECK);
6116 __ pop(rax); 6129 __ pop(rax);
6117 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); 6130 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
6131
6132 if (type == TRANSITION_ONLY) {
6133 __ movq(rax, rdx);
6134 __ Ret();
6135 }
6118 } 6136 }
6119 6137
6120 #undef __ 6138 #undef __
6121 6139
6122 } } // namespace v8::internal 6140 } } // namespace v8::internal
6123 6141
6124 #endif // V8_TARGET_ARCH_X64 6142 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698