OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
894 scratch1, | 894 scratch1, |
895 result, | 895 result, |
896 scratch2, | 896 scratch2, |
897 scratch3, | 897 scratch3, |
898 gc_required, | 898 gc_required, |
899 TAG_OBJECT); | 899 TAG_OBJECT); |
900 | 900 |
901 // Set the map, length and hash field. | 901 // Set the map, length and hash field. |
902 mov(FieldOperand(result, HeapObject::kMapOffset), | 902 mov(FieldOperand(result, HeapObject::kMapOffset), |
903 Immediate(Factory::string_map())); | 903 Immediate(Factory::string_map())); |
904 mov(scratch1, length); | 904 mov(FieldOperand(result, String::kLengthOffset), length); |
905 SmiTag(scratch1); | |
906 mov(FieldOperand(result, String::kLengthOffset), scratch1); | |
907 mov(FieldOperand(result, String::kHashFieldOffset), | 905 mov(FieldOperand(result, String::kHashFieldOffset), |
908 Immediate(String::kEmptyHashField)); | 906 Immediate(String::kEmptyHashField)); |
909 } | 907 } |
910 | 908 |
911 | 909 |
912 void MacroAssembler::AllocateAsciiString(Register result, | 910 void MacroAssembler::AllocateAsciiString(Register result, |
913 Register length, | 911 Register length, |
914 Register scratch1, | 912 Register scratch1, |
915 Register scratch2, | 913 Register scratch2, |
916 Register scratch3, | 914 Register scratch3, |
(...skipping 12 matching lines...) Expand all Loading... |
929 scratch1, | 927 scratch1, |
930 result, | 928 result, |
931 scratch2, | 929 scratch2, |
932 scratch3, | 930 scratch3, |
933 gc_required, | 931 gc_required, |
934 TAG_OBJECT); | 932 TAG_OBJECT); |
935 | 933 |
936 // Set the map, length and hash field. | 934 // Set the map, length and hash field. |
937 mov(FieldOperand(result, HeapObject::kMapOffset), | 935 mov(FieldOperand(result, HeapObject::kMapOffset), |
938 Immediate(Factory::ascii_string_map())); | 936 Immediate(Factory::ascii_string_map())); |
939 mov(scratch1, length); | 937 mov(FieldOperand(result, String::kLengthOffset), length); |
940 SmiTag(scratch1); | |
941 mov(FieldOperand(result, String::kLengthOffset), scratch1); | |
942 mov(FieldOperand(result, String::kHashFieldOffset), | 938 mov(FieldOperand(result, String::kHashFieldOffset), |
943 Immediate(String::kEmptyHashField)); | 939 Immediate(String::kEmptyHashField)); |
944 } | 940 } |
945 | 941 |
946 | 942 |
947 void MacroAssembler::AllocateConsString(Register result, | 943 void MacroAssembler::AllocateConsString(Register result, |
948 Register scratch1, | 944 Register scratch1, |
949 Register scratch2, | 945 Register scratch2, |
950 Label* gc_required) { | 946 Label* gc_required) { |
951 // Allocate heap number in new space. | 947 // Allocate heap number in new space. |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1690 // Indicate that code has changed. | 1686 // Indicate that code has changed. |
1691 CPU::FlushICache(address_, size_); | 1687 CPU::FlushICache(address_, size_); |
1692 | 1688 |
1693 // Check that the code was patched as expected. | 1689 // Check that the code was patched as expected. |
1694 ASSERT(masm_.pc_ == address_ + size_); | 1690 ASSERT(masm_.pc_ == address_ + size_); |
1695 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 1691 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
1696 } | 1692 } |
1697 | 1693 |
1698 | 1694 |
1699 } } // namespace v8::internal | 1695 } } // namespace v8::internal |
OLD | NEW |