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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 280 |
281 void MacroAssembler::CmpInstanceType(Register map, InstanceType type) { | 281 void MacroAssembler::CmpInstanceType(Register map, InstanceType type) { |
282 cmpb(FieldOperand(map, Map::kInstanceTypeOffset), | 282 cmpb(FieldOperand(map, Map::kInstanceTypeOffset), |
283 static_cast<int8_t>(type)); | 283 static_cast<int8_t>(type)); |
284 } | 284 } |
285 | 285 |
286 | 286 |
287 void MacroAssembler::CheckFastElements(Register map, | 287 void MacroAssembler::CheckFastElements(Register map, |
288 Label* fail, | 288 Label* fail, |
289 Label::Distance distance) { | 289 Label::Distance distance) { |
290 STATIC_ASSERT(FAST_ELEMENTS == 0); | 290 STATIC_ASSERT(FAST_SMI_ONLY_ELEMENTS == 0); |
| 291 STATIC_ASSERT(FAST_ELEMENTS == 1); |
291 cmpb(FieldOperand(map, Map::kBitField2Offset), | 292 cmpb(FieldOperand(map, Map::kBitField2Offset), |
292 Map::kMaximumBitField2FastElementValue); | 293 Map::kMaximumBitField2FastElementValue); |
293 j(above, fail, distance); | 294 j(above, fail, distance); |
294 } | 295 } |
295 | 296 |
296 | 297 |
| 298 void MacroAssembler::CheckFastObjectElements(Register map, |
| 299 Label* fail, |
| 300 Label::Distance distance) { |
| 301 STATIC_ASSERT(FAST_SMI_ONLY_ELEMENTS == 0); |
| 302 STATIC_ASSERT(FAST_ELEMENTS == 1); |
| 303 cmpb(FieldOperand(map, Map::kBitField2Offset), |
| 304 Map::kMaximumBitField2FastSmiOnlyElementValue); |
| 305 j(below_equal, fail, distance); |
| 306 cmpb(FieldOperand(map, Map::kBitField2Offset), |
| 307 Map::kMaximumBitField2FastElementValue); |
| 308 j(above, fail, distance); |
| 309 } |
| 310 |
| 311 |
| 312 void MacroAssembler::CheckFastSmiOnlyElements(Register map, |
| 313 Label* fail, |
| 314 Label::Distance distance) { |
| 315 STATIC_ASSERT(FAST_SMI_ONLY_ELEMENTS == 0); |
| 316 cmpb(FieldOperand(map, Map::kBitField2Offset), |
| 317 Map::kMaximumBitField2FastSmiOnlyElementValue); |
| 318 j(above, fail, distance); |
| 319 } |
| 320 |
| 321 |
297 void MacroAssembler::CheckMap(Register obj, | 322 void MacroAssembler::CheckMap(Register obj, |
298 Handle<Map> map, | 323 Handle<Map> map, |
299 Label* fail, | 324 Label* fail, |
300 SmiCheckType smi_check_type) { | 325 SmiCheckType smi_check_type) { |
301 if (smi_check_type == DO_SMI_CHECK) { | 326 if (smi_check_type == DO_SMI_CHECK) { |
302 JumpIfSmi(obj, fail); | 327 JumpIfSmi(obj, fail); |
303 } | 328 } |
304 cmp(FieldOperand(obj, HeapObject::kMapOffset), Immediate(map)); | 329 cmp(FieldOperand(obj, HeapObject::kMapOffset), Immediate(map)); |
305 j(not_equal, fail); | 330 j(not_equal, fail); |
306 } | 331 } |
(...skipping 1977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2284 | 2309 |
2285 // Check that the code was patched as expected. | 2310 // Check that the code was patched as expected. |
2286 ASSERT(masm_.pc_ == address_ + size_); | 2311 ASSERT(masm_.pc_ == address_ + size_); |
2287 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2312 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
2288 } | 2313 } |
2289 | 2314 |
2290 | 2315 |
2291 } } // namespace v8::internal | 2316 } } // namespace v8::internal |
2292 | 2317 |
2293 #endif // V8_TARGET_ARCH_IA32 | 2318 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |