Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 168903004: Pass a BailoutReason to Runtime::kAbort. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 Label ok; 498 Label ok;
499 testl(result, result); 499 testl(result, result);
500 j(not_zero, &ok, Label::kNear); 500 j(not_zero, &ok, Label::kNear);
501 testl(op, op); 501 testl(op, op);
502 j(sign, then_label); 502 j(sign, then_label);
503 bind(&ok); 503 bind(&ok);
504 } 504 }
505 505
506 506
507 void MacroAssembler::Abort(BailoutReason reason) { 507 void MacroAssembler::Abort(BailoutReason reason) {
508 // We want to pass the msg string like a smi to avoid GC 508 #ifdef DEBUG
509 // problems, however msg is not guaranteed to be aligned
510 // properly. Instead, we pass an aligned pointer that is
511 // a proper v8 smi, but also pass the alignment difference
512 // from the real pointer as a smi.
513 const char* msg = GetBailoutReason(reason); 509 const char* msg = GetBailoutReason(reason);
514 intptr_t p1 = reinterpret_cast<intptr_t>(msg);
515 intptr_t p0 = (p1 & ~kSmiTagMask) + kSmiTag;
516 // Note: p0 might not be a valid Smi _value_, but it has a valid Smi tag.
517 ASSERT(reinterpret_cast<Object*>(p0)->IsSmi());
518 #ifdef DEBUG
519 if (msg != NULL) { 510 if (msg != NULL) {
520 RecordComment("Abort message: "); 511 RecordComment("Abort message: ");
521 RecordComment(msg); 512 RecordComment(msg);
522 } 513 }
523 514
524 if (FLAG_trap_on_abort) { 515 if (FLAG_trap_on_abort) {
525 int3(); 516 int3();
526 return; 517 return;
527 } 518 }
528 #endif 519 #endif
529 520
530 push(rax); 521 push(rax);
531 Move(kScratchRegister, reinterpret_cast<Smi*>(p0), 522 Move(kScratchRegister, Smi::FromInt(static_cast<int>(reason)),
532 Assembler::RelocInfoNone());
533 push(kScratchRegister);
534 Move(kScratchRegister, Smi::FromInt(static_cast<int>(p1 - p0)),
535 Assembler::RelocInfoNone()); 523 Assembler::RelocInfoNone());
536 push(kScratchRegister); 524 push(kScratchRegister);
537 525
538 if (!has_frame_) { 526 if (!has_frame_) {
539 // We don't actually want to generate a pile of code for this, so just 527 // We don't actually want to generate a pile of code for this, so just
540 // claim there is a stack frame, without generating one. 528 // claim there is a stack frame, without generating one.
541 FrameScope scope(this, StackFrame::NONE); 529 FrameScope scope(this, StackFrame::NONE);
542 CallRuntime(Runtime::kAbort, 2); 530 CallRuntime(Runtime::kAbort, 1);
543 } else { 531 } else {
544 CallRuntime(Runtime::kAbort, 2); 532 CallRuntime(Runtime::kAbort, 1);
545 } 533 }
546 // Control will not return here. 534 // Control will not return here.
547 int3(); 535 int3();
548 } 536 }
549 537
550 538
551 void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) { 539 void MacroAssembler::CallStub(CodeStub* stub, TypeFeedbackId ast_id) {
552 ASSERT(AllowThisStubCall(stub)); // Calls are not allowed in some stubs 540 ASSERT(AllowThisStubCall(stub)); // Calls are not allowed in some stubs
553 Call(stub->GetCode(isolate()), RelocInfo::CODE_TARGET, ast_id); 541 Call(stub->GetCode(isolate()), RelocInfo::CODE_TARGET, ast_id);
554 } 542 }
(...skipping 4465 matching lines...) Expand 10 before | Expand all | Expand 10 after
5020 j(equal, found); 5008 j(equal, found);
5021 movp(current, FieldOperand(current, Map::kPrototypeOffset)); 5009 movp(current, FieldOperand(current, Map::kPrototypeOffset));
5022 CompareRoot(current, Heap::kNullValueRootIndex); 5010 CompareRoot(current, Heap::kNullValueRootIndex);
5023 j(not_equal, &loop_again); 5011 j(not_equal, &loop_again);
5024 } 5012 }
5025 5013
5026 5014
5027 } } // namespace v8::internal 5015 } } // namespace v8::internal
5028 5016
5029 #endif // V8_TARGET_ARCH_X64 5017 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698