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

Side by Side Diff: src/ia32/macro-assembler-ia32.cc

Issue 7744052: Generated code for substring slices in ia32. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Another set of small changes. Created 9 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
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 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1201 scratch2, 1201 scratch2,
1202 gc_required, 1202 gc_required,
1203 TAG_OBJECT); 1203 TAG_OBJECT);
1204 1204
1205 // Set the map. The other fields are left uninitialized. 1205 // Set the map. The other fields are left uninitialized.
1206 mov(FieldOperand(result, HeapObject::kMapOffset), 1206 mov(FieldOperand(result, HeapObject::kMapOffset),
1207 Immediate(isolate()->factory()->cons_ascii_string_map())); 1207 Immediate(isolate()->factory()->cons_ascii_string_map()));
1208 } 1208 }
1209 1209
1210 1210
1211 void MacroAssembler::AllocateSlicedString(Register result,
1212 Register scratch1,
1213 Register scratch2,
1214 Label* gc_required) {
1215 // Allocate heap number in new space.
1216 AllocateInNewSpace(SlicedString::kSize,
1217 result,
1218 scratch1,
1219 scratch2,
1220 gc_required,
1221 TAG_OBJECT);
1222
1223 // Set the map. The other fields are left uninitialized.
1224 mov(FieldOperand(result, HeapObject::kMapOffset),
1225 Immediate(isolate()->factory()->sliced_string_map()));
1226 }
1227
1228
1229 void MacroAssembler::AllocateAsciiSlicedString(Register result,
1230 Register scratch1,
1231 Register scratch2,
1232 Label* gc_required) {
1233 // Allocate heap number in new space.
1234 AllocateInNewSpace(SlicedString::kSize,
1235 result,
1236 scratch1,
1237 scratch2,
1238 gc_required,
1239 TAG_OBJECT);
1240
1241 // Set the map. The other fields are left uninitialized.
1242 mov(FieldOperand(result, HeapObject::kMapOffset),
1243 Immediate(isolate()->factory()->sliced_ascii_string_map()));
1244 }
1245
1246
1211 // Copy memory, byte-by-byte, from source to destination. Not optimized for 1247 // Copy memory, byte-by-byte, from source to destination. Not optimized for
1212 // long or aligned copies. The contents of scratch and length are destroyed. 1248 // long or aligned copies. The contents of scratch and length are destroyed.
1213 // Source and destination are incremented by length. 1249 // Source and destination are incremented by length.
1214 // Many variants of movsb, loop unrolling, word moves, and indexed operands 1250 // Many variants of movsb, loop unrolling, word moves, and indexed operands
1215 // have been tried here already, and this is fastest. 1251 // have been tried here already, and this is fastest.
1216 // A simpler loop is faster on small copies, but 30% slower on large ones. 1252 // A simpler loop is faster on small copies, but 30% slower on large ones.
1217 // The cld() instruction must have been emitted, to set the direction flag(), 1253 // The cld() instruction must have been emitted, to set the direction flag(),
1218 // before calling this function. 1254 // before calling this function.
1219 void MacroAssembler::CopyBytes(Register source, 1255 void MacroAssembler::CopyBytes(Register source,
1220 Register destination, 1256 Register destination,
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
2248 2284
2249 // Check that the code was patched as expected. 2285 // Check that the code was patched as expected.
2250 ASSERT(masm_.pc_ == address_ + size_); 2286 ASSERT(masm_.pc_ == address_ + size_);
2251 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); 2287 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap);
2252 } 2288 }
2253 2289
2254 2290
2255 } } // namespace v8::internal 2291 } } // namespace v8::internal
2256 2292
2257 #endif // V8_TARGET_ARCH_IA32 2293 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698