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

Side by Side Diff: src/full-codegen/x87/full-codegen-x87.cc

Issue 1310653004: X87: [es6] Initial steps towards a correct implementation of IsCallable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « no previous file | src/x87/lithium-codegen-x87.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 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_X87 5 #if V8_TARGET_ARCH_X87
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 4873 matching lines...) Expand 10 before | Expand all | Expand 10 after
4884 __ cmp(eax, isolate()->factory()->true_value()); 4884 __ cmp(eax, isolate()->factory()->true_value());
4885 __ j(equal, if_true); 4885 __ j(equal, if_true);
4886 __ cmp(eax, isolate()->factory()->false_value()); 4886 __ cmp(eax, isolate()->factory()->false_value());
4887 Split(equal, if_true, if_false, fall_through); 4887 Split(equal, if_true, if_false, fall_through);
4888 } else if (String::Equals(check, factory->undefined_string())) { 4888 } else if (String::Equals(check, factory->undefined_string())) {
4889 __ cmp(eax, isolate()->factory()->undefined_value()); 4889 __ cmp(eax, isolate()->factory()->undefined_value());
4890 __ j(equal, if_true); 4890 __ j(equal, if_true);
4891 __ JumpIfSmi(eax, if_false); 4891 __ JumpIfSmi(eax, if_false);
4892 // Check for undetectable objects => true. 4892 // Check for undetectable objects => true.
4893 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset)); 4893 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset));
4894 __ movzx_b(ecx, FieldOperand(edx, Map::kBitFieldOffset)); 4894 __ test_b(FieldOperand(edx, Map::kBitFieldOffset),
4895 __ test(ecx, Immediate(1 << Map::kIsUndetectable)); 4895 1 << Map::kIsUndetectable);
4896 Split(not_zero, if_true, if_false, fall_through); 4896 Split(not_zero, if_true, if_false, fall_through);
4897 } else if (String::Equals(check, factory->function_string())) { 4897 } else if (String::Equals(check, factory->function_string())) {
4898 __ JumpIfSmi(eax, if_false); 4898 __ JumpIfSmi(eax, if_false);
4899 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); 4899 // Check for callable and not undetectable objects => true.
4900 __ CmpObjectType(eax, JS_FUNCTION_TYPE, edx); 4900 __ mov(edx, FieldOperand(eax, HeapObject::kMapOffset));
4901 __ j(equal, if_true); 4901 __ movzx_b(ecx, FieldOperand(edx, Map::kBitFieldOffset));
4902 __ CmpInstanceType(edx, JS_FUNCTION_PROXY_TYPE); 4902 __ and_(ecx, (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable));
4903 __ cmp(ecx, 1 << Map::kIsCallable);
4903 Split(equal, if_true, if_false, fall_through); 4904 Split(equal, if_true, if_false, fall_through);
4904 } else if (String::Equals(check, factory->object_string())) { 4905 } else if (String::Equals(check, factory->object_string())) {
4905 __ JumpIfSmi(eax, if_false); 4906 __ JumpIfSmi(eax, if_false);
4906 __ cmp(eax, isolate()->factory()->null_value()); 4907 __ cmp(eax, isolate()->factory()->null_value());
4907 __ j(equal, if_true); 4908 __ j(equal, if_true);
4908 __ CmpObjectType(eax, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, edx); 4909 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
4910 __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, edx);
4909 __ j(below, if_false); 4911 __ j(below, if_false);
4910 __ CmpInstanceType(edx, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); 4912 // Check for callable or undetectable objects => false.
4911 __ j(above, if_false);
4912 // Check for undetectable objects => false.
4913 __ test_b(FieldOperand(edx, Map::kBitFieldOffset), 4913 __ test_b(FieldOperand(edx, Map::kBitFieldOffset),
4914 1 << Map::kIsUndetectable); 4914 (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable));
4915 Split(zero, if_true, if_false, fall_through); 4915 Split(zero, if_true, if_false, fall_through);
4916 // clang-format off 4916 // clang-format off
4917 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ 4917 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
4918 } else if (String::Equals(check, factory->type##_string())) { \ 4918 } else if (String::Equals(check, factory->type##_string())) { \
4919 __ JumpIfSmi(eax, if_false); \ 4919 __ JumpIfSmi(eax, if_false); \
4920 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), \ 4920 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), \
4921 isolate()->factory()->type##_map()); \ 4921 isolate()->factory()->type##_map()); \
4922 Split(equal, if_true, if_false, fall_through); 4922 Split(equal, if_true, if_false, fall_through);
4923 SIMD128_TYPES(SIMD128_TYPE) 4923 SIMD128_TYPES(SIMD128_TYPE)
4924 #undef SIMD128_TYPE 4924 #undef SIMD128_TYPE
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
5218 Assembler::target_address_at(call_target_address, 5218 Assembler::target_address_at(call_target_address,
5219 unoptimized_code)); 5219 unoptimized_code));
5220 return OSR_AFTER_STACK_CHECK; 5220 return OSR_AFTER_STACK_CHECK;
5221 } 5221 }
5222 5222
5223 5223
5224 } // namespace internal 5224 } // namespace internal
5225 } // namespace v8 5225 } // namespace v8
5226 5226
5227 #endif // V8_TARGET_ARCH_X87 5227 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « no previous file | src/x87/lithium-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698