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

Side by Side Diff: src/full-codegen/arm64/full-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: 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 unified diff | Download patch
« no previous file with comments | « src/full-codegen/arm/full-codegen-arm.cc ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 5 #if V8_TARGET_ARCH_ARM64
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 4650 matching lines...) Expand 10 before | Expand all | Expand 10 after
4661 __ JumpIfRoot(x0, Heap::kUndefinedValueRootIndex, if_true); 4661 __ JumpIfRoot(x0, Heap::kUndefinedValueRootIndex, if_true);
4662 __ JumpIfSmi(x0, if_false); 4662 __ JumpIfSmi(x0, if_false);
4663 // Check for undetectable objects => true. 4663 // Check for undetectable objects => true.
4664 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset)); 4664 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset));
4665 __ Ldrb(x1, FieldMemOperand(x0, Map::kBitFieldOffset)); 4665 __ Ldrb(x1, FieldMemOperand(x0, Map::kBitFieldOffset));
4666 __ TestAndSplit(x1, 1 << Map::kIsUndetectable, if_false, if_true, 4666 __ TestAndSplit(x1, 1 << Map::kIsUndetectable, if_false, if_true,
4667 fall_through); 4667 fall_through);
4668 } else if (String::Equals(check, factory->function_string())) { 4668 } else if (String::Equals(check, factory->function_string())) {
4669 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof function_string"); 4669 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof function_string");
4670 __ JumpIfSmi(x0, if_false); 4670 __ JumpIfSmi(x0, if_false);
4671 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); 4671 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset));
4672 __ JumpIfObjectType(x0, x10, x11, JS_FUNCTION_TYPE, if_true); 4672 __ Ldrb(x1, FieldMemOperand(x0, Map::kBitFieldOffset));
4673 __ CompareAndSplit(x11, JS_FUNCTION_PROXY_TYPE, eq, if_true, if_false, 4673 __ And(x1, x1, (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable));
4674 fall_through); 4674 __ CompareAndSplit(x1, Operand(1 << Map::kIsCallable), eq, if_true,
4675 if_false, fall_through);
4675 } else if (String::Equals(check, factory->object_string())) { 4676 } else if (String::Equals(check, factory->object_string())) {
4676 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof object_string"); 4677 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof object_string");
4677 __ JumpIfSmi(x0, if_false); 4678 __ JumpIfSmi(x0, if_false);
4678 __ JumpIfRoot(x0, Heap::kNullValueRootIndex, if_true); 4679 __ JumpIfRoot(x0, Heap::kNullValueRootIndex, if_true);
4679 // Check for JS objects => true. 4680 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
4680 Register map = x10; 4681 __ JumpIfObjectType(x0, x10, x11, FIRST_SPEC_OBJECT_TYPE, if_false, lt);
4681 __ JumpIfObjectType(x0, map, x11, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, 4682 // Check for callable or undetectable objects => false.
4682 if_false, lt); 4683 __ Ldrb(x10, FieldMemOperand(x10, Map::kBitFieldOffset));
4683 __ CompareInstanceType(map, x11, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); 4684 __ TestAndSplit(x10, (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable),
4684 __ B(gt, if_false); 4685 if_true, if_false, fall_through);
4685 // Check for undetectable objects => false.
4686 __ Ldrb(x10, FieldMemOperand(map, Map::kBitFieldOffset));
4687
4688 __ TestAndSplit(x10, 1 << Map::kIsUndetectable, if_true, if_false,
4689 fall_through);
4690 // clang-format off 4686 // clang-format off
4691 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ 4687 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
4692 } else if (String::Equals(check, factory->type##_string())) { \ 4688 } else if (String::Equals(check, factory->type##_string())) { \
4693 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof " \ 4689 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof " \
4694 #type "_string"); \ 4690 #type "_string"); \
4695 __ JumpIfSmi(x0, if_true); \ 4691 __ JumpIfSmi(x0, if_true); \
4696 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset)); \ 4692 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset)); \
4697 __ CompareRoot(x0, Heap::k##Type##MapRootIndex); \ 4693 __ CompareRoot(x0, Heap::k##Type##MapRootIndex); \
4698 Split(eq, if_true, if_false, fall_through); 4694 Split(eq, if_true, if_false, fall_through);
4699 SIMD128_TYPES(SIMD128_TYPE) 4695 SIMD128_TYPES(SIMD128_TYPE)
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
5342 } 5338 }
5343 5339
5344 return INTERRUPT; 5340 return INTERRUPT;
5345 } 5341 }
5346 5342
5347 5343
5348 } // namespace internal 5344 } // namespace internal
5349 } // namespace v8 5345 } // namespace v8
5350 5346
5351 #endif // V8_TARGET_ARCH_ARM64 5347 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/full-codegen/arm/full-codegen-arm.cc ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698