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

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

Issue 11878019: Merged r13230, r13258 into 3.15 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.15
Patch Set: Created 7 years, 11 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/full-codegen-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. 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 if (!fpu_supported) __ Push(a1, a0); 239 if (!fpu_supported) __ Push(a1, a0);
240 240
241 __ Branch(&entry); 241 __ Branch(&entry);
242 242
243 __ bind(&only_change_map); 243 __ bind(&only_change_map);
244 __ sw(a3, FieldMemOperand(a2, HeapObject::kMapOffset)); 244 __ sw(a3, FieldMemOperand(a2, HeapObject::kMapOffset));
245 __ RecordWriteField(a2, 245 __ RecordWriteField(a2,
246 HeapObject::kMapOffset, 246 HeapObject::kMapOffset,
247 a3, 247 a3,
248 t5, 248 t5,
249 kRAHasBeenSaved, 249 kRAHasNotBeenSaved,
250 kDontSaveFPRegs, 250 kDontSaveFPRegs,
251 OMIT_REMEMBERED_SET, 251 OMIT_REMEMBERED_SET,
252 OMIT_SMI_CHECK); 252 OMIT_SMI_CHECK);
253 __ Branch(&done); 253 __ Branch(&done);
254 254
255 // Call into runtime if GC is required. 255 // Call into runtime if GC is required.
256 __ bind(&gc_required); 256 __ bind(&gc_required);
257 __ pop(ra); 257 __ pop(ra);
258 __ Branch(fail); 258 __ Branch(fail);
259 259
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 __ lhu(result, MemOperand(at)); 510 __ lhu(result, MemOperand(at));
511 __ jmp(&done); 511 __ jmp(&done);
512 __ bind(&ascii); 512 __ bind(&ascii);
513 // Ascii string. 513 // Ascii string.
514 __ Addu(at, string, index); 514 __ Addu(at, string, index);
515 __ lbu(result, MemOperand(at)); 515 __ lbu(result, MemOperand(at));
516 __ bind(&done); 516 __ bind(&done);
517 } 517 }
518 518
519 519
520 void SeqStringSetCharGenerator::Generate(MacroAssembler* masm,
521 String::Encoding encoding,
522 Register string,
523 Register index,
524 Register value) {
525 if (FLAG_debug_code) {
526 __ And(at, index, Operand(kSmiTagMask));
527 __ Check(eq, "Non-smi index", at, Operand(zero_reg));
528 __ And(at, value, Operand(kSmiTagMask));
529 __ Check(eq, "Non-smi value", at, Operand(zero_reg));
530
531 __ lw(at, FieldMemOperand(string, String::kLengthOffset));
532 __ Check(lt, "Index is too large", at, Operand(index));
533
534 __ Check(ge, "Index is negative", index, Operand(Smi::FromInt(0)));
535
536 __ lw(at, FieldMemOperand(string, HeapObject::kMapOffset));
537 __ lbu(at, FieldMemOperand(at, Map::kInstanceTypeOffset));
538
539 __ And(at, at, Operand(kStringRepresentationMask | kStringEncodingMask));
540 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag;
541 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag;
542 __ Check(eq, "Unexpected string type", at,
543 Operand(encoding == String::ONE_BYTE_ENCODING
544 ? one_byte_seq_type : two_byte_seq_type));
545 }
546
547 __ Addu(at,
548 string,
549 Operand(SeqString::kHeaderSize - kHeapObjectTag));
550 __ SmiUntag(value);
551 STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0);
552 if (encoding == String::ONE_BYTE_ENCODING) {
553 __ SmiUntag(index);
554 __ Addu(at, at, index);
555 __ sb(value, MemOperand(at));
556 } else {
557 // No need to untag a smi for two-byte addressing.
558 __ Addu(at, at, index);
559 __ sh(value, MemOperand(at));
560 }
561 }
562
563
520 static MemOperand ExpConstant(int index, Register base) { 564 static MemOperand ExpConstant(int index, Register base) {
521 return MemOperand(base, index * kDoubleSize); 565 return MemOperand(base, index * kDoubleSize);
522 } 566 }
523 567
524 568
525 void MathExpGenerator::EmitMathExp(MacroAssembler* masm, 569 void MathExpGenerator::EmitMathExp(MacroAssembler* masm,
526 DoubleRegister input, 570 DoubleRegister input,
527 DoubleRegister result, 571 DoubleRegister result,
528 DoubleRegister double_scratch1, 572 DoubleRegister double_scratch1,
529 DoubleRegister double_scratch2, 573 DoubleRegister double_scratch2,
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start())); 704 patcher.masm()->dd(reinterpret_cast<uint32_t>(stub->instruction_start()));
661 } 705 }
662 } 706 }
663 707
664 708
665 #undef __ 709 #undef __
666 710
667 } } // namespace v8::internal 711 } } // namespace v8::internal
668 712
669 #endif // V8_TARGET_ARCH_MIPS 713 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | src/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698