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

Side by Side Diff: src/mips/lithium-gap-resolver-mips.cc

Issue 57873004: MIPS: Handle constants in new space by making macro-assembler smarter. (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/mips/macro-assembler-mips.h » ('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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 249
250 } else if (source->IsConstantOperand()) { 250 } else if (source->IsConstantOperand()) {
251 LConstantOperand* constant_source = LConstantOperand::cast(source); 251 LConstantOperand* constant_source = LConstantOperand::cast(source);
252 if (destination->IsRegister()) { 252 if (destination->IsRegister()) {
253 Register dst = cgen_->ToRegister(destination); 253 Register dst = cgen_->ToRegister(destination);
254 Representation r = cgen_->IsSmi(constant_source) 254 Representation r = cgen_->IsSmi(constant_source)
255 ? Representation::Smi() : Representation::Integer32(); 255 ? Representation::Smi() : Representation::Integer32();
256 if (cgen_->IsInteger32(constant_source)) { 256 if (cgen_->IsInteger32(constant_source)) {
257 __ li(dst, Operand(cgen_->ToRepresentation(constant_source, r))); 257 __ li(dst, Operand(cgen_->ToRepresentation(constant_source, r)));
258 } else { 258 } else {
259 __ LoadObject(dst, cgen_->ToHandle(constant_source)); 259 __ li(dst, cgen_->ToHandle(constant_source));
260 } 260 }
261 } else if (destination->IsDoubleRegister()) { 261 } else if (destination->IsDoubleRegister()) {
262 DoubleRegister result = cgen_->ToDoubleRegister(destination); 262 DoubleRegister result = cgen_->ToDoubleRegister(destination);
263 double v = cgen_->ToDouble(constant_source); 263 double v = cgen_->ToDouble(constant_source);
264 __ Move(result, v); 264 __ Move(result, v);
265 } else { 265 } else {
266 ASSERT(destination->IsStackSlot()); 266 ASSERT(destination->IsStackSlot());
267 ASSERT(!in_cycle_); // Constant moves happen after all cycles are gone. 267 ASSERT(!in_cycle_); // Constant moves happen after all cycles are gone.
268 Representation r = cgen_->IsSmi(constant_source) 268 Representation r = cgen_->IsSmi(constant_source)
269 ? Representation::Smi() : Representation::Integer32(); 269 ? Representation::Smi() : Representation::Integer32();
270 if (cgen_->IsInteger32(constant_source)) { 270 if (cgen_->IsInteger32(constant_source)) {
271 __ li(kLithiumScratchReg, 271 __ li(kLithiumScratchReg,
272 Operand(cgen_->ToRepresentation(constant_source, r))); 272 Operand(cgen_->ToRepresentation(constant_source, r)));
273 } else { 273 } else {
274 __ LoadObject(kLithiumScratchReg, 274 __ li(kLithiumScratchReg, cgen_->ToHandle(constant_source));
275 cgen_->ToHandle(constant_source));
276 } 275 }
277 __ sw(kLithiumScratchReg, cgen_->ToMemOperand(destination)); 276 __ sw(kLithiumScratchReg, cgen_->ToMemOperand(destination));
278 } 277 }
279 278
280 } else if (source->IsDoubleRegister()) { 279 } else if (source->IsDoubleRegister()) {
281 DoubleRegister source_register = cgen_->ToDoubleRegister(source); 280 DoubleRegister source_register = cgen_->ToDoubleRegister(source);
282 if (destination->IsDoubleRegister()) { 281 if (destination->IsDoubleRegister()) {
283 __ mov_d(cgen_->ToDoubleRegister(destination), source_register); 282 __ mov_d(cgen_->ToDoubleRegister(destination), source_register);
284 } else { 283 } else {
285 ASSERT(destination->IsDoubleStackSlot()); 284 ASSERT(destination->IsDoubleStackSlot());
(...skipping 28 matching lines...) Expand all
314 UNREACHABLE(); 313 UNREACHABLE();
315 } 314 }
316 315
317 moves_[index].Eliminate(); 316 moves_[index].Eliminate();
318 } 317 }
319 318
320 319
321 #undef __ 320 #undef __
322 321
323 } } // namespace v8::internal 322 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/mips/macro-assembler-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698