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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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/hydrogen-instructions.cc ('k') | src/json.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_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 5407 matching lines...) Expand 10 before | Expand all | Expand 10 after
5418 __ cmp(input, factory()->undefined_value()); 5418 __ cmp(input, factory()->undefined_value());
5419 __ j(equal, true_label, true_distance); 5419 __ j(equal, true_label, true_distance);
5420 __ JumpIfSmi(input, false_label, false_distance); 5420 __ JumpIfSmi(input, false_label, false_distance);
5421 // Check for undetectable objects => true. 5421 // Check for undetectable objects => true.
5422 __ mov(input, FieldOperand(input, HeapObject::kMapOffset)); 5422 __ mov(input, FieldOperand(input, HeapObject::kMapOffset));
5423 __ test_b(FieldOperand(input, Map::kBitFieldOffset), 5423 __ test_b(FieldOperand(input, Map::kBitFieldOffset),
5424 1 << Map::kIsUndetectable); 5424 1 << Map::kIsUndetectable);
5425 final_branch_condition = not_zero; 5425 final_branch_condition = not_zero;
5426 5426
5427 } else if (String::Equals(type_name, factory()->function_string())) { 5427 } else if (String::Equals(type_name, factory()->function_string())) {
5428 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
5429 __ JumpIfSmi(input, false_label, false_distance); 5428 __ JumpIfSmi(input, false_label, false_distance);
5430 __ CmpObjectType(input, JS_FUNCTION_TYPE, input); 5429 // Check for callable and not undetectable objects => true.
5431 __ j(equal, true_label, true_distance); 5430 __ mov(input, FieldOperand(input, HeapObject::kMapOffset));
5432 __ CmpInstanceType(input, JS_FUNCTION_PROXY_TYPE); 5431 __ movzx_b(input, FieldOperand(input, Map::kBitFieldOffset));
5432 __ and_(input, (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable));
5433 __ cmp(input, 1 << Map::kIsCallable);
5433 final_branch_condition = equal; 5434 final_branch_condition = equal;
5434 5435
5435 } else if (String::Equals(type_name, factory()->object_string())) { 5436 } else if (String::Equals(type_name, factory()->object_string())) {
5436 __ JumpIfSmi(input, false_label, false_distance); 5437 __ JumpIfSmi(input, false_label, false_distance);
5437 __ cmp(input, factory()->null_value()); 5438 __ cmp(input, factory()->null_value());
5438 __ j(equal, true_label, true_distance); 5439 __ j(equal, true_label, true_distance);
5439 __ CmpObjectType(input, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, input); 5440 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
5441 __ CmpObjectType(input, FIRST_SPEC_OBJECT_TYPE, input);
5440 __ j(below, false_label, false_distance); 5442 __ j(below, false_label, false_distance);
5441 __ CmpInstanceType(input, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); 5443 // Check for callable or undetectable objects => false.
5442 __ j(above, false_label, false_distance);
5443 // Check for undetectable objects => false.
5444 __ test_b(FieldOperand(input, Map::kBitFieldOffset), 5444 __ test_b(FieldOperand(input, Map::kBitFieldOffset),
5445 1 << Map::kIsUndetectable); 5445 (1 << Map::kIsCallable) | (1 << Map::kIsUndetectable));
5446 final_branch_condition = zero; 5446 final_branch_condition = zero;
5447 5447
5448 // clang-format off 5448 // clang-format off
5449 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ 5449 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
5450 } else if (String::Equals(type_name, factory()->type##_string())) { \ 5450 } else if (String::Equals(type_name, factory()->type##_string())) { \
5451 __ JumpIfSmi(input, false_label, false_distance); \ 5451 __ JumpIfSmi(input, false_label, false_distance); \
5452 __ cmp(FieldOperand(input, HeapObject::kMapOffset), \ 5452 __ cmp(FieldOperand(input, HeapObject::kMapOffset), \
5453 factory()->type##_map()); \ 5453 factory()->type##_map()); \
5454 final_branch_condition = equal; 5454 final_branch_condition = equal;
5455 SIMD128_TYPES(SIMD128_TYPE) 5455 SIMD128_TYPES(SIMD128_TYPE)
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
5754 RecordSafepoint(Safepoint::kNoLazyDeopt); 5754 RecordSafepoint(Safepoint::kNoLazyDeopt);
5755 } 5755 }
5756 5756
5757 5757
5758 #undef __ 5758 #undef __
5759 5759
5760 } // namespace internal 5760 } // namespace internal
5761 } // namespace v8 5761 } // namespace v8
5762 5762
5763 #endif // V8_TARGET_ARCH_IA32 5763 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | src/json.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698