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

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: 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 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 4674 matching lines...) Expand 10 before | Expand all | Expand 10 after
4685 __ JumpIfRoot(x0, Heap::kUndefinedValueRootIndex, if_true); 4685 __ JumpIfRoot(x0, Heap::kUndefinedValueRootIndex, if_true);
4686 __ JumpIfSmi(x0, if_false); 4686 __ JumpIfSmi(x0, if_false);
4687 // Check for undetectable objects => true. 4687 // Check for undetectable objects => true.
4688 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset)); 4688 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset));
4689 __ Ldrb(x1, FieldMemOperand(x0, Map::kBitFieldOffset)); 4689 __ Ldrb(x1, FieldMemOperand(x0, Map::kBitFieldOffset));
4690 __ TestAndSplit(x1, 1 << Map::kIsUndetectable, if_false, if_true, 4690 __ TestAndSplit(x1, 1 << Map::kIsUndetectable, if_false, if_true,
4691 fall_through); 4691 fall_through);
4692 } else if (String::Equals(check, factory->function_string())) { 4692 } else if (String::Equals(check, factory->function_string())) {
4693 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof function_string"); 4693 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof function_string");
4694 __ JumpIfSmi(x0, if_false); 4694 __ JumpIfSmi(x0, if_false);
4695 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); 4695 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset));
4696 __ JumpIfObjectType(x0, x10, x11, JS_FUNCTION_TYPE, if_true); 4696 __ Ldrb(x1, FieldMemOperand(x0, Map::kBitFieldOffset));
4697 __ CompareAndSplit(x11, JS_FUNCTION_PROXY_TYPE, eq, if_true, if_false, 4697 __ And(x1, x1, (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable));
4698 fall_through); 4698 __ CompareAndSplit(x1, Operand(1 << Map::kIsCallable), eq, if_true,
4699 if_false, fall_through);
4699 } else if (String::Equals(check, factory->object_string())) { 4700 } else if (String::Equals(check, factory->object_string())) {
4700 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof object_string"); 4701 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof object_string");
4701 __ JumpIfSmi(x0, if_false); 4702 __ JumpIfSmi(x0, if_false);
4702 __ JumpIfRoot(x0, Heap::kNullValueRootIndex, if_true); 4703 __ JumpIfRoot(x0, Heap::kNullValueRootIndex, if_true);
4703 // Check for JS objects => true. 4704 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
4704 Register map = x10; 4705 __ JumpIfObjectType(x0, x10, x11, FIRST_SPEC_OBJECT_TYPE, if_false, lt);
4705 __ JumpIfObjectType(x0, map, x11, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, 4706 // Check for callable or undetectable objects => false.
4706 if_false, lt); 4707 __ Ldrb(x10, FieldMemOperand(x10, Map::kBitFieldOffset));
4707 __ CompareInstanceType(map, x11, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); 4708 __ TestAndSplit(x10, (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable),
4708 __ B(gt, if_false); 4709 if_true, if_false, fall_through);
4709 // Check for undetectable objects => false.
4710 __ Ldrb(x10, FieldMemOperand(map, Map::kBitFieldOffset));
4711
4712 __ TestAndSplit(x10, 1 << Map::kIsUndetectable, if_true, if_false,
4713 fall_through);
4714 // clang-format off 4710 // clang-format off
4715 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ 4711 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
4716 } else if (String::Equals(check, factory->type##_string())) { \ 4712 } else if (String::Equals(check, factory->type##_string())) { \
4717 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof " \ 4713 ASM_LOCATION("FullCodeGenerator::EmitLiteralCompareTypeof " \
4718 #type "_string"); \ 4714 #type "_string"); \
4719 __ JumpIfSmi(x0, if_true); \ 4715 __ JumpIfSmi(x0, if_true); \
4720 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset)); \ 4716 __ Ldr(x0, FieldMemOperand(x0, HeapObject::kMapOffset)); \
4721 __ CompareRoot(x0, Heap::k##Type##MapRootIndex); \ 4717 __ CompareRoot(x0, Heap::k##Type##MapRootIndex); \
4722 Split(eq, if_true, if_false, fall_through); 4718 Split(eq, if_true, if_false, fall_through);
4723 SIMD128_TYPES(SIMD128_TYPE) 4719 SIMD128_TYPES(SIMD128_TYPE)
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
5366 } 5362 }
5367 5363
5368 return INTERRUPT; 5364 return INTERRUPT;
5369 } 5365 }
5370 5366
5371 5367
5372 } // namespace internal 5368 } // namespace internal
5373 } // namespace v8 5369 } // namespace v8
5374 5370
5375 #endif // V8_TARGET_ARCH_ARM64 5371 #endif // V8_TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698