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

Unified Diff: src/arm64/lithium-codegen-arm64.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: ia32, arm and arm64 ports. Misc cleanups. Created 5 years, 4 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/arm/macro-assembler-arm.cc ('k') | src/array.js » ('j') | src/execution.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/lithium-codegen-arm64.cc
diff --git a/src/arm64/lithium-codegen-arm64.cc b/src/arm64/lithium-codegen-arm64.cc
index 7cb6cb64bdd3b80ebb31a1be1b380891d7dc7039..f9b320d30371ffc1d083a0f0c26801a8c4db9ab5 100644
--- a/src/arm64/lithium-codegen-arm64.cc
+++ b/src/arm64/lithium-codegen-arm64.cc
@@ -5853,14 +5853,15 @@ void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) {
EmitTestAndBranch(instr, ne, scratch, 1 << Map::kIsUndetectable);
} else if (String::Equals(type_name, factory->function_string())) {
- STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
DCHECK(instr->temp1() != NULL);
- Register type = ToRegister(instr->temp1());
+ Register scratch = ToRegister(instr->temp1());
__ JumpIfSmi(value, false_label);
- __ JumpIfObjectType(value, type, type, JS_FUNCTION_TYPE, true_label);
- // HeapObject's type has been loaded into type register by JumpIfObjectType.
- EmitCompareAndBranch(instr, eq, type, JS_FUNCTION_PROXY_TYPE);
+ __ Ldr(scratch, FieldMemOperand(value, HeapObject::kMapOffset));
+ __ Ldrb(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset));
+ __ And(scratch, scratch,
+ (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable));
+ EmitCompareAndBranch(instr, eq, scratch, 1 << Map::kIsCallable);
} else if (String::Equals(type_name, factory->object_string())) {
DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL));
@@ -5869,13 +5870,13 @@ void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) {
__ JumpIfSmi(value, false_label);
__ JumpIfRoot(value, Heap::kNullValueRootIndex, true_label);
- __ JumpIfObjectType(value, map, scratch,
- FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, false_label, lt);
- __ CompareInstanceType(map, scratch, LAST_NONCALLABLE_SPEC_OBJECT_TYPE);
- __ B(gt, false_label);
- // Check for undetectable objects => false.
+ STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
+ __ JumpIfObjectType(value, map, scratch, FIRST_SPEC_OBJECT_TYPE,
+ false_label, lt);
+ // Check for callable or undetectable objects => false.
__ Ldrb(scratch, FieldMemOperand(map, Map::kBitFieldOffset));
- EmitTestAndBranch(instr, eq, scratch, 1 << Map::kIsUndetectable);
+ EmitTestAndBranch(instr, eq, scratch,
+ (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable));
// clang-format off
#define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/array.js » ('j') | src/execution.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698