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

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

Issue 10170030: Implement tracking and optimizations of packed arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 8 years, 7 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/builtins-x64.cc ('k') | src/x64/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 // 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 5975 matching lines...) Expand 10 before | Expand all | Expand 10 after
5986 // GenerateStoreField calls the stub with two different permutations of 5986 // GenerateStoreField calls the stub with two different permutations of
5987 // registers. This is the second. 5987 // registers. This is the second.
5988 { REG(rbx), REG(rcx), REG(rdx), EMIT_REMEMBERED_SET }, 5988 { REG(rbx), REG(rcx), REG(rdx), EMIT_REMEMBERED_SET },
5989 // StoreIC::GenerateNormal via GenerateDictionaryStore. 5989 // StoreIC::GenerateNormal via GenerateDictionaryStore.
5990 { REG(rbx), REG(r8), REG(r9), EMIT_REMEMBERED_SET }, 5990 { REG(rbx), REG(r8), REG(r9), EMIT_REMEMBERED_SET },
5991 // KeyedStoreIC::GenerateGeneric. 5991 // KeyedStoreIC::GenerateGeneric.
5992 { REG(rbx), REG(rdx), REG(rcx), EMIT_REMEMBERED_SET}, 5992 { REG(rbx), REG(rdx), REG(rcx), EMIT_REMEMBERED_SET},
5993 // KeyedStoreStubCompiler::GenerateStoreFastElement. 5993 // KeyedStoreStubCompiler::GenerateStoreFastElement.
5994 { REG(rdi), REG(rbx), REG(rcx), EMIT_REMEMBERED_SET}, 5994 { REG(rdi), REG(rbx), REG(rcx), EMIT_REMEMBERED_SET},
5995 { REG(rdx), REG(rdi), REG(rbx), EMIT_REMEMBERED_SET}, 5995 { REG(rdx), REG(rdi), REG(rbx), EMIT_REMEMBERED_SET},
5996 // ElementsTransitionGenerator::GenerateSmiOnlyToObject 5996 // ElementsTransitionGenerator::GenerateMapChangeElementTransition
5997 // and ElementsTransitionGenerator::GenerateSmiOnlyToObject 5997 // and ElementsTransitionGenerator::GenerateSmiToDouble
5998 // and ElementsTransitionGenerator::GenerateDoubleToObject 5998 // and ElementsTransitionGenerator::GenerateDoubleToObject
5999 { REG(rdx), REG(rbx), REG(rdi), EMIT_REMEMBERED_SET}, 5999 { REG(rdx), REG(rbx), REG(rdi), EMIT_REMEMBERED_SET},
6000 { REG(rdx), REG(rbx), REG(rdi), OMIT_REMEMBERED_SET}, 6000 { REG(rdx), REG(rbx), REG(rdi), OMIT_REMEMBERED_SET},
6001 // ElementsTransitionGenerator::GenerateSmiOnlyToDouble 6001 // ElementsTransitionGenerator::GenerateSmiToDouble
6002 // and ElementsTransitionGenerator::GenerateDoubleToObject 6002 // and ElementsTransitionGenerator::GenerateDoubleToObject
6003 { REG(rdx), REG(r11), REG(r15), EMIT_REMEMBERED_SET}, 6003 { REG(rdx), REG(r11), REG(r15), EMIT_REMEMBERED_SET},
6004 // ElementsTransitionGenerator::GenerateDoubleToObject 6004 // ElementsTransitionGenerator::GenerateDoubleToObject
6005 { REG(r11), REG(rax), REG(r15), EMIT_REMEMBERED_SET}, 6005 { REG(r11), REG(rax), REG(r15), EMIT_REMEMBERED_SET},
6006 // StoreArrayLiteralElementStub::Generate 6006 // StoreArrayLiteralElementStub::Generate
6007 { REG(rbx), REG(rax), REG(rcx), EMIT_REMEMBERED_SET}, 6007 { REG(rbx), REG(rax), REG(rcx), EMIT_REMEMBERED_SET},
6008 // Null termination. 6008 // Null termination.
6009 { REG(no_reg), REG(no_reg), REG(no_reg), EMIT_REMEMBERED_SET} 6009 { REG(no_reg), REG(no_reg), REG(no_reg), EMIT_REMEMBERED_SET}
6010 }; 6010 };
6011 6011
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
6265 // ----------------------------------- 6265 // -----------------------------------
6266 6266
6267 Label element_done; 6267 Label element_done;
6268 Label double_elements; 6268 Label double_elements;
6269 Label smi_element; 6269 Label smi_element;
6270 Label slow_elements; 6270 Label slow_elements;
6271 Label fast_elements; 6271 Label fast_elements;
6272 6272
6273 __ CheckFastElements(rdi, &double_elements); 6273 __ CheckFastElements(rdi, &double_elements);
6274 6274
6275 // FAST_SMI_ONLY_ELEMENTS or FAST_ELEMENTS 6275 // FAST_*_SMI_ELEMENTS or FAST_*_ELEMENTS
6276 __ JumpIfSmi(rax, &smi_element); 6276 __ JumpIfSmi(rax, &smi_element);
6277 __ CheckFastSmiOnlyElements(rdi, &fast_elements); 6277 __ CheckFastSmiElements(rdi, &fast_elements);
6278 6278
6279 // Store into the array literal requires a elements transition. Call into 6279 // Store into the array literal requires a elements transition. Call into
6280 // the runtime. 6280 // the runtime.
6281 6281
6282 __ bind(&slow_elements); 6282 __ bind(&slow_elements);
6283 __ pop(rdi); // Pop return address and remember to put back later for tail 6283 __ pop(rdi); // Pop return address and remember to put back later for tail
6284 // call. 6284 // call.
6285 __ push(rbx); 6285 __ push(rbx);
6286 __ push(rcx); 6286 __ push(rcx);
6287 __ push(rax); 6287 __ push(rax);
6288 __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); 6288 __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
6289 __ push(FieldOperand(rbx, JSFunction::kLiteralsOffset)); 6289 __ push(FieldOperand(rbx, JSFunction::kLiteralsOffset));
6290 __ push(rdx); 6290 __ push(rdx);
6291 __ push(rdi); // Return return address so that tail call returns to right 6291 __ push(rdi); // Return return address so that tail call returns to right
6292 // place. 6292 // place.
6293 __ TailCallRuntime(Runtime::kStoreArrayLiteralElement, 5, 1); 6293 __ TailCallRuntime(Runtime::kStoreArrayLiteralElement, 5, 1);
6294 6294
6295 // Array literal has ElementsKind of FAST_ELEMENTS and value is an object. 6295 // Array literal has ElementsKind of FAST_*_ELEMENTS and value is an object.
6296 __ bind(&fast_elements); 6296 __ bind(&fast_elements);
6297 __ SmiToInteger32(kScratchRegister, rcx); 6297 __ SmiToInteger32(kScratchRegister, rcx);
6298 __ movq(rbx, FieldOperand(rbx, JSObject::kElementsOffset)); 6298 __ movq(rbx, FieldOperand(rbx, JSObject::kElementsOffset));
6299 __ lea(rcx, FieldOperand(rbx, kScratchRegister, times_pointer_size, 6299 __ lea(rcx, FieldOperand(rbx, kScratchRegister, times_pointer_size,
6300 FixedArrayBase::kHeaderSize)); 6300 FixedArrayBase::kHeaderSize));
6301 __ movq(Operand(rcx, 0), rax); 6301 __ movq(Operand(rcx, 0), rax);
6302 // Update the write barrier for the array store. 6302 // Update the write barrier for the array store.
6303 __ RecordWrite(rbx, rcx, rax, 6303 __ RecordWrite(rbx, rcx, rax,
6304 kDontSaveFPRegs, 6304 kDontSaveFPRegs,
6305 EMIT_REMEMBERED_SET, 6305 EMIT_REMEMBERED_SET,
6306 OMIT_SMI_CHECK); 6306 OMIT_SMI_CHECK);
6307 __ ret(0); 6307 __ ret(0);
6308 6308
6309 // Array literal has ElementsKind of FAST_SMI_ONLY_ELEMENTS or 6309 // Array literal has ElementsKind of FAST_*_SMI_ELEMENTS or
6310 // FAST_ELEMENTS, and value is Smi. 6310 // FAST_*_ELEMENTS, and value is Smi.
6311 __ bind(&smi_element); 6311 __ bind(&smi_element);
6312 __ SmiToInteger32(kScratchRegister, rcx); 6312 __ SmiToInteger32(kScratchRegister, rcx);
6313 __ movq(rbx, FieldOperand(rbx, JSObject::kElementsOffset)); 6313 __ movq(rbx, FieldOperand(rbx, JSObject::kElementsOffset));
6314 __ movq(FieldOperand(rbx, kScratchRegister, times_pointer_size, 6314 __ movq(FieldOperand(rbx, kScratchRegister, times_pointer_size,
6315 FixedArrayBase::kHeaderSize), rax); 6315 FixedArrayBase::kHeaderSize), rax);
6316 __ ret(0); 6316 __ ret(0);
6317 6317
6318 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS. 6318 // Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS.
6319 __ bind(&double_elements); 6319 __ bind(&double_elements);
6320 6320
6321 __ movq(r9, FieldOperand(rbx, JSObject::kElementsOffset)); 6321 __ movq(r9, FieldOperand(rbx, JSObject::kElementsOffset));
6322 __ SmiToInteger32(r11, rcx); 6322 __ SmiToInteger32(r11, rcx);
6323 __ StoreNumberToDoubleElements(rax, 6323 __ StoreNumberToDoubleElements(rax,
6324 r9, 6324 r9,
6325 r11, 6325 r11,
6326 xmm0, 6326 xmm0,
6327 &slow_elements); 6327 &slow_elements);
6328 __ ret(0); 6328 __ ret(0);
6329 } 6329 }
6330 6330
6331 #undef __ 6331 #undef __
6332 6332
6333 } } // namespace v8::internal 6333 } } // namespace v8::internal
6334 6334
6335 #endif // V8_TARGET_ARCH_X64 6335 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/builtins-x64.cc ('k') | src/x64/codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698