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

Side by Side Diff: src/mips/lithium-codegen-mips.cc

Issue 352613003: MIPS: optimize Lithium Allocate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 | « no previous file | src/mips/lithium-mips.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.7 1 // Copyright 2012 the V8 project authors. All rights reserved.7
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 5273 matching lines...) Expand 10 before | Expand all | Expand 10 after
5284 } 5284 }
5285 if (instr->size()->IsConstantOperand()) { 5285 if (instr->size()->IsConstantOperand()) {
5286 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); 5286 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
5287 if (size <= Page::kMaxRegularHeapObjectSize) { 5287 if (size <= Page::kMaxRegularHeapObjectSize) {
5288 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); 5288 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags);
5289 } else { 5289 } else {
5290 __ jmp(deferred->entry()); 5290 __ jmp(deferred->entry());
5291 } 5291 }
5292 } else { 5292 } else {
5293 Register size = ToRegister(instr->size()); 5293 Register size = ToRegister(instr->size());
5294 __ Allocate(size, 5294 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags);
5295 result,
5296 scratch,
5297 scratch2,
5298 deferred->entry(),
5299 flags);
5300 } 5295 }
5301 5296
5302 __ bind(deferred->exit()); 5297 __ bind(deferred->exit());
5303 5298
5304 if (instr->hydrogen()->MustPrefillWithFiller()) { 5299 if (instr->hydrogen()->MustPrefillWithFiller()) {
5300 STATIC_ASSERT(kHeapObjectTag == 1);
5305 if (instr->size()->IsConstantOperand()) { 5301 if (instr->size()->IsConstantOperand()) {
5306 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); 5302 int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
5307 __ li(scratch, Operand(size)); 5303 __ li(scratch, Operand(size - kHeapObjectTag));
5308 } else { 5304 } else {
5309 scratch = ToRegister(instr->size()); 5305 __ Subu(scratch, ToRegister(instr->size()), Operand(kHeapObjectTag));
5310 } 5306 }
5311 __ Subu(scratch, scratch, Operand(kPointerSize)); 5307 __ li(scratch2, Operand(isolate()->factory()->one_pointer_filler_map()));
5312 __ Subu(result, result, Operand(kHeapObjectTag));
5313 Label loop; 5308 Label loop;
5314 __ bind(&loop); 5309 __ bind(&loop);
5315 __ li(scratch2, Operand(isolate()->factory()->one_pointer_filler_map())); 5310 __ Subu(scratch, scratch, Operand(kPointerSize));
5316 __ Addu(at, result, Operand(scratch)); 5311 __ Addu(at, result, Operand(scratch));
5317 __ sw(scratch2, MemOperand(at)); 5312 __ sw(scratch2, MemOperand(at));
5318 __ Subu(scratch, scratch, Operand(kPointerSize));
5319 __ Branch(&loop, ge, scratch, Operand(zero_reg)); 5313 __ Branch(&loop, ge, scratch, Operand(zero_reg));
5320 __ Addu(result, result, Operand(kHeapObjectTag));
5321 } 5314 }
5322 } 5315 }
5323 5316
5324 5317
5325 void LCodeGen::DoDeferredAllocate(LAllocate* instr) { 5318 void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
5326 Register result = ToRegister(instr->result()); 5319 Register result = ToRegister(instr->result());
5327 5320
5328 // TODO(3095996): Get rid of this. For now, we need to make the 5321 // TODO(3095996): Get rid of this. For now, we need to make the
5329 // result register contain a valid pointer because it is already 5322 // result register contain a valid pointer because it is already
5330 // contained in the register pointer map. 5323 // contained in the register pointer map.
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
5891 __ li(at, scope_info); 5884 __ li(at, scope_info);
5892 __ Push(at, ToRegister(instr->function())); 5885 __ Push(at, ToRegister(instr->function()));
5893 CallRuntime(Runtime::kHiddenPushBlockContext, 2, instr); 5886 CallRuntime(Runtime::kHiddenPushBlockContext, 2, instr);
5894 RecordSafepoint(Safepoint::kNoLazyDeopt); 5887 RecordSafepoint(Safepoint::kNoLazyDeopt);
5895 } 5888 }
5896 5889
5897 5890
5898 #undef __ 5891 #undef __
5899 5892
5900 } } // namespace v8::internal 5893 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698