Commit ab30559f authored by erik.corry@gmail.com's avatar erik.corry@gmail.com

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
parent c74aae24
......@@ -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);
}
......
......@@ -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,
......
......@@ -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();
}
......
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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);
......
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