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

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

Issue 214493002: Introduce rolp, rorp, rclp, rcrp, shlp, shrp and sarp for x64 port (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 6 years, 8 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 3096 matching lines...) Expand 10 before | Expand all | Expand 10 after
3107 __ addl(count, count); 3107 __ addl(count, count);
3108 } 3108 }
3109 3109
3110 // Don't enter the rep movs if there are less than 4 bytes to copy. 3110 // Don't enter the rep movs if there are less than 4 bytes to copy.
3111 Label last_bytes; 3111 Label last_bytes;
3112 __ testl(count, Immediate(~(kPointerSize - 1))); 3112 __ testl(count, Immediate(~(kPointerSize - 1)));
3113 __ j(zero, &last_bytes, Label::kNear); 3113 __ j(zero, &last_bytes, Label::kNear);
3114 3114
3115 // Copy from edi to esi using rep movs instruction. 3115 // Copy from edi to esi using rep movs instruction.
3116 __ movl(kScratchRegister, count); 3116 __ movl(kScratchRegister, count);
3117 __ shr(count, Immediate(kPointerSizeLog2)); // Number of doublewords to copy. 3117 // Number of doublewords to copy.
3118 __ shrl(count, Immediate(kPointerSizeLog2));
3118 __ repmovsp(); 3119 __ repmovsp();
3119 3120
3120 // Find number of bytes left. 3121 // Find number of bytes left.
3121 __ movl(count, kScratchRegister); 3122 __ movl(count, kScratchRegister);
3122 __ andp(count, Immediate(kPointerSize - 1)); 3123 __ andp(count, Immediate(kPointerSize - 1));
3123 3124
3124 // Check if there are more bytes to copy. 3125 // Check if there are more bytes to copy.
3125 __ bind(&last_bytes); 3126 __ bind(&last_bytes);
3126 __ testl(count, count); 3127 __ testl(count, count);
3127 __ j(zero, &done, Label::kNear); 3128 __ j(zero, &done, Label::kNear);
(...skipping 1882 matching lines...) Expand 10 before | Expand all | Expand 10 after
5010 } 5011 }
5011 5012
5012 // Figure out the right elements kind 5013 // Figure out the right elements kind
5013 __ movp(rcx, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset)); 5014 __ movp(rcx, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset));
5014 5015
5015 // Load the map's "bit field 2" into |result|. We only need the first byte, 5016 // Load the map's "bit field 2" into |result|. We only need the first byte,
5016 // but the following masking takes care of that anyway. 5017 // but the following masking takes care of that anyway.
5017 __ movzxbp(rcx, FieldOperand(rcx, Map::kBitField2Offset)); 5018 __ movzxbp(rcx, FieldOperand(rcx, Map::kBitField2Offset));
5018 // Retrieve elements_kind from bit field 2. 5019 // Retrieve elements_kind from bit field 2.
5019 __ andp(rcx, Immediate(Map::kElementsKindMask)); 5020 __ andp(rcx, Immediate(Map::kElementsKindMask));
5020 __ shr(rcx, Immediate(Map::kElementsKindShift)); 5021 __ shrp(rcx, Immediate(Map::kElementsKindShift));
5021 5022
5022 if (FLAG_debug_code) { 5023 if (FLAG_debug_code) {
5023 Label done; 5024 Label done;
5024 __ cmpl(rcx, Immediate(FAST_ELEMENTS)); 5025 __ cmpl(rcx, Immediate(FAST_ELEMENTS));
5025 __ j(equal, &done); 5026 __ j(equal, &done);
5026 __ cmpl(rcx, Immediate(FAST_HOLEY_ELEMENTS)); 5027 __ cmpl(rcx, Immediate(FAST_HOLEY_ELEMENTS));
5027 __ Assert(equal, 5028 __ Assert(equal,
5028 kInvalidElementsKindForInternalArrayOrInternalPackedArray); 5029 kInvalidElementsKindForInternalArrayOrInternalPackedArray);
5029 __ bind(&done); 5030 __ bind(&done);
5030 } 5031 }
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
5214 return_value_operand, 5215 return_value_operand,
5215 NULL); 5216 NULL);
5216 } 5217 }
5217 5218
5218 5219
5219 #undef __ 5220 #undef __
5220 5221
5221 } } // namespace v8::internal 5222 } } // namespace v8::internal
5222 5223
5223 #endif // V8_TARGET_ARCH_X64 5224 #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