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

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

Issue 8041035: Tighten up assertions checking GC-safety of stub calls. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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
« src/ia32/code-stubs-ia32.cc ('K') | « src/x64/code-stubs-x64.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 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 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 MaybeObject* result = stub->TryGetCode(); 501 MaybeObject* result = stub->TryGetCode();
502 if (!result->IsFailure()) { 502 if (!result->IsFailure()) {
503 call(Handle<Code>(Code::cast(result->ToObjectUnchecked())), 503 call(Handle<Code>(Code::cast(result->ToObjectUnchecked())),
504 RelocInfo::CODE_TARGET); 504 RelocInfo::CODE_TARGET);
505 } 505 }
506 return result; 506 return result;
507 } 507 }
508 508
509 509
510 void MacroAssembler::TailCallStub(CodeStub* stub) { 510 void MacroAssembler::TailCallStub(CodeStub* stub) {
511 ASSERT(stub->CompilingCallsToThisStubIsGCSafe() || allow_stub_calls_); 511 ASSERT(allow_stub_calls_ || stub->CompilingCallsToThisStubIsGCSafe());
512 Jump(stub->GetCode(), RelocInfo::CODE_TARGET); 512 Jump(stub->GetCode(), RelocInfo::CODE_TARGET);
513 } 513 }
514 514
515 515
516 MaybeObject* MacroAssembler::TryTailCallStub(CodeStub* stub) { 516 MaybeObject* MacroAssembler::TryTailCallStub(CodeStub* stub) {
517 MaybeObject* result = stub->TryGetCode(); 517 MaybeObject* result = stub->TryGetCode();
518 if (!result->IsFailure()) { 518 if (!result->IsFailure()) {
519 jmp(Handle<Code>(Code::cast(result->ToObjectUnchecked())), 519 jmp(Handle<Code>(Code::cast(result->ToObjectUnchecked())),
520 RelocInfo::CODE_TARGET); 520 RelocInfo::CODE_TARGET);
521 } 521 }
522 return result; 522 return result;
523 } 523 }
524 524
525 525
526 void MacroAssembler::StubReturn(int argc) { 526 void MacroAssembler::StubReturn(int argc) {
527 ASSERT(argc >= 1 && generating_stub()); 527 ASSERT(argc >= 1 && generating_stub());
528 ret((argc - 1) * kPointerSize); 528 ret((argc - 1) * kPointerSize);
529 } 529 }
530 530
531 531
532 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { 532 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) {
533 if (!has_frame_ && stub->SometimesSetsUpAFrame()) return false; 533 if (!has_frame_ && stub->SometimesSetsUpAFrame()) return false;
534 return stub->CompilingCallsToThisStubIsGCSafe() || allow_stub_calls_; 534 return allow_stub_calls_ || stub->CompilingCallsToThisStubIsGCSafe();
535 } 535 }
536 536
537 537
538 void MacroAssembler::IllegalOperation(int num_arguments) { 538 void MacroAssembler::IllegalOperation(int num_arguments) {
539 if (num_arguments > 0) { 539 if (num_arguments > 0) {
540 addq(rsp, Immediate(num_arguments * kPointerSize)); 540 addq(rsp, Immediate(num_arguments * kPointerSize));
541 } 541 }
542 LoadRoot(rax, Heap::kUndefinedValueRootIndex); 542 LoadRoot(rax, Heap::kUndefinedValueRootIndex);
543 } 543 }
544 544
(...skipping 3676 matching lines...) Expand 10 before | Expand all | Expand 10 after
4221 4221
4222 and_(bitmap_scratch, Immediate(~Page::kPageAlignmentMask)); 4222 and_(bitmap_scratch, Immediate(~Page::kPageAlignmentMask));
4223 addl(Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset), length); 4223 addl(Operand(bitmap_scratch, MemoryChunk::kLiveBytesOffset), length);
4224 4224
4225 bind(&done); 4225 bind(&done);
4226 } 4226 }
4227 4227
4228 } } // namespace v8::internal 4228 } } // namespace v8::internal
4229 4229
4230 #endif // V8_TARGET_ARCH_X64 4230 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/ia32/code-stubs-ia32.cc ('K') | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698