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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 bool is_heap_object) { | 196 bool is_heap_object) { |
197 if (!is_heap_object) { | 197 if (!is_heap_object) { |
198 test(obj, Immediate(kSmiTagMask)); | 198 test(obj, Immediate(kSmiTagMask)); |
199 j(zero, fail); | 199 j(zero, fail); |
200 } | 200 } |
201 cmp(FieldOperand(obj, HeapObject::kMapOffset), Immediate(map)); | 201 cmp(FieldOperand(obj, HeapObject::kMapOffset), Immediate(map)); |
202 j(not_equal, fail); | 202 j(not_equal, fail); |
203 } | 203 } |
204 | 204 |
205 | 205 |
| 206 void MacroAssembler::DispatchMap(Register obj, |
| 207 Handle<Map> map, |
| 208 Handle<Code> success, |
| 209 bool is_heap_object) { |
| 210 Label fail; |
| 211 if (!is_heap_object) { |
| 212 test(obj, Immediate(kSmiTagMask)); |
| 213 j(zero, &fail); |
| 214 } |
| 215 cmp(FieldOperand(obj, HeapObject::kMapOffset), Immediate(map)); |
| 216 j(equal, success, taken); |
| 217 |
| 218 bind(&fail); |
| 219 } |
| 220 |
| 221 |
206 Condition MacroAssembler::IsObjectStringType(Register heap_object, | 222 Condition MacroAssembler::IsObjectStringType(Register heap_object, |
207 Register map, | 223 Register map, |
208 Register instance_type) { | 224 Register instance_type) { |
209 mov(map, FieldOperand(heap_object, HeapObject::kMapOffset)); | 225 mov(map, FieldOperand(heap_object, HeapObject::kMapOffset)); |
210 movzx_b(instance_type, FieldOperand(map, Map::kInstanceTypeOffset)); | 226 movzx_b(instance_type, FieldOperand(map, Map::kInstanceTypeOffset)); |
211 ASSERT(kNotStringTag != 0); | 227 ASSERT(kNotStringTag != 0); |
212 test(instance_type, Immediate(kIsNotStringMask)); | 228 test(instance_type, Immediate(kIsNotStringMask)); |
213 return zero; | 229 return zero; |
214 } | 230 } |
215 | 231 |
(...skipping 1820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2036 | 2052 |
2037 // Check that the code was patched as expected. | 2053 // Check that the code was patched as expected. |
2038 ASSERT(masm_.pc_ == address_ + size_); | 2054 ASSERT(masm_.pc_ == address_ + size_); |
2039 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2055 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
2040 } | 2056 } |
2041 | 2057 |
2042 | 2058 |
2043 } } // namespace v8::internal | 2059 } } // namespace v8::internal |
2044 | 2060 |
2045 #endif // V8_TARGET_ARCH_IA32 | 2061 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |