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

Side by Side Diff: src/arm/lithium-codegen-arm.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/api-natives.cc ('k') | src/arm/macro-assembler-arm.h » ('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 #include "src/arm/lithium-codegen-arm.h" 5 #include "src/arm/lithium-codegen-arm.h"
6 #include "src/arm/lithium-gap-resolver-arm.h" 6 #include "src/arm/lithium-gap-resolver-arm.h"
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/cpu-profiler.h" 10 #include "src/cpu-profiler.h"
(...skipping 5516 matching lines...) Expand 10 before | Expand all | Expand 10 after
5527 __ CompareRoot(input, Heap::kUndefinedValueRootIndex); 5527 __ CompareRoot(input, Heap::kUndefinedValueRootIndex);
5528 __ b(eq, true_label); 5528 __ b(eq, true_label);
5529 __ JumpIfSmi(input, false_label); 5529 __ JumpIfSmi(input, false_label);
5530 // Check for undetectable objects => true. 5530 // Check for undetectable objects => true.
5531 __ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); 5531 __ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset));
5532 __ ldrb(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset)); 5532 __ ldrb(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset));
5533 __ tst(scratch, Operand(1 << Map::kIsUndetectable)); 5533 __ tst(scratch, Operand(1 << Map::kIsUndetectable));
5534 final_branch_condition = ne; 5534 final_branch_condition = ne;
5535 5535
5536 } else if (String::Equals(type_name, factory->function_string())) { 5536 } else if (String::Equals(type_name, factory->function_string())) {
5537 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
5538 Register type_reg = scratch;
5539 __ JumpIfSmi(input, false_label); 5537 __ JumpIfSmi(input, false_label);
5540 __ CompareObjectType(input, scratch, type_reg, JS_FUNCTION_TYPE); 5538 __ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset));
5541 __ b(eq, true_label); 5539 __ ldrb(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset));
5542 __ cmp(type_reg, Operand(JS_FUNCTION_PROXY_TYPE)); 5540 __ and_(scratch, scratch,
5541 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
5542 __ cmp(scratch, Operand(1 << Map::kIsCallable));
5543 final_branch_condition = eq; 5543 final_branch_condition = eq;
5544 5544
5545 } else if (String::Equals(type_name, factory->object_string())) { 5545 } else if (String::Equals(type_name, factory->object_string())) {
5546 Register map = scratch;
5547 __ JumpIfSmi(input, false_label); 5546 __ JumpIfSmi(input, false_label);
5548 __ CompareRoot(input, Heap::kNullValueRootIndex); 5547 __ CompareRoot(input, Heap::kNullValueRootIndex);
5549 __ b(eq, true_label); 5548 __ b(eq, true_label);
5550 __ CheckObjectTypeRange(input, 5549 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
5551 map, 5550 __ CompareObjectType(input, scratch, ip, FIRST_SPEC_OBJECT_TYPE);
5552 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE, 5551 __ b(lt, false_label);
5553 LAST_NONCALLABLE_SPEC_OBJECT_TYPE, 5552 // Check for callable or undetectable objects => false.
5554 false_label); 5553 __ ldrb(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset));
5555 // Check for undetectable objects => false. 5554 __ tst(scratch,
5556 __ ldrb(scratch, FieldMemOperand(map, Map::kBitFieldOffset)); 5555 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
5557 __ tst(scratch, Operand(1 << Map::kIsUndetectable));
5558 final_branch_condition = eq; 5556 final_branch_condition = eq;
5559 5557
5560 // clang-format off 5558 // clang-format off
5561 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ 5559 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
5562 } else if (String::Equals(type_name, factory->type##_string())) { \ 5560 } else if (String::Equals(type_name, factory->type##_string())) { \
5563 __ JumpIfSmi(input, false_label); \ 5561 __ JumpIfSmi(input, false_label); \
5564 __ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); \ 5562 __ ldr(scratch, FieldMemOperand(input, HeapObject::kMapOffset)); \
5565 __ CompareRoot(scratch, Heap::k##Type##MapRootIndex); \ 5563 __ CompareRoot(scratch, Heap::k##Type##MapRootIndex); \
5566 final_branch_condition = eq; 5564 final_branch_condition = eq;
5567 SIMD128_TYPES(SIMD128_TYPE) 5565 SIMD128_TYPES(SIMD128_TYPE)
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
5877 __ push(ToRegister(instr->function())); 5875 __ push(ToRegister(instr->function()));
5878 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5876 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5879 RecordSafepoint(Safepoint::kNoLazyDeopt); 5877 RecordSafepoint(Safepoint::kNoLazyDeopt);
5880 } 5878 }
5881 5879
5882 5880
5883 #undef __ 5881 #undef __
5884 5882
5885 } // namespace internal 5883 } // namespace internal
5886 } // namespace v8 5884 } // namespace v8
OLDNEW
« no previous file with comments | « src/api-natives.cc ('k') | src/arm/macro-assembler-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698