| 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 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 scratch1, | 903 scratch1, |
| 904 result, | 904 result, |
| 905 scratch2, | 905 scratch2, |
| 906 scratch3, | 906 scratch3, |
| 907 gc_required, | 907 gc_required, |
| 908 TAG_OBJECT); | 908 TAG_OBJECT); |
| 909 | 909 |
| 910 // Set the map, length and hash field. | 910 // Set the map, length and hash field. |
| 911 mov(FieldOperand(result, HeapObject::kMapOffset), | 911 mov(FieldOperand(result, HeapObject::kMapOffset), |
| 912 Immediate(Factory::string_map())); | 912 Immediate(Factory::string_map())); |
| 913 mov(FieldOperand(result, String::kLengthOffset), length); | 913 mov(scratch1, length); |
| 914 SmiTag(scratch1); |
| 915 mov(FieldOperand(result, String::kLengthOffset), scratch1); |
| 914 mov(FieldOperand(result, String::kHashFieldOffset), | 916 mov(FieldOperand(result, String::kHashFieldOffset), |
| 915 Immediate(String::kEmptyHashField)); | 917 Immediate(String::kEmptyHashField)); |
| 916 } | 918 } |
| 917 | 919 |
| 918 | 920 |
| 919 void MacroAssembler::AllocateAsciiString(Register result, | 921 void MacroAssembler::AllocateAsciiString(Register result, |
| 920 Register length, | 922 Register length, |
| 921 Register scratch1, | 923 Register scratch1, |
| 922 Register scratch2, | 924 Register scratch2, |
| 923 Register scratch3, | 925 Register scratch3, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 936 scratch1, | 938 scratch1, |
| 937 result, | 939 result, |
| 938 scratch2, | 940 scratch2, |
| 939 scratch3, | 941 scratch3, |
| 940 gc_required, | 942 gc_required, |
| 941 TAG_OBJECT); | 943 TAG_OBJECT); |
| 942 | 944 |
| 943 // Set the map, length and hash field. | 945 // Set the map, length and hash field. |
| 944 mov(FieldOperand(result, HeapObject::kMapOffset), | 946 mov(FieldOperand(result, HeapObject::kMapOffset), |
| 945 Immediate(Factory::ascii_string_map())); | 947 Immediate(Factory::ascii_string_map())); |
| 946 mov(FieldOperand(result, String::kLengthOffset), length); | 948 mov(scratch1, length); |
| 949 SmiTag(scratch1); |
| 950 mov(FieldOperand(result, String::kLengthOffset), scratch1); |
| 947 mov(FieldOperand(result, String::kHashFieldOffset), | 951 mov(FieldOperand(result, String::kHashFieldOffset), |
| 948 Immediate(String::kEmptyHashField)); | 952 Immediate(String::kEmptyHashField)); |
| 949 } | 953 } |
| 950 | 954 |
| 951 | 955 |
| 952 void MacroAssembler::AllocateConsString(Register result, | 956 void MacroAssembler::AllocateConsString(Register result, |
| 953 Register scratch1, | 957 Register scratch1, |
| 954 Register scratch2, | 958 Register scratch2, |
| 955 Label* gc_required) { | 959 Label* gc_required) { |
| 956 // Allocate heap number in new space. | 960 // Allocate heap number in new space. |
| (...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1695 // Indicate that code has changed. | 1699 // Indicate that code has changed. |
| 1696 CPU::FlushICache(address_, size_); | 1700 CPU::FlushICache(address_, size_); |
| 1697 | 1701 |
| 1698 // Check that the code was patched as expected. | 1702 // Check that the code was patched as expected. |
| 1699 ASSERT(masm_.pc_ == address_ + size_); | 1703 ASSERT(masm_.pc_ == address_ + size_); |
| 1700 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 1704 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 1701 } | 1705 } |
| 1702 | 1706 |
| 1703 | 1707 |
| 1704 } } // namespace v8::internal | 1708 } } // namespace v8::internal |
| OLD | NEW |