Change the interface of CallStubCompiler::CompileCallInterceptor.

Move responsibility for a typecast into the caller so that it can be
locally verified to succeed.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3858 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
kmillikin@chromium.org 2010-02-15 13:20:49 +00:00
parent 3d4d5e9e34
commit a2bb215611
5 changed files with 22 additions and 24 deletions

View File

@ -781,7 +781,7 @@ Object* StubCompiler::CompileLazyCompile(Code::Flags flags) {
}
Object* CallStubCompiler::CompileCallField(Object* object,
Object* CallStubCompiler::CompileCallField(JSObject* object,
JSObject* holder,
int index,
String* name) {
@ -800,8 +800,7 @@ Object* CallStubCompiler::CompileCallField(Object* object,
__ b(eq, &miss);
// Do the right check and compute the holder register.
Register reg =
CheckPrototypes(JSObject::cast(object), r0, holder, r1, r3, name, &miss);
Register reg = CheckPrototypes(object, r0, holder, r1, r3, name, &miss);
GenerateFastPropertyLoad(masm(), r1, reg, holder, index);
GenerateCallFunction(masm(), object, arguments(), &miss);
@ -949,7 +948,7 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
}
Object* CallStubCompiler::CompileCallInterceptor(Object* object,
Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
JSObject* holder,
String* name) {
// ----------- S t a t e -------------
@ -978,9 +977,8 @@ Object* CallStubCompiler::CompileCallInterceptor(Object* object,
__ BranchOnSmi(receiver, &miss);
// Check that the maps haven't changed.
Register reg =
CheckPrototypes(JSObject::cast(object), receiver, holder,
holder_reg, scratch, name, &miss);
Register reg = CheckPrototypes(object, receiver, holder, holder_reg,
scratch, name, &miss);
if (!reg.is(holder_reg)) {
__ mov(holder_reg, reg);
}

View File

@ -1159,7 +1159,7 @@ Object* StubCompiler::CompileLazyCompile(Code::Flags flags) {
}
Object* CallStubCompiler::CompileCallField(Object* object,
Object* CallStubCompiler::CompileCallField(JSObject* object,
JSObject* holder,
int index,
String* name) {
@ -1181,9 +1181,7 @@ Object* CallStubCompiler::CompileCallField(Object* object,
__ j(zero, &miss, not_taken);
// Do the right check and compute the holder register.
Register reg =
CheckPrototypes(JSObject::cast(object), edx, holder,
ebx, eax, name, &miss);
Register reg = CheckPrototypes(object, edx, holder, ebx, eax, name, &miss);
GenerateFastPropertyLoad(masm(), edi, reg, holder, index);
@ -1373,7 +1371,7 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
}
Object* CallStubCompiler::CompileCallInterceptor(Object* object,
Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
JSObject* holder,
String* name) {
// ----------- S t a t e -------------
@ -1396,7 +1394,7 @@ Object* CallStubCompiler::CompileCallInterceptor(Object* object,
CallInterceptorCompiler compiler(this, arguments(), ecx);
compiler.Compile(masm(),
JSObject::cast(object),
object,
holder,
name,
&lookup,

View File

@ -484,7 +484,10 @@ Object* StubCache::ComputeCallField(int argc,
Object* code = map->FindInCodeCache(name, flags);
if (code->IsUndefined()) {
CallStubCompiler compiler(argc, in_loop);
code = compiler.CompileCallField(object, holder, index, name);
code = compiler.CompileCallField(JSObject::cast(object),
holder,
index,
name);
if (code->IsFailure()) return code;
ASSERT_EQ(flags, Code::cast(code)->flags());
LOG(CodeCreateEvent(Logger::CALL_IC_TAG, Code::cast(code), name));
@ -518,7 +521,9 @@ Object* StubCache::ComputeCallInterceptor(int argc,
Object* code = map->FindInCodeCache(name, flags);
if (code->IsUndefined()) {
CallStubCompiler compiler(argc, NOT_IN_LOOP);
code = compiler.CompileCallInterceptor(object, holder, name);
code = compiler.CompileCallInterceptor(JSObject::cast(object),
holder,
name);
if (code->IsFailure()) return code;
ASSERT_EQ(flags, Code::cast(code)->flags());
LOG(CodeCreateEvent(Logger::CALL_IC_TAG, Code::cast(code), name));

View File

@ -552,7 +552,7 @@ class CallStubCompiler: public StubCompiler {
explicit CallStubCompiler(int argc, InLoopFlag in_loop)
: arguments_(argc), in_loop_(in_loop) { }
Object* CompileCallField(Object* object,
Object* CompileCallField(JSObject* object,
JSObject* holder,
int index,
String* name);
@ -561,7 +561,7 @@ class CallStubCompiler: public StubCompiler {
JSFunction* function,
String* name,
CheckType check);
Object* CompileCallInterceptor(Object* object,
Object* CompileCallInterceptor(JSObject* object,
JSObject* holder,
String* name);
Object* CompileCallGlobal(JSObject* object,

View File

@ -791,7 +791,7 @@ Object* CallStubCompiler::CompileCallConstant(Object* object,
}
Object* CallStubCompiler::CompileCallField(Object* object,
Object* CallStubCompiler::CompileCallField(JSObject* object,
JSObject* holder,
int index,
String* name) {
@ -814,9 +814,7 @@ Object* CallStubCompiler::CompileCallField(Object* object,
__ JumpIfSmi(rdx, &miss);
// Do the right check and compute the holder register.
Register reg =
CheckPrototypes(JSObject::cast(object), rdx, holder,
rbx, rax, name, &miss);
Register reg = CheckPrototypes(object, rdx, holder, rbx, rax, name, &miss);
GenerateFastPropertyLoad(masm(), rdi, reg, holder, index);
@ -845,7 +843,7 @@ Object* CallStubCompiler::CompileCallField(Object* object,
}
Object* CallStubCompiler::CompileCallInterceptor(Object* object,
Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
JSObject* holder,
String* name) {
// ----------- S t a t e -------------
@ -872,7 +870,7 @@ Object* CallStubCompiler::CompileCallInterceptor(Object* object,
CompileLoadInterceptor(&compiler,
this,
masm(),
JSObject::cast(object),
object,
holder,
name,
&lookup,
@ -910,7 +908,6 @@ Object* CallStubCompiler::CompileCallInterceptor(Object* object,
}
Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
GlobalObject* holder,
JSGlobalPropertyCell* cell,