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

Side by Side Diff: src/arm/lithium-arm.cc

Issue 330053002: ARM, ARM64: Optimize array copy (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | « src/arm/lithium-arm.h ('k') | src/arm/lithium-codegen-arm.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/lithium-allocator-inl.h" 7 #include "src/lithium-allocator-inl.h"
8 #include "src/arm/lithium-arm.h" 8 #include "src/arm/lithium-arm.h"
9 #include "src/arm/lithium-codegen-arm.h" 9 #include "src/arm/lithium-codegen-arm.h"
10 #include "src/hydrogen-osr.h" 10 #include "src/hydrogen-osr.h"
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 stream->Add("["); 337 stream->Add("[");
338 key()->PrintTo(stream); 338 key()->PrintTo(stream);
339 if (hydrogen()->IsDehoisted()) { 339 if (hydrogen()->IsDehoisted()) {
340 stream->Add(" + %d]", base_offset()); 340 stream->Add(" + %d]", base_offset());
341 } else { 341 } else {
342 stream->Add("]"); 342 stream->Add("]");
343 } 343 }
344 } 344 }
345 345
346 346
347 void LFillElements::PrintDataTo(StringStream* stream) {
348 elements()->PrintTo(stream);
349 stream->Add("[");
350 from()->PrintTo(stream);
351 stream->Add("-");
352 to()->PrintTo(stream);
353 stream->Add("] <- ");
354 value()->PrintTo(stream);
355 }
356
357
358 void LCopyElements::PrintDataTo(StringStream* stream) {
359 dst()->PrintTo(stream);
360 stream->Add("[0-");
361 length()->PrintTo(stream);
362 stream->Add("] <- ");
363 src()->PrintTo(stream);
364 stream->Add("[0-");
365 length()->PrintTo(stream);
366 stream->Add("]");
367 }
368
369
347 void LStoreKeyed::PrintDataTo(StringStream* stream) { 370 void LStoreKeyed::PrintDataTo(StringStream* stream) {
348 elements()->PrintTo(stream); 371 elements()->PrintTo(stream);
349 stream->Add("["); 372 stream->Add("[");
350 key()->PrintTo(stream); 373 key()->PrintTo(stream);
351 if (hydrogen()->IsDehoisted()) { 374 if (hydrogen()->IsDehoisted()) {
352 stream->Add(" + %d] <-", base_offset()); 375 stream->Add(" + %d] <-", base_offset());
353 } else { 376 } else {
354 stream->Add("] <- "); 377 stream->Add("] <- ");
355 } 378 }
356 379
(...skipping 1843 matching lines...) Expand 10 before | Expand all | Expand 10 after
2200 LOperand* context = UseFixed(instr->context(), cp); 2223 LOperand* context = UseFixed(instr->context(), cp);
2201 LOperand* object = UseFixed(instr->object(), r1); 2224 LOperand* object = UseFixed(instr->object(), r1);
2202 LOperand* key = UseFixed(instr->key(), r0); 2225 LOperand* key = UseFixed(instr->key(), r0);
2203 2226
2204 LInstruction* result = 2227 LInstruction* result =
2205 DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key), r0); 2228 DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key), r0);
2206 return MarkAsCall(result, instr); 2229 return MarkAsCall(result, instr);
2207 } 2230 }
2208 2231
2209 2232
2233 LInstruction* LChunkBuilder::DoFillElements(HFillElements* instr) {
2234 LOperand* elements = UseRegister(instr->elements());
2235 LOperand* from = UseRegisterOrConstant(instr->from());
2236 LOperand* to = UseRegisterOrConstant(instr->to());
2237 LOperand* value = UseRegister(instr->value());
2238 LOperand* scratch;
2239 if (instr->from()->IsConstant() && instr->to()->IsConstant()) {
2240 HConstant* from = HConstant::cast(instr->from());
2241 HConstant* to = HConstant::cast(instr->to());
2242 scratch =
2243 (to->Integer32Value() - from->Integer32Value() <=
2244 LFillElements::kMaxUnrolledSize) ?
2245 NULL : TempRegister();
2246 } else {
2247 scratch = TempRegister();
2248 }
2249 return new(zone()) LFillElements(elements, from, to, value, scratch);
2250 }
2251
2252
2253 LInstruction* LChunkBuilder::DoCopyElements(HCopyElements* instr) {
2254 LOperand* src = UseTempRegister(instr->src());
2255 LOperand* dst = UseTempRegister(instr->dst());
2256 LOperand* length = UseTempRegister(instr->length());
2257 return new(zone()) LCopyElements(src, dst, length);
2258 }
2259
2260
2210 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { 2261 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
2211 if (!instr->is_typed_elements()) { 2262 if (!instr->is_typed_elements()) {
2212 ASSERT(instr->elements()->representation().IsTagged()); 2263 ASSERT(instr->elements()->representation().IsTagged());
2213 bool needs_write_barrier = instr->NeedsWriteBarrier(); 2264 bool needs_write_barrier = instr->NeedsWriteBarrier();
2214 LOperand* object = NULL; 2265 LOperand* object = NULL;
2215 LOperand* key = NULL; 2266 LOperand* key = NULL;
2216 LOperand* val = NULL; 2267 LOperand* val = NULL;
2217 2268
2218 if (instr->value()->representation().IsDouble()) { 2269 if (instr->value()->representation().IsDouble()) {
2219 object = UseRegisterAtStart(instr->elements()); 2270 object = UseRegisterAtStart(instr->elements());
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
2589 LInstruction* LChunkBuilder::DoAllocateBlockContext( 2640 LInstruction* LChunkBuilder::DoAllocateBlockContext(
2590 HAllocateBlockContext* instr) { 2641 HAllocateBlockContext* instr) {
2591 LOperand* context = UseFixed(instr->context(), cp); 2642 LOperand* context = UseFixed(instr->context(), cp);
2592 LOperand* function = UseRegisterAtStart(instr->function()); 2643 LOperand* function = UseRegisterAtStart(instr->function());
2593 LAllocateBlockContext* result = 2644 LAllocateBlockContext* result =
2594 new(zone()) LAllocateBlockContext(context, function); 2645 new(zone()) LAllocateBlockContext(context, function);
2595 return MarkAsCall(DefineFixed(result, cp), instr); 2646 return MarkAsCall(DefineFixed(result, cp), instr);
2596 } 2647 }
2597 2648
2598 } } // namespace v8::internal 2649 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.h ('k') | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698