Record safepoint at calls ToBooleanStub.

This fixes the issues when GC happens when invoking
ToBooleanStub.
Review URL: http://codereview.chromium.org/7465066

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8747 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4cba3faf
......@@ -922,6 +922,7 @@ class ToBooleanStub: public CodeStub {
explicit Types(byte bits) : set_(bits) {}
bool IsEmpty() const { return set_.IsEmpty(); }
bool IsAll() const { return ToByte() == ((1 << NUMBER_OF_TYPES) - 1); }
bool Contains(Type type) const { return set_.Contains(type); }
void Add(Type type) { set_.Add(type); }
byte ToByte() const { return set_.ToIntegral(); }
......@@ -934,6 +935,7 @@ class ToBooleanStub: public CodeStub {
};
static Types no_types() { return Types(); }
static Types all_types() { return Types((1 << NUMBER_OF_TYPES) - 1); }
explicit ToBooleanStub(Register tos, Types types = Types())
: tos_(tos), types_(types) { }
......
......@@ -348,8 +348,10 @@ void ToBooleanStub::Generate(MacroAssembler* masm) {
__ ret(1 * kPointerSize);
}
__ bind(&patch);
GenerateTypeTransition(masm);
if (!types_.IsAll()) {
__ bind(&patch);
GenerateTypeTransition(masm);
}
}
......
......@@ -1424,7 +1424,7 @@ void LCodeGen::DoBranch(LBranch* instr) {
// The conversion stub doesn't cause garbage collections so it's
// safe to not record a safepoint after the call.
__ bind(&call_stub);
ToBooleanStub stub(eax);
ToBooleanStub stub(eax, ToBooleanStub::all_types());
__ pushad();
__ push(reg);
__ CallStub(&stub);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment