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

Side by Side Diff: src/full-codegen/x64/full-codegen-x64.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/mips64/full-codegen-mips64.cc ('k') | src/harmony-array.js » ('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 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_X64 5 #if V8_TARGET_ARCH_X64
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 4900 matching lines...) Expand 10 before | Expand all | Expand 10 after
4911 __ CompareRoot(rax, Heap::kUndefinedValueRootIndex); 4911 __ CompareRoot(rax, Heap::kUndefinedValueRootIndex);
4912 __ j(equal, if_true); 4912 __ j(equal, if_true);
4913 __ JumpIfSmi(rax, if_false); 4913 __ JumpIfSmi(rax, if_false);
4914 // Check for undetectable objects => true. 4914 // Check for undetectable objects => true.
4915 __ movp(rdx, FieldOperand(rax, HeapObject::kMapOffset)); 4915 __ movp(rdx, FieldOperand(rax, HeapObject::kMapOffset));
4916 __ testb(FieldOperand(rdx, Map::kBitFieldOffset), 4916 __ testb(FieldOperand(rdx, Map::kBitFieldOffset),
4917 Immediate(1 << Map::kIsUndetectable)); 4917 Immediate(1 << Map::kIsUndetectable));
4918 Split(not_zero, if_true, if_false, fall_through); 4918 Split(not_zero, if_true, if_false, fall_through);
4919 } else if (String::Equals(check, factory->function_string())) { 4919 } else if (String::Equals(check, factory->function_string())) {
4920 __ JumpIfSmi(rax, if_false); 4920 __ JumpIfSmi(rax, if_false);
4921 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); 4921 // Check for callable and not undetectable objects => true.
4922 __ CmpObjectType(rax, JS_FUNCTION_TYPE, rdx); 4922 __ movp(rdx, FieldOperand(rax, HeapObject::kMapOffset));
4923 __ j(equal, if_true); 4923 __ movzxbl(rdx, FieldOperand(rdx, Map::kBitFieldOffset));
4924 __ CmpInstanceType(rdx, JS_FUNCTION_PROXY_TYPE); 4924 __ andb(rdx,
4925 Immediate((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
4926 __ cmpb(rdx, Immediate(1 << Map::kIsCallable));
4925 Split(equal, if_true, if_false, fall_through); 4927 Split(equal, if_true, if_false, fall_through);
4926 } else if (String::Equals(check, factory->object_string())) { 4928 } else if (String::Equals(check, factory->object_string())) {
4927 __ JumpIfSmi(rax, if_false); 4929 __ JumpIfSmi(rax, if_false);
4928 __ CompareRoot(rax, Heap::kNullValueRootIndex); 4930 __ CompareRoot(rax, Heap::kNullValueRootIndex);
4929 __ j(equal, if_true); 4931 __ j(equal, if_true);
4930 __ CmpObjectType(rax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, rdx); 4932 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
4933 __ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rdx);
4931 __ j(below, if_false); 4934 __ j(below, if_false);
4932 __ CmpInstanceType(rdx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); 4935 // Check for callable or undetectable objects => false.
4933 __ j(above, if_false);
4934 // Check for undetectable objects => false.
4935 __ testb(FieldOperand(rdx, Map::kBitFieldOffset), 4936 __ testb(FieldOperand(rdx, Map::kBitFieldOffset),
4936 Immediate(1 << Map::kIsUndetectable)); 4937 Immediate((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
4937 Split(zero, if_true, if_false, fall_through); 4938 Split(zero, if_true, if_false, fall_through);
4938 // clang-format off 4939 // clang-format off
4939 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ 4940 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
4940 } else if (String::Equals(check, factory->type##_string())) { \ 4941 } else if (String::Equals(check, factory->type##_string())) { \
4941 __ JumpIfSmi(rax, if_false); \ 4942 __ JumpIfSmi(rax, if_false); \
4942 __ movp(rax, FieldOperand(rax, HeapObject::kMapOffset)); \ 4943 __ movp(rax, FieldOperand(rax, HeapObject::kMapOffset)); \
4943 __ CompareRoot(rax, Heap::k##Type##MapRootIndex); \ 4944 __ CompareRoot(rax, Heap::k##Type##MapRootIndex); \
4944 Split(equal, if_true, if_false, fall_through); 4945 Split(equal, if_true, if_false, fall_through);
4945 SIMD128_TYPES(SIMD128_TYPE) 4946 SIMD128_TYPES(SIMD128_TYPE)
4946 #undef SIMD128_TYPE 4947 #undef SIMD128_TYPE
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
5241 Assembler::target_address_at(call_target_address, 5242 Assembler::target_address_at(call_target_address,
5242 unoptimized_code)); 5243 unoptimized_code));
5243 return OSR_AFTER_STACK_CHECK; 5244 return OSR_AFTER_STACK_CHECK;
5244 } 5245 }
5245 5246
5246 5247
5247 } // namespace internal 5248 } // namespace internal
5248 } // namespace v8 5249 } // namespace v8
5249 5250
5250 #endif // V8_TARGET_ARCH_X64 5251 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/harmony-array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698