OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 4297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4308 #ifdef DEBUG | 4308 #ifdef DEBUG |
4309 RecordComment("Abort message: "); | 4309 RecordComment("Abort message: "); |
4310 RecordComment(GetBailoutReason(reason)); | 4310 RecordComment(GetBailoutReason(reason)); |
4311 | 4311 |
4312 if (FLAG_trap_on_abort) { | 4312 if (FLAG_trap_on_abort) { |
4313 Brk(0); | 4313 Brk(0); |
4314 return; | 4314 return; |
4315 } | 4315 } |
4316 #endif | 4316 #endif |
4317 | 4317 |
4318 Label msg_address; | 4318 // Abort is used in some contexts where csp is the stack pointer. In order to |
4319 Adr(x0, &msg_address); | 4319 // simplify the CallRuntime code, make sure that jssp is the stack pointer. |
| 4320 // There is no risk of register corruption here because Abort doesn't return. |
| 4321 Register old_stack_pointer = StackPointer(); |
| 4322 SetStackPointer(jssp); |
| 4323 Mov(jssp, old_stack_pointer); |
4320 | 4324 |
4321 if (use_real_aborts()) { | 4325 if (use_real_aborts()) { |
4322 // Split the message pointer into two SMI to avoid the GC | 4326 Mov(x0, Operand(Smi::FromInt(reason))); |
4323 // trying to scan the string. | 4327 Push(x0); |
4324 STATIC_ASSERT((kSmiShift == 32) && (kSmiTag == 0)); | |
4325 SmiTag(x1, x0); | |
4326 Bic(x0, x0, kSmiShiftMask); | |
4327 | |
4328 Push(x0, x1); | |
4329 | 4328 |
4330 if (!has_frame_) { | 4329 if (!has_frame_) { |
4331 // We don't actually want to generate a pile of code for this, so just | 4330 // We don't actually want to generate a pile of code for this, so just |
4332 // claim there is a stack frame, without generating one. | 4331 // claim there is a stack frame, without generating one. |
4333 FrameScope scope(this, StackFrame::NONE); | 4332 FrameScope scope(this, StackFrame::NONE); |
4334 CallRuntime(Runtime::kAbort, 2); | 4333 CallRuntime(Runtime::kAbort, 1); |
4335 } else { | 4334 } else { |
4336 CallRuntime(Runtime::kAbort, 2); | 4335 CallRuntime(Runtime::kAbort, 1); |
4337 } | 4336 } |
4338 } else { | 4337 } else { |
4339 // Call Printf directly, to report the error. The message is in x0, which is | 4338 // Load the string to pass to Printf. |
4340 // the first argument to Printf. | 4339 Label msg_address; |
4341 if (!csp.Is(StackPointer())) { | 4340 Adr(x0, &msg_address); |
4342 Bic(csp, StackPointer(), 0xf); | 4341 |
4343 } | 4342 // Call Printf directly to report the error. |
4344 CallPrintf(); | 4343 CallPrintf(); |
4345 | 4344 |
4346 // The CallPrintf will return, so this point is actually reachable in this | 4345 // We need a way to stop execution on both the simulator and real hardware, |
4347 // context. However: | 4346 // and Unreachable() is the best option. |
4348 // - We're already executing an abort (which shouldn't be reachable in | |
4349 // valid code). | |
4350 // - We need a way to stop execution on both the simulator and real | |
4351 // hardware, and Unreachable() is the best option. | |
4352 Unreachable(); | 4347 Unreachable(); |
| 4348 |
| 4349 // Emit the message string directly in the instruction stream. |
| 4350 { |
| 4351 BlockConstPoolScope scope(this); |
| 4352 Bind(&msg_address); |
| 4353 EmitStringData(GetBailoutReason(reason)); |
| 4354 } |
4353 } | 4355 } |
4354 | 4356 |
4355 // Emit the message string directly in the instruction stream. | 4357 SetStackPointer(old_stack_pointer); |
4356 { | |
4357 BlockConstPoolScope scope(this); | |
4358 Bind(&msg_address); | |
4359 // TODO(jbramley): Since the reason is an enum, why do we still encode the | |
4360 // string (and a pointer to it) in the instruction stream? | |
4361 EmitStringData(GetBailoutReason(reason)); | |
4362 } | |
4363 } | 4358 } |
4364 | 4359 |
4365 | 4360 |
4366 void MacroAssembler::LoadTransitionedArrayMapConditional( | 4361 void MacroAssembler::LoadTransitionedArrayMapConditional( |
4367 ElementsKind expected_kind, | 4362 ElementsKind expected_kind, |
4368 ElementsKind transitioned_kind, | 4363 ElementsKind transitioned_kind, |
4369 Register map_in_out, | 4364 Register map_in_out, |
4370 Register scratch, | 4365 Register scratch, |
4371 Label* no_map_match) { | 4366 Label* no_map_match) { |
4372 // Load the global or builtins object from the current context. | 4367 // Load the global or builtins object from the current context. |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4772 } | 4767 } |
4773 } | 4768 } |
4774 | 4769 |
4775 | 4770 |
4776 #undef __ | 4771 #undef __ |
4777 | 4772 |
4778 | 4773 |
4779 } } // namespace v8::internal | 4774 } } // namespace v8::internal |
4780 | 4775 |
4781 #endif // V8_TARGET_ARCH_A64 | 4776 #endif // V8_TARGET_ARCH_A64 |
OLD | NEW |