OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1890 Label* fail, | 1890 Label* fail, |
1891 bool is_heap_object) { | 1891 bool is_heap_object) { |
1892 if (!is_heap_object) { | 1892 if (!is_heap_object) { |
1893 JumpIfSmi(obj, fail); | 1893 JumpIfSmi(obj, fail); |
1894 } | 1894 } |
1895 Cmp(FieldOperand(obj, HeapObject::kMapOffset), map); | 1895 Cmp(FieldOperand(obj, HeapObject::kMapOffset), map); |
1896 j(not_equal, fail); | 1896 j(not_equal, fail); |
1897 } | 1897 } |
1898 | 1898 |
1899 | 1899 |
| 1900 void MacroAssembler::DispatchMap(Register obj, |
| 1901 Handle<Map> map, |
| 1902 Handle<Code> success, |
| 1903 bool is_heap_object) { |
| 1904 Label fail; |
| 1905 if (!is_heap_object) { |
| 1906 JumpIfSmi(obj, &fail); |
| 1907 } |
| 1908 Cmp(FieldOperand(obj, HeapObject::kMapOffset), map); |
| 1909 j(equal, success, RelocInfo::CODE_TARGET); |
| 1910 |
| 1911 bind(&fail); |
| 1912 } |
| 1913 |
| 1914 |
1900 void MacroAssembler::AbortIfNotNumber(Register object) { | 1915 void MacroAssembler::AbortIfNotNumber(Register object) { |
1901 Label ok; | 1916 Label ok; |
1902 Condition is_smi = CheckSmi(object); | 1917 Condition is_smi = CheckSmi(object); |
1903 j(is_smi, &ok, Label::kNear); | 1918 j(is_smi, &ok, Label::kNear); |
1904 Cmp(FieldOperand(object, HeapObject::kMapOffset), | 1919 Cmp(FieldOperand(object, HeapObject::kMapOffset), |
1905 isolate()->factory()->heap_number_map()); | 1920 isolate()->factory()->heap_number_map()); |
1906 Assert(equal, "Operand not a number"); | 1921 Assert(equal, "Operand not a number"); |
1907 bind(&ok); | 1922 bind(&ok); |
1908 } | 1923 } |
1909 | 1924 |
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2910 CPU::FlushICache(address_, size_); | 2925 CPU::FlushICache(address_, size_); |
2911 | 2926 |
2912 // Check that the code was patched as expected. | 2927 // Check that the code was patched as expected. |
2913 ASSERT(masm_.pc_ == address_ + size_); | 2928 ASSERT(masm_.pc_ == address_ + size_); |
2914 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2929 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
2915 } | 2930 } |
2916 | 2931 |
2917 } } // namespace v8::internal | 2932 } } // namespace v8::internal |
2918 | 2933 |
2919 #endif // V8_TARGET_ARCH_X64 | 2934 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |