Revision: 22566
Author: [email protected]
Date: Wed Jul 23 15:12:40 2014 UTC
Log: MIPS: Only to the relevant checks in LoadFunctionPrototype.
Port r22550 (c5209a6)
BUG=
[email protected]
Review URL: https://codereview.chromium.org/416513002
http://code.google.com/p/v8/source/detail?r=22566
Modified:
/branches/bleeding_edge/src/mips/macro-assembler-mips.cc
/branches/bleeding_edge/src/mips64/macro-assembler-mips64.cc
=======================================
--- /branches/bleeding_edge/src/mips/macro-assembler-mips.cc Tue Jul 22
14:34:55 2014 UTC
+++ /branches/bleeding_edge/src/mips/macro-assembler-mips.cc Wed Jul 23
15:12:40 2014 UTC
@@ -3846,14 +3846,15 @@
Register scratch,
Label* miss,
bool miss_on_bound_function) {
- // Check that the receiver isn't a smi.
- JumpIfSmi(function, miss);
+ Label non_instance;
+ if (miss_on_bound_function) {
+ // Check that the receiver isn't a smi.
+ JumpIfSmi(function, miss);
- // Check that the function really is a function. Load map into result
reg.
- GetObjectType(function, result, scratch);
- Branch(miss, ne, scratch, Operand(JS_FUNCTION_TYPE));
+ // Check that the function really is a function. Load map into result
reg.
+ GetObjectType(function, result, scratch);
+ Branch(miss, ne, scratch, Operand(JS_FUNCTION_TYPE));
- if (miss_on_bound_function) {
lw(scratch,
FieldMemOperand(function, JSFunction::kSharedFunctionInfoOffset));
lw(scratch,
@@ -3861,13 +3862,12 @@
And(scratch, scratch,
Operand(Smi::FromInt(1 << SharedFunctionInfo::kBoundFunction)));
Branch(miss, ne, scratch, Operand(zero_reg));
+
+ // Make sure that the function has an instance prototype.
+ lbu(scratch, FieldMemOperand(result, Map::kBitFieldOffset));
+ And(scratch, scratch, Operand(1 << Map::kHasNonInstancePrototype));
+ Branch(&non_instance, ne, scratch, Operand(zero_reg));
}
-
- // 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,
@@ -3886,12 +3886,15 @@
// Get the prototype from the initial map.
lw(result, FieldMemOperand(result, Map::kPrototypeOffset));
- jmp(&done);
+
+ if (miss_on_bound_function) {
+ jmp(&done);
- // Non-instance prototype: Fetch prototype from constructor field
- // in initial map.
- bind(&non_instance);
- lw(result, FieldMemOperand(result, Map::kConstructorOffset));
+ // Non-instance prototype: Fetch prototype from constructor field
+ // in initial map.
+ bind(&non_instance);
+ lw(result, FieldMemOperand(result, Map::kConstructorOffset));
+ }
// All done.
bind(&done);
=======================================
--- /branches/bleeding_edge/src/mips64/macro-assembler-mips64.cc Tue Jul 22
14:34:55 2014 UTC
+++ /branches/bleeding_edge/src/mips64/macro-assembler-mips64.cc Wed Jul 23
15:12:40 2014 UTC
@@ -3933,32 +3933,28 @@
Register scratch,
Label* miss,
bool miss_on_bound_function) {
- // Check that the receiver isn't a smi.
- JumpIfSmi(function, miss);
+ Label non_instance;
+ if (miss_on_bound_function) {
+ // Check that the receiver isn't a smi.
+ JumpIfSmi(function, miss);
- // Check that the function really is a function. Load map into result
reg.
- GetObjectType(function, result, scratch);
- Branch(miss, ne, scratch, Operand(JS_FUNCTION_TYPE));
+ // Check that the function really is a function. Load map into result
reg.
+ GetObjectType(function, result, scratch);
+ Branch(miss, ne, scratch, Operand(JS_FUNCTION_TYPE));
- if (miss_on_bound_function) {
ld(scratch,
FieldMemOperand(function, JSFunction::kSharedFunctionInfoOffset));
- // ld(scratch,
- // FieldMemOperand(scratch,
SharedFunctionInfo::kCompilerHintsOffset));
- // And(scratch, scratch,
- // Operand(Smi::FromInt(1 << SharedFunctionInfo::kBoundFunction)));
lwu(scratch,
FieldMemOperand(scratch,
SharedFunctionInfo::kCompilerHintsOffset));
And(scratch, scratch,
Operand(1 << SharedFunctionInfo::kBoundFunction));
Branch(miss, ne, scratch, Operand(zero_reg));
+
+ // Make sure that the function has an instance prototype.
+ lbu(scratch, FieldMemOperand(result, Map::kBitFieldOffset));
+ And(scratch, scratch, Operand(1 << Map::kHasNonInstancePrototype));
+ Branch(&non_instance, ne, scratch, Operand(zero_reg));
}
-
- // 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,
@@ -3977,12 +3973,15 @@
// Get the prototype from the initial map.
ld(result, FieldMemOperand(result, Map::kPrototypeOffset));
- jmp(&done);
+
+ if (miss_on_bound_function) {
+ jmp(&done);
- // Non-instance prototype: Fetch prototype from constructor field
- // in initial map.
- bind(&non_instance);
- ld(result, FieldMemOperand(result, Map::kConstructorOffset));
+ // Non-instance prototype: Fetch prototype from constructor field
+ // in initial map.
+ bind(&non_instance);
+ ld(result, FieldMemOperand(result, Map::kConstructorOffset));
+ }
// All done.
bind(&done);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.