Index: src/ia32/macro-assembler-ia32.cc |
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc |
index 3aaa22acc957033d2cab3435563ed65d997b0fbb..fbb90370b04076623ab84987f6bcedf3918f2153 100644 |
--- a/src/ia32/macro-assembler-ia32.cc |
+++ b/src/ia32/macro-assembler-ia32.cc |
@@ -1492,6 +1492,19 @@ void MacroAssembler::InitializeFieldsWithFiller(Register start_offset, |
} |
+void MacroAssembler::BooleanBitTest(Register object, |
+ int field_offset, |
+ int bit_index) { |
+ bit_index += kSmiTagSize + kSmiShiftSize; |
+ ASSERT(IsPowerOf2(kBitsPerByte)); |
+ int byte_index = bit_index / kBitsPerByte; |
+ int byte_bit_index = bit_index & (kBitsPerByte - 1); |
+ test_b(FieldOperand(object, field_offset + byte_index), |
+ static_cast<byte>(1 << byte_bit_index)); |
+} |
+ |
+ |
+ |
void MacroAssembler::NegativeZeroTest(Register result, |
Register op, |
Label* then_label) { |
@@ -1522,7 +1535,8 @@ void MacroAssembler::NegativeZeroTest(Register result, |
void MacroAssembler::TryGetFunctionPrototype(Register function, |
Register result, |
Register scratch, |
- Label* miss) { |
+ Label* miss, |
+ bool miss_on_bound_function) { |
// Check that the receiver isn't a smi. |
JumpIfSmi(function, miss); |
@@ -1530,6 +1544,15 @@ void MacroAssembler::TryGetFunctionPrototype(Register function, |
CmpObjectType(function, JS_FUNCTION_TYPE, result); |
j(not_equal, miss); |
+ if (miss_on_bound_function) { |
+ // If a bound function, go to miss label. |
+ mov(scratch, |
+ FieldOperand(function, JSFunction::kSharedFunctionInfoOffset)); |
+ BooleanBitTest(scratch, SharedFunctionInfo::kCompilerHintsOffset, |
+ SharedFunctionInfo::kBoundFunction); |
+ j(not_zero, miss); |
+ } |
+ |
// Make sure that the function has an instance prototype. |
Label non_instance; |
movzx_b(scratch, FieldOperand(result, Map::kBitFieldOffset)); |