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

port r22526.

original commit message:
  Move function prototype handling into a special handler rather than IC

  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=verwaest@chromium.org

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

Patch from Chunyang Dai <chunyang.dai@intel.com>.

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22585 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
verwaest@chromium.org 2014-07-24 09:11:59 +00:00
parent cb8105e223
commit f135cfa263

View File

@ -3131,16 +3131,6 @@ void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
Register temp = ToRegister(instr->temp()); Register temp = ToRegister(instr->temp());
Register result = ToRegister(instr->result()); Register result = ToRegister(instr->result());
// Check that the function really is a function.
__ CmpObjectType(function, JS_FUNCTION_TYPE, result);
DeoptimizeIf(not_equal, instr->environment());
// Check whether the function has an instance prototype.
Label non_instance;
__ test_b(FieldOperand(result, Map::kBitFieldOffset),
1 << Map::kHasNonInstancePrototype);
__ j(not_zero, &non_instance, Label::kNear);
// Get the prototype or initial map from the function. // Get the prototype or initial map from the function.
__ mov(result, __ mov(result,
FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
@ -3156,12 +3146,6 @@ void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
// Get the prototype from the initial map. // Get the prototype from the initial map.
__ mov(result, FieldOperand(result, Map::kPrototypeOffset)); __ mov(result, FieldOperand(result, Map::kPrototypeOffset));
__ jmp(&done, Label::kNear);
// Non-instance prototype: Fetch prototype from constructor field
// in the function's map.
__ bind(&non_instance);
__ mov(result, FieldOperand(result, Map::kConstructorOffset));
// All done. // All done.
__ bind(&done); __ bind(&done);