OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 j(cc, branch); | 255 j(cc, branch); |
256 } | 256 } |
257 } | 257 } |
258 | 258 |
259 | 259 |
260 void MacroAssembler::Assert(Condition cc, const char* msg) { | 260 void MacroAssembler::Assert(Condition cc, const char* msg) { |
261 if (FLAG_debug_code) Check(cc, msg); | 261 if (FLAG_debug_code) Check(cc, msg); |
262 } | 262 } |
263 | 263 |
264 | 264 |
| 265 void MacroAssembler::AssertFastElements(Register elements) { |
| 266 if (FLAG_debug_code) { |
| 267 Label ok; |
| 268 CompareRoot(FieldOperand(elements, HeapObject::kMapOffset), |
| 269 Heap::kFixedArrayMapRootIndex); |
| 270 j(equal, &ok); |
| 271 CompareRoot(FieldOperand(elements, HeapObject::kMapOffset), |
| 272 Heap::kFixedCOWArrayMapRootIndex); |
| 273 j(equal, &ok); |
| 274 Abort("JSObject with fast elements map has slow elements"); |
| 275 bind(&ok); |
| 276 } |
| 277 } |
| 278 |
| 279 |
265 void MacroAssembler::Check(Condition cc, const char* msg) { | 280 void MacroAssembler::Check(Condition cc, const char* msg) { |
266 Label L; | 281 Label L; |
267 j(cc, &L); | 282 j(cc, &L); |
268 Abort(msg); | 283 Abort(msg); |
269 // will not return here | 284 // will not return here |
270 bind(&L); | 285 bind(&L); |
271 } | 286 } |
272 | 287 |
273 | 288 |
274 void MacroAssembler::CheckStackAlignment() { | 289 void MacroAssembler::CheckStackAlignment() { |
(...skipping 2679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2954 CPU::FlushICache(address_, size_); | 2969 CPU::FlushICache(address_, size_); |
2955 | 2970 |
2956 // Check that the code was patched as expected. | 2971 // Check that the code was patched as expected. |
2957 ASSERT(masm_.pc_ == address_ + size_); | 2972 ASSERT(masm_.pc_ == address_ + size_); |
2958 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 2973 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
2959 } | 2974 } |
2960 | 2975 |
2961 } } // namespace v8::internal | 2976 } } // namespace v8::internal |
2962 | 2977 |
2963 #endif // V8_TARGET_ARCH_X64 | 2978 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |