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

Side by Side Diff: src/full-codegen/mips64/full-codegen-mips64.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. 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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 5004 matching lines...) Expand 10 before | Expand all | Expand 10 after
5015 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); 5015 __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
5016 __ Branch(if_true, eq, v0, Operand(at)); 5016 __ Branch(if_true, eq, v0, Operand(at));
5017 __ JumpIfSmi(v0, if_false); 5017 __ JumpIfSmi(v0, if_false);
5018 // Check for undetectable objects => true. 5018 // Check for undetectable objects => true.
5019 __ ld(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); 5019 __ ld(v0, FieldMemOperand(v0, HeapObject::kMapOffset));
5020 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); 5020 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset));
5021 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); 5021 __ And(a1, a1, Operand(1 << Map::kIsUndetectable));
5022 Split(ne, a1, Operand(zero_reg), if_true, if_false, fall_through); 5022 Split(ne, a1, Operand(zero_reg), if_true, if_false, fall_through);
5023 } else if (String::Equals(check, factory->function_string())) { 5023 } else if (String::Equals(check, factory->function_string())) {
5024 __ JumpIfSmi(v0, if_false); 5024 __ JumpIfSmi(v0, if_false);
5025 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); 5025 __ ld(v0, FieldMemOperand(v0, HeapObject::kMapOffset));
5026 __ GetObjectType(v0, v0, a1); 5026 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset));
5027 __ Branch(if_true, eq, a1, Operand(JS_FUNCTION_TYPE)); 5027 __ And(a1, a1,
5028 Split(eq, a1, Operand(JS_FUNCTION_PROXY_TYPE), 5028 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
5029 if_true, if_false, fall_through); 5029 Split(eq, a1, Operand(1 << Map::kIsCallable), if_true, if_false,
5030 fall_through);
5030 } else if (String::Equals(check, factory->object_string())) { 5031 } else if (String::Equals(check, factory->object_string())) {
5031 __ JumpIfSmi(v0, if_false); 5032 __ JumpIfSmi(v0, if_false);
5032 __ LoadRoot(at, Heap::kNullValueRootIndex); 5033 __ LoadRoot(at, Heap::kNullValueRootIndex);
5033 __ Branch(if_true, eq, v0, Operand(at)); 5034 __ Branch(if_true, eq, v0, Operand(at));
5034 // Check for JS objects => true. 5035 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
5035 __ GetObjectType(v0, v0, a1); 5036 __ GetObjectType(v0, v0, a1);
5036 __ Branch(if_false, lt, a1, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); 5037 __ Branch(if_false, lt, a1, Operand(FIRST_SPEC_OBJECT_TYPE));
5037 __ lbu(a1, FieldMemOperand(v0, Map::kInstanceTypeOffset)); 5038 // Check for callable or undetectable objects => false.
5038 __ Branch(if_false, gt, a1, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE));
5039 // Check for undetectable objects => false.
5040 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); 5039 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset));
5041 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); 5040 __ And(a1, a1,
5041 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
5042 Split(eq, a1, Operand(zero_reg), if_true, if_false, fall_through); 5042 Split(eq, a1, Operand(zero_reg), if_true, if_false, fall_through);
5043 // clang-format off 5043 // clang-format off
5044 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ 5044 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
5045 } else if (String::Equals(check, factory->type##_string())) { \ 5045 } else if (String::Equals(check, factory->type##_string())) { \
5046 __ JumpIfSmi(v0, if_false); \ 5046 __ JumpIfSmi(v0, if_false); \
5047 __ ld(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); \ 5047 __ ld(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); \
5048 __ LoadRoot(at, Heap::k##Type##MapRootIndex); \ 5048 __ LoadRoot(at, Heap::k##Type##MapRootIndex); \
5049 Split(eq, v0, Operand(at), if_true, if_false, fall_through); 5049 Split(eq, v0, Operand(at), if_true, if_false, fall_through);
5050 SIMD128_TYPES(SIMD128_TYPE) 5050 SIMD128_TYPES(SIMD128_TYPE)
5051 #undef SIMD128_TYPE 5051 #undef SIMD128_TYPE
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
5350 reinterpret_cast<uint64_t>( 5350 reinterpret_cast<uint64_t>(
5351 isolate->builtins()->OsrAfterStackCheck()->entry())); 5351 isolate->builtins()->OsrAfterStackCheck()->entry()));
5352 return OSR_AFTER_STACK_CHECK; 5352 return OSR_AFTER_STACK_CHECK;
5353 } 5353 }
5354 5354
5355 5355
5356 } // namespace internal 5356 } // namespace internal
5357 } // namespace v8 5357 } // namespace v8
5358 5358
5359 #endif // V8_TARGET_ARCH_MIPS64 5359 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698