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

Side by Side Diff: src/arm/macro-assembler-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 #include <limits.h> // For LONG_MIN, LONG_MAX. 5 #include <limits.h> // For LONG_MIN, LONG_MAX.
6 6
7 #if V8_TARGET_ARCH_ARM 7 #if V8_TARGET_ARCH_ARM
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/division-by-constant.h" 10 #include "src/base/division-by-constant.h"
(...skipping 1985 matching lines...) Expand 10 before | Expand all | Expand 10 after
1996 Register map, 1996 Register map,
1997 Register type_reg, 1997 Register type_reg,
1998 InstanceType type) { 1998 InstanceType type) {
1999 const Register temp = type_reg.is(no_reg) ? ip : type_reg; 1999 const Register temp = type_reg.is(no_reg) ? ip : type_reg;
2000 2000
2001 ldr(map, FieldMemOperand(object, HeapObject::kMapOffset)); 2001 ldr(map, FieldMemOperand(object, HeapObject::kMapOffset));
2002 CompareInstanceType(map, temp, type); 2002 CompareInstanceType(map, temp, type);
2003 } 2003 }
2004 2004
2005 2005
2006 void MacroAssembler::CheckObjectTypeRange(Register object,
2007 Register map,
2008 InstanceType min_type,
2009 InstanceType max_type,
2010 Label* false_label) {
2011 STATIC_ASSERT(Map::kInstanceTypeOffset < 4096);
2012 STATIC_ASSERT(LAST_TYPE < 256);
2013 ldr(map, FieldMemOperand(object, HeapObject::kMapOffset));
2014 ldrb(ip, FieldMemOperand(map, Map::kInstanceTypeOffset));
2015 sub(ip, ip, Operand(min_type));
2016 cmp(ip, Operand(max_type - min_type));
2017 b(hi, false_label);
2018 }
2019
2020
2021 void MacroAssembler::CompareInstanceType(Register map, 2006 void MacroAssembler::CompareInstanceType(Register map,
2022 Register type_reg, 2007 Register type_reg,
2023 InstanceType type) { 2008 InstanceType type) {
2024 // Registers map and type_reg can be ip. These two lines assert 2009 // Registers map and type_reg can be ip. These two lines assert
2025 // that ip can be used with the two instructions (the constants 2010 // that ip can be used with the two instructions (the constants
2026 // will never need ip). 2011 // will never need ip).
2027 STATIC_ASSERT(Map::kInstanceTypeOffset < 4096); 2012 STATIC_ASSERT(Map::kInstanceTypeOffset < 4096);
2028 STATIC_ASSERT(LAST_TYPE < 256); 2013 STATIC_ASSERT(LAST_TYPE < 256);
2029 ldrb(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset)); 2014 ldrb(type_reg, FieldMemOperand(map, Map::kInstanceTypeOffset));
2030 cmp(type_reg, Operand(type)); 2015 cmp(type_reg, Operand(type));
(...skipping 1776 matching lines...) Expand 10 before | Expand all | Expand 10 after
3807 } 3792 }
3808 } 3793 }
3809 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); 3794 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift));
3810 add(result, result, Operand(dividend, LSR, 31)); 3795 add(result, result, Operand(dividend, LSR, 31));
3811 } 3796 }
3812 3797
3813 } // namespace internal 3798 } // namespace internal
3814 } // namespace v8 3799 } // namespace v8
3815 3800
3816 #endif // V8_TARGET_ARCH_ARM 3801 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698