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

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

Issue 1579613002: [builtins] Refactor the remaining Date builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: As per offline discussion, remove the weird test, which does not add a lot of value. Created 4 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
« no previous file with comments | « src/crankshaft/ia32/lithium-ia32.cc ('k') | src/crankshaft/mips/lithium-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.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 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after
1652 } 1652 }
1653 1653
1654 1654
1655 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { 1655 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) {
1656 Register result = ToRegister(instr->result()); 1656 Register result = ToRegister(instr->result());
1657 Register map = ToRegister(instr->value()); 1657 Register map = ToRegister(instr->value());
1658 __ EnumLength(result, map); 1658 __ EnumLength(result, map);
1659 } 1659 }
1660 1660
1661 1661
1662 void LCodeGen::DoDateField(LDateField* instr) {
1663 Register object = ToRegister(instr->date());
1664 Register result = ToRegister(instr->result());
1665 Register scratch = ToRegister(instr->temp());
1666 Smi* index = instr->index();
1667 DCHECK(object.is(a0));
1668 DCHECK(result.is(v0));
1669 DCHECK(!scratch.is(scratch0()));
1670 DCHECK(!scratch.is(object));
1671
1672 if (index->value() == 0) {
1673 __ lw(result, FieldMemOperand(object, JSDate::kValueOffset));
1674 } else {
1675 Label runtime, done;
1676 if (index->value() < JSDate::kFirstUncachedField) {
1677 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate());
1678 __ li(scratch, Operand(stamp));
1679 __ lw(scratch, MemOperand(scratch));
1680 __ lw(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset));
1681 __ Branch(&runtime, ne, scratch, Operand(scratch0()));
1682 __ lw(result, FieldMemOperand(object, JSDate::kValueOffset +
1683 kPointerSize * index->value()));
1684 __ jmp(&done);
1685 }
1686 __ bind(&runtime);
1687 __ PrepareCallCFunction(2, scratch);
1688 __ li(a1, Operand(index));
1689 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2);
1690 __ bind(&done);
1691 }
1692 }
1693
1694
1695 MemOperand LCodeGen::BuildSeqStringOperand(Register string, 1662 MemOperand LCodeGen::BuildSeqStringOperand(Register string,
1696 LOperand* index, 1663 LOperand* index,
1697 String::Encoding encoding) { 1664 String::Encoding encoding) {
1698 if (index->IsConstantOperand()) { 1665 if (index->IsConstantOperand()) {
1699 int offset = ToInteger32(LConstantOperand::cast(index)); 1666 int offset = ToInteger32(LConstantOperand::cast(index));
1700 if (encoding == String::TWO_BYTE_ENCODING) { 1667 if (encoding == String::TWO_BYTE_ENCODING) {
1701 offset *= kUC16Size; 1668 offset *= kUC16Size;
1702 } 1669 }
1703 STATIC_ASSERT(kCharSize == 1); 1670 STATIC_ASSERT(kCharSize == 1);
1704 return FieldMemOperand(string, SeqString::kHeaderSize + offset); 1671 return FieldMemOperand(string, SeqString::kHeaderSize + offset);
(...skipping 3956 matching lines...) Expand 10 before | Expand all | Expand 10 after
5661 __ Push(at, ToRegister(instr->function())); 5628 __ Push(at, ToRegister(instr->function()));
5662 CallRuntime(Runtime::kPushBlockContext, instr); 5629 CallRuntime(Runtime::kPushBlockContext, instr);
5663 RecordSafepoint(Safepoint::kNoLazyDeopt); 5630 RecordSafepoint(Safepoint::kNoLazyDeopt);
5664 } 5631 }
5665 5632
5666 5633
5667 #undef __ 5634 #undef __
5668 5635
5669 } // namespace internal 5636 } // namespace internal
5670 } // namespace v8 5637 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/ia32/lithium-ia32.cc ('k') | src/crankshaft/mips/lithium-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698