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

Side by Side Diff: src/mips/lithium-codegen-mips.cc

Issue 1310233004: MIPS: [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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved.7 1 // Copyright 2012 the V8 project authors. All rights reserved.7
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 5559 matching lines...) Expand 10 before | Expand all | Expand 10 after
5570 __ JumpIfSmi(input, false_label); 5570 __ JumpIfSmi(input, false_label);
5571 // Check for undetectable objects => true. 5571 // Check for undetectable objects => true.
5572 __ lw(input, FieldMemOperand(input, HeapObject::kMapOffset)); 5572 __ lw(input, FieldMemOperand(input, HeapObject::kMapOffset));
5573 __ lbu(at, FieldMemOperand(input, Map::kBitFieldOffset)); 5573 __ lbu(at, FieldMemOperand(input, Map::kBitFieldOffset));
5574 __ And(at, at, 1 << Map::kIsUndetectable); 5574 __ And(at, at, 1 << Map::kIsUndetectable);
5575 *cmp1 = at; 5575 *cmp1 = at;
5576 *cmp2 = Operand(zero_reg); 5576 *cmp2 = Operand(zero_reg);
5577 final_branch_condition = ne; 5577 final_branch_condition = ne;
5578 5578
5579 } else if (String::Equals(type_name, factory->function_string())) { 5579 } else if (String::Equals(type_name, factory->function_string())) {
5580 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
5581 __ JumpIfSmi(input, false_label); 5580 __ JumpIfSmi(input, false_label);
5582 __ GetObjectType(input, scratch, input); 5581 __ lw(scratch, FieldMemOperand(input, HeapObject::kMapOffset));
5583 __ Branch(true_label, eq, input, Operand(JS_FUNCTION_TYPE)); 5582 __ lbu(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset));
5584 *cmp1 = input; 5583 __ And(scratch, scratch,
5585 *cmp2 = Operand(JS_FUNCTION_PROXY_TYPE); 5584 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
5585 *cmp1 = scratch;
5586 *cmp2 = Operand(1 << Map::kIsCallable);
5586 final_branch_condition = eq; 5587 final_branch_condition = eq;
5587 5588
5588 } else if (String::Equals(type_name, factory->object_string())) { 5589 } else if (String::Equals(type_name, factory->object_string())) {
5589 __ JumpIfSmi(input, false_label); 5590 __ JumpIfSmi(input, false_label);
5590 __ LoadRoot(at, Heap::kNullValueRootIndex); 5591 __ LoadRoot(at, Heap::kNullValueRootIndex);
5591 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); 5592 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input));
5592 Register map = input; 5593 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
5593 __ GetObjectType(input, map, scratch); 5594 __ GetObjectType(input, scratch, at);
5594 __ Branch(false_label, 5595 __ Branch(false_label, lt, at, Operand(FIRST_SPEC_OBJECT_TYPE));
paul.l... 2015/08/27 17:59:32 It's a bit dodgy to use 'at' here. It happens to w
akos.palfi.imgtec 2015/08/27 18:51:17 Done.
5595 lt, scratch, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); 5596 // Check for callable or undetectable objects => false.
5596 __ Branch(USE_DELAY_SLOT, false_label, 5597 __ lbu(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset));
5597 gt, scratch, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); 5598 __ And(at, scratch,
5598 // map is still valid, so the BitField can be loaded in delay slot. 5599 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
5599 // Check for undetectable objects => false.
5600 __ lbu(at, FieldMemOperand(map, Map::kBitFieldOffset));
5601 __ And(at, at, 1 << Map::kIsUndetectable);
5602 *cmp1 = at; 5600 *cmp1 = at;
5603 *cmp2 = Operand(zero_reg); 5601 *cmp2 = Operand(zero_reg);
5604 final_branch_condition = eq; 5602 final_branch_condition = eq;
5605 5603
5606 // clang-format off 5604 // clang-format off
5607 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ 5605 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
5608 } else if (String::Equals(type_name, factory->type##_string())) { \ 5606 } else if (String::Equals(type_name, factory->type##_string())) { \
5609 __ JumpIfSmi(input, false_label); \ 5607 __ JumpIfSmi(input, false_label); \
5610 __ lw(input, FieldMemOperand(input, HeapObject::kMapOffset)); \ 5608 __ lw(input, FieldMemOperand(input, HeapObject::kMapOffset)); \
5611 __ LoadRoot(at, Heap::k##Type##MapRootIndex); \ 5609 __ LoadRoot(at, Heap::k##Type##MapRootIndex); \
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
5927 __ Push(at, ToRegister(instr->function())); 5925 __ Push(at, ToRegister(instr->function()));
5928 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5926 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5929 RecordSafepoint(Safepoint::kNoLazyDeopt); 5927 RecordSafepoint(Safepoint::kNoLazyDeopt);
5930 } 5928 }
5931 5929
5932 5930
5933 #undef __ 5931 #undef __
5934 5932
5935 } // namespace internal 5933 } // namespace internal
5936 } // namespace v8 5934 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698