Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(831)

Unified Diff: src/mips64/lithium-codegen-mips64.cc

Issue 1316933002: [es6] Initial steps towards a correct implementation of IsCallable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase again. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/object-observe.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips64/lithium-codegen-mips64.cc
diff --git a/src/mips64/lithium-codegen-mips64.cc b/src/mips64/lithium-codegen-mips64.cc
index 8168d7041ba89fec13e54b38a912625ba2a2e2a7..a612681c5b37086779db837e4ec22f94da26eecd 100644
--- a/src/mips64/lithium-codegen-mips64.cc
+++ b/src/mips64/lithium-codegen-mips64.cc
@@ -5768,28 +5768,26 @@ Condition LCodeGen::EmitTypeofIs(Label* true_label,
final_branch_condition = ne;
} else if (String::Equals(type_name, factory->function_string())) {
- STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
__ JumpIfSmi(input, false_label);
- __ GetObjectType(input, scratch, input);
- __ Branch(true_label, eq, input, Operand(JS_FUNCTION_TYPE));
- *cmp1 = input;
- *cmp2 = Operand(JS_FUNCTION_PROXY_TYPE);
+ __ ld(scratch, FieldMemOperand(input, HeapObject::kMapOffset));
+ __ lbu(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset));
+ __ And(scratch, scratch,
+ Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
+ *cmp1 = scratch;
+ *cmp2 = Operand(1 << Map::kIsCallable);
final_branch_condition = eq;
} else if (String::Equals(type_name, factory->object_string())) {
__ JumpIfSmi(input, false_label);
__ LoadRoot(at, Heap::kNullValueRootIndex);
__ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input));
- Register map = input;
- __ GetObjectType(input, map, scratch);
- __ Branch(false_label,
- lt, scratch, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE));
- __ Branch(USE_DELAY_SLOT, false_label,
- gt, scratch, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE));
- // map is still valid, so the BitField can be loaded in delay slot.
- // Check for undetectable objects => false.
- __ lbu(at, FieldMemOperand(map, Map::kBitFieldOffset));
- __ And(at, at, 1 << Map::kIsUndetectable);
+ STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
+ __ GetObjectType(input, scratch, scratch1());
+ __ Branch(false_label, lt, scratch1(), Operand(FIRST_SPEC_OBJECT_TYPE));
+ // Check for callable or undetectable objects => false.
+ __ lbu(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset));
+ __ And(at, scratch,
+ Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
*cmp1 = at;
*cmp2 = Operand(zero_reg);
final_branch_condition = eq;
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/object-observe.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698