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

Side by Side Diff: src/code-stub-assembler.cc

Issue 1907393002: Fix hash field access for 64-bit big-endian architectures. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/code-stub-assembler.h" 5 #include "src/code-stub-assembler.h"
6 #include "src/code-factory.h" 6 #include "src/code-factory.h"
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 10
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 Node* result = AllocateHeapNumber(); 602 Node* result = AllocateHeapNumber();
603 StoreHeapNumberValue(result, value); 603 StoreHeapNumberValue(result, value);
604 return result; 604 return result;
605 } 605 }
606 606
607 Node* CodeStubAssembler::AllocateSeqOneByteString(int length) { 607 Node* CodeStubAssembler::AllocateSeqOneByteString(int length) {
608 Node* result = Allocate(SeqOneByteString::SizeFor(length)); 608 Node* result = Allocate(SeqOneByteString::SizeFor(length));
609 StoreMapNoWriteBarrier(result, LoadRoot(Heap::kOneByteStringMapRootIndex)); 609 StoreMapNoWriteBarrier(result, LoadRoot(Heap::kOneByteStringMapRootIndex));
610 StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kLengthOffset, 610 StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kLengthOffset,
611 SmiConstant(Smi::FromInt(length))); 611 SmiConstant(Smi::FromInt(length)));
612 StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kHashFieldOffset, 612 StoreObjectFieldNoWriteBarrier(result, SeqOneByteString::kHashFieldSlot,
613 IntPtrConstant(String::kEmptyHashField)); 613 IntPtrConstant(String::kEmptyHashField));
614 return result; 614 return result;
615 } 615 }
616 616
617 Node* CodeStubAssembler::AllocateSeqTwoByteString(int length) { 617 Node* CodeStubAssembler::AllocateSeqTwoByteString(int length) {
618 Node* result = Allocate(SeqTwoByteString::SizeFor(length)); 618 Node* result = Allocate(SeqTwoByteString::SizeFor(length));
619 StoreMapNoWriteBarrier(result, LoadRoot(Heap::kStringMapRootIndex)); 619 StoreMapNoWriteBarrier(result, LoadRoot(Heap::kStringMapRootIndex));
620 StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kLengthOffset, 620 StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kLengthOffset,
621 SmiConstant(Smi::FromInt(length))); 621 SmiConstant(Smi::FromInt(length)));
622 StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kHashFieldOffset, 622 StoreObjectFieldNoWriteBarrier(result, SeqTwoByteString::kHashFieldSlot,
623 IntPtrConstant(String::kEmptyHashField)); 623 IntPtrConstant(String::kEmptyHashField));
624 return result; 624 return result;
625 } 625 }
626 626
627 Node* CodeStubAssembler::TruncateTaggedToFloat64(Node* context, Node* value) { 627 Node* CodeStubAssembler::TruncateTaggedToFloat64(Node* context, Node* value) {
628 // We might need to loop once due to ToNumber conversion. 628 // We might need to loop once due to ToNumber conversion.
629 Variable var_value(this, MachineRepresentation::kTagged), 629 Variable var_value(this, MachineRepresentation::kTagged),
630 var_result(this, MachineRepresentation::kFloat64); 630 var_result(this, MachineRepresentation::kFloat64);
631 Label loop(this, &var_value), done_loop(this, &var_result); 631 Label loop(this, &var_value), done_loop(this, &var_result);
632 var_value.Bind(value); 632 var_value.Bind(value);
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 } 1145 }
1146 1146
1147 Node* CodeStubAssembler::BitFieldDecode(Node* word32, uint32_t shift, 1147 Node* CodeStubAssembler::BitFieldDecode(Node* word32, uint32_t shift,
1148 uint32_t mask) { 1148 uint32_t mask) {
1149 return Word32Shr(Word32And(word32, Int32Constant(mask)), 1149 return Word32Shr(Word32And(word32, Int32Constant(mask)),
1150 Int32Constant(shift)); 1150 Int32Constant(shift));
1151 } 1151 }
1152 1152
1153 } // namespace internal 1153 } // namespace internal
1154 } // namespace v8 1154 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698