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

Side by Side Diff: src/arm/macro-assembler-arm.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
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 1985 matching lines...) Expand 10 before | Expand all | Expand 10 after
1996 { MaybeObject* maybe_result = stub->TryGetCode(); 1996 { MaybeObject* maybe_result = stub->TryGetCode();
1997 if (!maybe_result->ToObject(&result)) return maybe_result; 1997 if (!maybe_result->ToObject(&result)) return maybe_result;
1998 } 1998 }
1999 Handle<Code> code(Code::cast(result)); 1999 Handle<Code> code(Code::cast(result));
2000 Call(code, RelocInfo::CODE_TARGET, kNoASTId, cond); 2000 Call(code, RelocInfo::CODE_TARGET, kNoASTId, cond);
2001 return result; 2001 return result;
2002 } 2002 }
2003 2003
2004 2004
2005 void MacroAssembler::TailCallStub(CodeStub* stub, Condition cond) { 2005 void MacroAssembler::TailCallStub(CodeStub* stub, Condition cond) {
2006 ASSERT(stub->CompilingCallsToThisStubIsGCSafe() || allow_stub_calls_); 2006 ASSERT(allow_stub_calls_ || stub->CompilingCallsToThisStubIsGCSafe());
2007 Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond); 2007 Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond);
2008 } 2008 }
2009 2009
2010 2010
2011 MaybeObject* MacroAssembler::TryTailCallStub(CodeStub* stub, Condition cond) { 2011 MaybeObject* MacroAssembler::TryTailCallStub(CodeStub* stub, Condition cond) {
2012 Object* result; 2012 Object* result;
2013 { MaybeObject* maybe_result = stub->TryGetCode(); 2013 { MaybeObject* maybe_result = stub->TryGetCode();
2014 if (!maybe_result->ToObject(&result)) return maybe_result; 2014 if (!maybe_result->ToObject(&result)) return maybe_result;
2015 } 2015 }
2016 Jump(Handle<Code>(Code::cast(result)), RelocInfo::CODE_TARGET, cond); 2016 Jump(Handle<Code>(Code::cast(result)), RelocInfo::CODE_TARGET, cond);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
2106 ExternalReference::delete_handle_scope_extensions(isolate()), 1); 2106 ExternalReference::delete_handle_scope_extensions(isolate()), 1);
2107 mov(r0, r4); 2107 mov(r0, r4);
2108 jmp(&leave_exit_frame); 2108 jmp(&leave_exit_frame);
2109 2109
2110 return result; 2110 return result;
2111 } 2111 }
2112 2112
2113 2113
2114 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) { 2114 bool MacroAssembler::AllowThisStubCall(CodeStub* stub) {
2115 if (!has_frame_ && stub->SometimesSetsUpAFrame()) return false; 2115 if (!has_frame_ && stub->SometimesSetsUpAFrame()) return false;
2116 return stub->CompilingCallsToThisStubIsGCSafe() || allow_stub_calls_; 2116 return allow_stub_calls_ || stub->CompilingCallsToThisStubIsGCSafe();
2117 } 2117 }
2118 2118
2119 2119
2120 void MacroAssembler::IllegalOperation(int num_arguments) { 2120 void MacroAssembler::IllegalOperation(int num_arguments) {
2121 if (num_arguments > 0) { 2121 if (num_arguments > 0) {
2122 add(sp, sp, Operand(num_arguments * kPointerSize)); 2122 add(sp, sp, Operand(num_arguments * kPointerSize));
2123 } 2123 }
2124 LoadRoot(r0, Heap::kUndefinedValueRootIndex); 2124 LoadRoot(r0, Heap::kUndefinedValueRootIndex);
2125 } 2125 }
2126 2126
(...skipping 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after
3576 void CodePatcher::EmitCondition(Condition cond) { 3576 void CodePatcher::EmitCondition(Condition cond) {
3577 Instr instr = Assembler::instr_at(masm_.pc_); 3577 Instr instr = Assembler::instr_at(masm_.pc_);
3578 instr = (instr & ~kCondMask) | cond; 3578 instr = (instr & ~kCondMask) | cond;
3579 masm_.emit(instr); 3579 masm_.emit(instr);
3580 } 3580 }
3581 3581
3582 3582
3583 } } // namespace v8::internal 3583 } } // namespace v8::internal
3584 3584
3585 #endif // V8_TARGET_ARCH_ARM 3585 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698