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

Side by Side Diff: src/full-codegen/arm/full-codegen-arm.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, 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/compiler.h" 10 #include "src/compiler.h"
(...skipping 4974 matching lines...) Expand 10 before | Expand all | Expand 10 after
4985 __ b(eq, if_true); 4985 __ b(eq, if_true);
4986 __ JumpIfSmi(r0, if_false); 4986 __ JumpIfSmi(r0, if_false);
4987 // Check for undetectable objects => true. 4987 // Check for undetectable objects => true.
4988 __ ldr(r0, FieldMemOperand(r0, HeapObject::kMapOffset)); 4988 __ ldr(r0, FieldMemOperand(r0, HeapObject::kMapOffset));
4989 __ ldrb(r1, FieldMemOperand(r0, Map::kBitFieldOffset)); 4989 __ ldrb(r1, FieldMemOperand(r0, Map::kBitFieldOffset));
4990 __ tst(r1, Operand(1 << Map::kIsUndetectable)); 4990 __ tst(r1, Operand(1 << Map::kIsUndetectable));
4991 Split(ne, if_true, if_false, fall_through); 4991 Split(ne, if_true, if_false, fall_through);
4992 4992
4993 } else if (String::Equals(check, factory->function_string())) { 4993 } else if (String::Equals(check, factory->function_string())) {
4994 __ JumpIfSmi(r0, if_false); 4994 __ JumpIfSmi(r0, if_false);
4995 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); 4995 __ ldr(r0, FieldMemOperand(r0, HeapObject::kMapOffset));
4996 __ CompareObjectType(r0, r0, r1, JS_FUNCTION_TYPE); 4996 __ ldrb(r1, FieldMemOperand(r0, Map::kBitFieldOffset));
4997 __ b(eq, if_true); 4997 __ and_(r1, r1,
4998 __ cmp(r1, Operand(JS_FUNCTION_PROXY_TYPE)); 4998 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
4999 __ cmp(r1, Operand(1 << Map::kIsCallable));
4999 Split(eq, if_true, if_false, fall_through); 5000 Split(eq, if_true, if_false, fall_through);
5000 } else if (String::Equals(check, factory->object_string())) { 5001 } else if (String::Equals(check, factory->object_string())) {
5001 __ JumpIfSmi(r0, if_false); 5002 __ JumpIfSmi(r0, if_false);
5002 __ CompareRoot(r0, Heap::kNullValueRootIndex); 5003 __ CompareRoot(r0, Heap::kNullValueRootIndex);
5003 __ b(eq, if_true); 5004 __ b(eq, if_true);
5004 // Check for JS objects => true. 5005 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
5005 __ CompareObjectType(r0, r0, r1, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE); 5006 __ CompareObjectType(r0, r0, r1, FIRST_SPEC_OBJECT_TYPE);
5006 __ b(lt, if_false); 5007 __ b(lt, if_false);
5007 __ CompareInstanceType(r0, r1, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); 5008 // Check for callable or undetectable objects => false.
5008 __ b(gt, if_false);
5009 // Check for undetectable objects => false.
5010 __ ldrb(r1, FieldMemOperand(r0, Map::kBitFieldOffset)); 5009 __ ldrb(r1, FieldMemOperand(r0, Map::kBitFieldOffset));
5011 __ tst(r1, Operand(1 << Map::kIsUndetectable)); 5010 __ tst(r1, Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
5012 Split(eq, if_true, if_false, fall_through); 5011 Split(eq, if_true, if_false, fall_through);
5013 // clang-format off 5012 // clang-format off
5014 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ 5013 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
5015 } else if (String::Equals(check, factory->type##_string())) { \ 5014 } else if (String::Equals(check, factory->type##_string())) { \
5016 __ JumpIfSmi(r0, if_false); \ 5015 __ JumpIfSmi(r0, if_false); \
5017 __ ldr(r0, FieldMemOperand(r0, HeapObject::kMapOffset)); \ 5016 __ ldr(r0, FieldMemOperand(r0, HeapObject::kMapOffset)); \
5018 __ CompareRoot(r0, Heap::k##Type##MapRootIndex); \ 5017 __ CompareRoot(r0, Heap::k##Type##MapRootIndex); \
5019 Split(eq, if_true, if_false, fall_through); 5018 Split(eq, if_true, if_false, fall_through);
5020 SIMD128_TYPES(SIMD128_TYPE) 5019 SIMD128_TYPES(SIMD128_TYPE)
5021 #undef SIMD128_TYPE 5020 #undef SIMD128_TYPE
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
5376 DCHECK(interrupt_address == 5375 DCHECK(interrupt_address ==
5377 isolate->builtins()->OsrAfterStackCheck()->entry()); 5376 isolate->builtins()->OsrAfterStackCheck()->entry());
5378 return OSR_AFTER_STACK_CHECK; 5377 return OSR_AFTER_STACK_CHECK;
5379 } 5378 }
5380 5379
5381 5380
5382 } // namespace internal 5381 } // namespace internal
5383 } // namespace v8 5382 } // namespace v8
5384 5383
5385 #endif // V8_TARGET_ARCH_ARM 5384 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698