MIPS: Move function prototype handling into a special handler rather than IC.

Port r22526 (d4c953e)

Original commit message:
Adjust hydrogen handling of function.prototype to be based on map feedback. Handle non-instance prototype loading using an IC rather than in the hydrogen instruction. In the future, remove the special instruction and replace by multiple hydrogen instructions.

BUG=
R=paul.lind@imgtec.com

Review URL: https://codereview.chromium.org/414463002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22534 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 538b907b
......@@ -3057,17 +3057,6 @@ void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
Register function = ToRegister(instr->function());
Register result = ToRegister(instr->result());
// Check that the function really is a function. Load map into the
// result register.
__ GetObjectType(function, result, scratch);
DeoptimizeIf(ne, instr->environment(), scratch, Operand(JS_FUNCTION_TYPE));
// Make sure that the function has an instance prototype.
Label non_instance;
__ lbu(scratch, FieldMemOperand(result, Map::kBitFieldOffset));
__ And(scratch, scratch, Operand(1 << Map::kHasNonInstancePrototype));
__ Branch(&non_instance, ne, scratch, Operand(zero_reg));
// Get the prototype or initial map from the function.
__ lw(result,
FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
......@@ -3083,12 +3072,6 @@ void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
// Get the prototype from the initial map.
__ lw(result, FieldMemOperand(result, Map::kPrototypeOffset));
__ Branch(&done);
// Non-instance prototype: Fetch prototype from constructor field
// in initial map.
__ bind(&non_instance);
__ lw(result, FieldMemOperand(result, Map::kConstructorOffset));
// All done.
__ bind(&done);
......
......@@ -3039,17 +3039,6 @@ void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
Register function = ToRegister(instr->function());
Register result = ToRegister(instr->result());
// Check that the function really is a function. Load map into the
// result register.
__ GetObjectType(function, result, scratch);
DeoptimizeIf(ne, instr->environment(), scratch, Operand(JS_FUNCTION_TYPE));
// Make sure that the function has an instance prototype.
Label non_instance;
__ lbu(scratch, FieldMemOperand(result, Map::kBitFieldOffset));
__ And(scratch, scratch, Operand(1 << Map::kHasNonInstancePrototype));
__ Branch(&non_instance, ne, scratch, Operand(zero_reg));
// Get the prototype or initial map from the function.
__ ld(result,
FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
......@@ -3065,12 +3054,6 @@ void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
// Get the prototype from the initial map.
__ ld(result, FieldMemOperand(result, Map::kPrototypeOffset));
__ Branch(&done);
// Non-instance prototype: Fetch prototype from constructor field
// in initial map.
__ bind(&non_instance);
__ ld(result, FieldMemOperand(result, Map::kConstructorOffset));
// All done.
__ bind(&done);
......
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