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

Side by Side Diff: src/full-codegen/mips/full-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: Addressed comments. 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 | « no previous file | src/full-codegen/mips64/full-codegen-mips64.cc » ('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_MIPS 5 #if V8_TARGET_ARCH_MIPS
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 5002 matching lines...) Expand 10 before | Expand all | Expand 10 after
5013 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); 5013 __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
5014 __ Branch(if_true, eq, v0, Operand(at)); 5014 __ Branch(if_true, eq, v0, Operand(at));
5015 __ JumpIfSmi(v0, if_false); 5015 __ JumpIfSmi(v0, if_false);
5016 // Check for undetectable objects => true. 5016 // Check for undetectable objects => true.
5017 __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); 5017 __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset));
5018 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); 5018 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset));
5019 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); 5019 __ And(a1, a1, Operand(1 << Map::kIsUndetectable));
5020 Split(ne, a1, Operand(zero_reg), if_true, if_false, fall_through); 5020 Split(ne, a1, Operand(zero_reg), if_true, if_false, fall_through);
5021 } else if (String::Equals(check, factory->function_string())) { 5021 } else if (String::Equals(check, factory->function_string())) {
5022 __ JumpIfSmi(v0, if_false); 5022 __ JumpIfSmi(v0, if_false);
5023 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); 5023 __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset));
5024 __ GetObjectType(v0, v0, a1); 5024 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset));
5025 __ Branch(if_true, eq, a1, Operand(JS_FUNCTION_TYPE)); 5025 __ And(a1, a1,
5026 Split(eq, a1, Operand(JS_FUNCTION_PROXY_TYPE), 5026 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
5027 if_true, if_false, fall_through); 5027 Split(eq, a1, Operand(1 << Map::kIsCallable), if_true, if_false,
5028 fall_through);
5028 } else if (String::Equals(check, factory->object_string())) { 5029 } else if (String::Equals(check, factory->object_string())) {
5029 __ JumpIfSmi(v0, if_false); 5030 __ JumpIfSmi(v0, if_false);
5030 __ LoadRoot(at, Heap::kNullValueRootIndex); 5031 __ LoadRoot(at, Heap::kNullValueRootIndex);
5031 __ Branch(if_true, eq, v0, Operand(at)); 5032 __ Branch(if_true, eq, v0, Operand(at));
5032 // Check for JS objects => true. 5033 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
5033 __ GetObjectType(v0, v0, a1); 5034 __ GetObjectType(v0, v0, a1);
5034 __ Branch(if_false, lt, a1, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); 5035 __ Branch(if_false, lt, a1, Operand(FIRST_SPEC_OBJECT_TYPE));
5035 __ lbu(a1, FieldMemOperand(v0, Map::kInstanceTypeOffset)); 5036 // Check for callable or undetectable objects => false.
5036 __ Branch(if_false, gt, a1, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE));
5037 // Check for undetectable objects => false.
5038 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); 5037 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset));
5039 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); 5038 __ And(a1, a1,
5039 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
5040 Split(eq, a1, Operand(zero_reg), if_true, if_false, fall_through); 5040 Split(eq, a1, Operand(zero_reg), if_true, if_false, fall_through);
5041 // clang-format off 5041 // clang-format off
5042 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ 5042 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
5043 } else if (String::Equals(check, factory->type##_string())) { \ 5043 } else if (String::Equals(check, factory->type##_string())) { \
5044 __ JumpIfSmi(v0, if_false); \ 5044 __ JumpIfSmi(v0, if_false); \
5045 __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); \ 5045 __ lw(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); \
5046 __ LoadRoot(at, Heap::k##Type##MapRootIndex); \ 5046 __ LoadRoot(at, Heap::k##Type##MapRootIndex); \
5047 Split(eq, v0, Operand(at), if_true, if_false, fall_through); 5047 Split(eq, v0, Operand(at), if_true, if_false, fall_through);
5048 SIMD128_TYPES(SIMD128_TYPE) 5048 SIMD128_TYPES(SIMD128_TYPE)
5049 #undef SIMD128_TYPE 5049 #undef SIMD128_TYPE
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
5344 reinterpret_cast<uint32_t>( 5344 reinterpret_cast<uint32_t>(
5345 isolate->builtins()->OsrAfterStackCheck()->entry())); 5345 isolate->builtins()->OsrAfterStackCheck()->entry()));
5346 return OSR_AFTER_STACK_CHECK; 5346 return OSR_AFTER_STACK_CHECK;
5347 } 5347 }
5348 5348
5349 5349
5350 } // namespace internal 5350 } // namespace internal
5351 } // namespace v8 5351 } // namespace v8
5352 5352
5353 #endif // V8_TARGET_ARCH_MIPS 5353 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698