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

Side by Side Diff: src/full-codegen/mips64/full-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/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/x64/full-codegen-x64.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_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 4982 matching lines...) Expand 10 before | Expand all | Expand 10 after
4993 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); 4993 __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
4994 __ Branch(if_true, eq, v0, Operand(at)); 4994 __ Branch(if_true, eq, v0, Operand(at));
4995 __ JumpIfSmi(v0, if_false); 4995 __ JumpIfSmi(v0, if_false);
4996 // Check for undetectable objects => true. 4996 // Check for undetectable objects => true.
4997 __ ld(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); 4997 __ ld(v0, FieldMemOperand(v0, HeapObject::kMapOffset));
4998 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); 4998 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset));
4999 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); 4999 __ And(a1, a1, Operand(1 << Map::kIsUndetectable));
5000 Split(ne, a1, Operand(zero_reg), if_true, if_false, fall_through); 5000 Split(ne, a1, Operand(zero_reg), if_true, if_false, fall_through);
5001 } else if (String::Equals(check, factory->function_string())) { 5001 } else if (String::Equals(check, factory->function_string())) {
5002 __ JumpIfSmi(v0, if_false); 5002 __ JumpIfSmi(v0, if_false);
5003 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); 5003 __ ld(v0, FieldMemOperand(v0, HeapObject::kMapOffset));
5004 __ GetObjectType(v0, v0, a1); 5004 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset));
5005 __ Branch(if_true, eq, a1, Operand(JS_FUNCTION_TYPE)); 5005 __ And(a1, a1,
5006 Split(eq, a1, Operand(JS_FUNCTION_PROXY_TYPE), 5006 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
5007 if_true, if_false, fall_through); 5007 Split(eq, a1, Operand(1 << Map::kIsCallable), if_true, if_false,
5008 fall_through);
5008 } else if (String::Equals(check, factory->object_string())) { 5009 } else if (String::Equals(check, factory->object_string())) {
5009 __ JumpIfSmi(v0, if_false); 5010 __ JumpIfSmi(v0, if_false);
5010 __ LoadRoot(at, Heap::kNullValueRootIndex); 5011 __ LoadRoot(at, Heap::kNullValueRootIndex);
5011 __ Branch(if_true, eq, v0, Operand(at)); 5012 __ Branch(if_true, eq, v0, Operand(at));
5012 // Check for JS objects => true. 5013 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
5013 __ GetObjectType(v0, v0, a1); 5014 __ GetObjectType(v0, v0, a1);
5014 __ Branch(if_false, lt, a1, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); 5015 __ Branch(if_false, lt, a1, Operand(FIRST_SPEC_OBJECT_TYPE));
5015 __ lbu(a1, FieldMemOperand(v0, Map::kInstanceTypeOffset)); 5016 // Check for callable or undetectable objects => false.
5016 __ Branch(if_false, gt, a1, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE));
5017 // Check for undetectable objects => false.
5018 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); 5017 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset));
5019 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); 5018 __ And(a1, a1,
5019 Operand((1 << Map::kIsCallable) | (1 << Map::kIsUndetectable)));
5020 Split(eq, a1, Operand(zero_reg), if_true, if_false, fall_through); 5020 Split(eq, a1, Operand(zero_reg), if_true, if_false, fall_through);
5021 // clang-format off 5021 // clang-format off
5022 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \ 5022 #define SIMD128_TYPE(TYPE, Type, type, lane_count, lane_type) \
5023 } else if (String::Equals(check, factory->type##_string())) { \ 5023 } else if (String::Equals(check, factory->type##_string())) { \
5024 __ JumpIfSmi(v0, if_false); \ 5024 __ JumpIfSmi(v0, if_false); \
5025 __ ld(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); \ 5025 __ ld(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); \
5026 __ LoadRoot(at, Heap::k##Type##MapRootIndex); \ 5026 __ LoadRoot(at, Heap::k##Type##MapRootIndex); \
5027 Split(eq, v0, Operand(at), if_true, if_false, fall_through); 5027 Split(eq, v0, Operand(at), if_true, if_false, fall_through);
5028 SIMD128_TYPES(SIMD128_TYPE) 5028 SIMD128_TYPES(SIMD128_TYPE)
5029 #undef SIMD128_TYPE 5029 #undef SIMD128_TYPE
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
5328 reinterpret_cast<uint64_t>( 5328 reinterpret_cast<uint64_t>(
5329 isolate->builtins()->OsrAfterStackCheck()->entry())); 5329 isolate->builtins()->OsrAfterStackCheck()->entry()));
5330 return OSR_AFTER_STACK_CHECK; 5330 return OSR_AFTER_STACK_CHECK;
5331 } 5331 }
5332 5332
5333 5333
5334 } // namespace internal 5334 } // namespace internal
5335 } // namespace v8 5335 } // namespace v8
5336 5336
5337 #endif // V8_TARGET_ARCH_MIPS64 5337 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698