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

Side by Side Diff: src/mips64/lithium-codegen-mips64.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/mips/lithium-codegen-mips.cc ('k') | src/object-observe.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 #include "src/code-factory.h" 5 #include "src/code-factory.h"
6 #include "src/code-stubs.h" 6 #include "src/code-stubs.h"
7 #include "src/cpu-profiler.h" 7 #include "src/cpu-profiler.h"
8 #include "src/hydrogen-osr.h" 8 #include "src/hydrogen-osr.h"
9 #include "src/ic/ic.h" 9 #include "src/ic/ic.h"
10 #include "src/ic/stub-cache.h" 10 #include "src/ic/stub-cache.h"
(...skipping 5750 matching lines...) Expand 10 before | Expand all | Expand 10 after
5761 __ JumpIfSmi(input, false_label); 5761 __ JumpIfSmi(input, false_label);
5762 // Check for undetectable objects => true. 5762 // Check for undetectable objects => true.
5763 __ ld(input, FieldMemOperand(input, HeapObject::kMapOffset)); 5763 __ ld(input, FieldMemOperand(input, HeapObject::kMapOffset));
5764 __ lbu(at, FieldMemOperand(input, Map::kBitFieldOffset)); 5764 __ lbu(at, FieldMemOperand(input, Map::kBitFieldOffset));
5765 __ And(at, at, 1 << Map::kIsUndetectable); 5765 __ And(at, at, 1 << Map::kIsUndetectable);
5766 *cmp1 = at; 5766 *cmp1 = at;
5767 *cmp2 = Operand(zero_reg); 5767 *cmp2 = Operand(zero_reg);
5768 final_branch_condition = ne; 5768 final_branch_condition = ne;
5769 5769
5770 } else if (String::Equals(type_name, factory->function_string())) { 5770 } else if (String::Equals(type_name, factory->function_string())) {
5771 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2);
5772 __ JumpIfSmi(input, false_label); 5771 __ JumpIfSmi(input, false_label);
5773 __ GetObjectType(input, scratch, input); 5772 __ ld(scratch, FieldMemOperand(input, HeapObject::kMapOffset));
5774 __ Branch(true_label, eq, input, Operand(JS_FUNCTION_TYPE)); 5773 __ lbu(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset));
5775 *cmp1 = input; 5774 __ And(scratch, scratch,
5776 *cmp2 = Operand(JS_FUNCTION_PROXY_TYPE); 5775 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
5776 *cmp1 = scratch;
5777 *cmp2 = Operand(1 << Map::kIsCallable);
5777 final_branch_condition = eq; 5778 final_branch_condition = eq;
5778 5779
5779 } else if (String::Equals(type_name, factory->object_string())) { 5780 } else if (String::Equals(type_name, factory->object_string())) {
5780 __ JumpIfSmi(input, false_label); 5781 __ JumpIfSmi(input, false_label);
5781 __ LoadRoot(at, Heap::kNullValueRootIndex); 5782 __ LoadRoot(at, Heap::kNullValueRootIndex);
5782 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input)); 5783 __ Branch(USE_DELAY_SLOT, true_label, eq, at, Operand(input));
5783 Register map = input; 5784 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
5784 __ GetObjectType(input, map, scratch); 5785 __ GetObjectType(input, scratch, scratch1());
5785 __ Branch(false_label, 5786 __ Branch(false_label, lt, scratch1(), Operand(FIRST_SPEC_OBJECT_TYPE));
5786 lt, scratch, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); 5787 // Check for callable or undetectable objects => false.
5787 __ Branch(USE_DELAY_SLOT, false_label, 5788 __ lbu(scratch, FieldMemOperand(scratch, Map::kBitFieldOffset));
5788 gt, scratch, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); 5789 __ And(at, scratch,
5789 // map is still valid, so the BitField can be loaded in delay slot. 5790 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
5790 // Check for undetectable objects => false.
5791 __ lbu(at, FieldMemOperand(map, Map::kBitFieldOffset));
5792 __ And(at, at, 1 << Map::kIsUndetectable);
5793 *cmp1 = at; 5791 *cmp1 = at;
5794 *cmp2 = Operand(zero_reg); 5792 *cmp2 = Operand(zero_reg);
5795 final_branch_condition = eq; 5793 final_branch_condition = eq;
5796 5794
5797 // clang-format off 5795 // clang-format off
5798 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ 5796 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
5799 } else if (String::Equals(type_name, factory->type##_string())) { \ 5797 } else if (String::Equals(type_name, factory->type##_string())) { \
5800 __ JumpIfSmi(input, false_label); \ 5798 __ JumpIfSmi(input, false_label); \
5801 __ ld(input, FieldMemOperand(input, HeapObject::kMapOffset)); \ 5799 __ ld(input, FieldMemOperand(input, HeapObject::kMapOffset)); \
5802 __ LoadRoot(at, Heap::k##Type##MapRootIndex); \ 5800 __ LoadRoot(at, Heap::k##Type##MapRootIndex); \
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
6118 __ Push(at, ToRegister(instr->function())); 6116 __ Push(at, ToRegister(instr->function()));
6119 CallRuntime(Runtime::kPushBlockContext, 2, instr); 6117 CallRuntime(Runtime::kPushBlockContext, 2, instr);
6120 RecordSafepoint(Safepoint::kNoLazyDeopt); 6118 RecordSafepoint(Safepoint::kNoLazyDeopt);
6121 } 6119 }
6122 6120
6123 6121
6124 #undef __ 6122 #undef __
6125 6123
6126 } // namespace internal 6124 } // namespace internal
6127 } // namespace v8 6125 } // namespace v8
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/object-observe.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698