Fix some stub calling asserts on x64.

Review URL: http://codereview.chromium.org/7922008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9309 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
erik.corry@gmail.com 2011-09-16 11:29:13 +00:00
parent c74aae242a
commit ab30559fee
6 changed files with 52 additions and 2 deletions

View File

@ -3333,6 +3333,13 @@ bool CEntryStub::NeedsImmovableCode() {
}
bool CEntryStub::CompilingCallsToThisStubIsGCSafe() {
return !save_doubles_ && result_size_ == 1;
}
void CodeStub::GenerateStubsAheadOfTime() {
}
void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) {
__ Throw(r0);
}

View File

@ -147,6 +147,9 @@ class CodeStub BASE_EMBEDDED {
return MajorKey() <= Instanceof;
}
static void GenerateStubsAheadOfTime();
// Some stubs put untagged junk on the stack that cannot be scanned by the
// GC. This means that we must be statically sure that no GC can occur while
// they are running. If that is the case they should override this to return
@ -549,8 +552,9 @@ class CEntryStub : public CodeStub {
// The version of this stub that doesn't save doubles is generated ahead of
// time, so it's OK to call it from other stubs that can't cope with GC during
// their code generation.
virtual bool CompilingCallsToThisStubIsGCSafe() { return !save_doubles_; }
// their code generation. On machines that always have gp registers (x64) we
// can generate both variants ahead of time.
virtual bool CompilingCallsToThisStubIsGCSafe();
private:
void GenerateCore(MacroAssembler* masm,

View File

@ -2056,6 +2056,15 @@ void Heap::CreateFixedStubs() {
// To workaround the problem, make separate functions without inlining.
Heap::CreateJSEntryStub();
Heap::CreateJSConstructEntryStub();
// Create stubs that should be there, so we don't unexpectedly have to
// create them if we need them during the creation of another stub.
// Stub creation mixes raw pointers and handles in an unsafe manner so
// we cannot create stubs while we are creating stubs.
CEntryStub ces(1);
ces.GetCode();
CodeStub::GenerateStubsAheadOfTime();
}

View File

@ -4292,6 +4292,15 @@ bool CEntryStub::NeedsImmovableCode() {
}
bool CEntryStub::CompilingCallsToThisStubIsGCSafe() {
return !save_doubles_ && result_size_ == 1;
}
void CodeStub::GenerateStubsAheadOfTime() {
}
void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) {
__ Throw(eax);
}

View File

@ -3476,6 +3476,15 @@ bool CEntryStub::NeedsImmovableCode() {
}
bool CEntryStub::CompilingCallsToThisStubIsGCSafe() {
return !save_doubles_ && result_size_ == 1;
}
void CodeStub::GenerateStubsAheadOfTime() {
}
void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) {
__ Throw(v0);
}

View File

@ -3324,6 +3324,18 @@ bool CEntryStub::NeedsImmovableCode() {
}
bool CEntryStub::CompilingCallsToThisStubIsGCSafe() {
return result_size_ == 1;
}
void CodeStub::GenerateStubsAheadOfTime() {
CEntryStub save_doubles(1);
save_doubles.SaveDoubles();
save_doubles.GetCode();
}
void CEntryStub::GenerateThrowTOS(MacroAssembler* masm) {
// Throw exception in eax.
__ Throw(rax);