OLD | NEW |
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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 // Note on Mips implementation: | 9 // Note on Mips implementation: |
10 // | 10 // |
(...skipping 4470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4481 if_true, if_false, fall_through); | 4481 if_true, if_false, fall_through); |
4482 } else if (String::Equals(check, factory->symbol_string())) { | 4482 } else if (String::Equals(check, factory->symbol_string())) { |
4483 __ JumpIfSmi(v0, if_false); | 4483 __ JumpIfSmi(v0, if_false); |
4484 __ GetObjectType(v0, v0, a1); | 4484 __ GetObjectType(v0, v0, a1); |
4485 Split(eq, a1, Operand(SYMBOL_TYPE), if_true, if_false, fall_through); | 4485 Split(eq, a1, Operand(SYMBOL_TYPE), if_true, if_false, fall_through); |
4486 } else if (String::Equals(check, factory->boolean_string())) { | 4486 } else if (String::Equals(check, factory->boolean_string())) { |
4487 __ LoadRoot(at, Heap::kTrueValueRootIndex); | 4487 __ LoadRoot(at, Heap::kTrueValueRootIndex); |
4488 __ Branch(if_true, eq, v0, Operand(at)); | 4488 __ Branch(if_true, eq, v0, Operand(at)); |
4489 __ LoadRoot(at, Heap::kFalseValueRootIndex); | 4489 __ LoadRoot(at, Heap::kFalseValueRootIndex); |
4490 Split(eq, v0, Operand(at), if_true, if_false, fall_through); | 4490 Split(eq, v0, Operand(at), if_true, if_false, fall_through); |
4491 } else if (FLAG_harmony_typeof && | |
4492 String::Equals(check, factory->null_string())) { | |
4493 __ LoadRoot(at, Heap::kNullValueRootIndex); | |
4494 Split(eq, v0, Operand(at), if_true, if_false, fall_through); | |
4495 } else if (String::Equals(check, factory->undefined_string())) { | 4491 } else if (String::Equals(check, factory->undefined_string())) { |
4496 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); | 4492 __ LoadRoot(at, Heap::kUndefinedValueRootIndex); |
4497 __ Branch(if_true, eq, v0, Operand(at)); | 4493 __ Branch(if_true, eq, v0, Operand(at)); |
4498 __ JumpIfSmi(v0, if_false); | 4494 __ JumpIfSmi(v0, if_false); |
4499 // Check for undetectable objects => true. | 4495 // Check for undetectable objects => true. |
4500 __ ld(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); | 4496 __ ld(v0, FieldMemOperand(v0, HeapObject::kMapOffset)); |
4501 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); | 4497 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); |
4502 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); | 4498 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); |
4503 Split(ne, a1, Operand(zero_reg), if_true, if_false, fall_through); | 4499 Split(ne, a1, Operand(zero_reg), if_true, if_false, fall_through); |
4504 } else if (String::Equals(check, factory->function_string())) { | 4500 } else if (String::Equals(check, factory->function_string())) { |
4505 __ JumpIfSmi(v0, if_false); | 4501 __ JumpIfSmi(v0, if_false); |
4506 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | 4502 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); |
4507 __ GetObjectType(v0, v0, a1); | 4503 __ GetObjectType(v0, v0, a1); |
4508 __ Branch(if_true, eq, a1, Operand(JS_FUNCTION_TYPE)); | 4504 __ Branch(if_true, eq, a1, Operand(JS_FUNCTION_TYPE)); |
4509 Split(eq, a1, Operand(JS_FUNCTION_PROXY_TYPE), | 4505 Split(eq, a1, Operand(JS_FUNCTION_PROXY_TYPE), |
4510 if_true, if_false, fall_through); | 4506 if_true, if_false, fall_through); |
4511 } else if (String::Equals(check, factory->object_string())) { | 4507 } else if (String::Equals(check, factory->object_string())) { |
4512 __ JumpIfSmi(v0, if_false); | 4508 __ JumpIfSmi(v0, if_false); |
4513 if (!FLAG_harmony_typeof) { | 4509 __ LoadRoot(at, Heap::kNullValueRootIndex); |
4514 __ LoadRoot(at, Heap::kNullValueRootIndex); | 4510 __ Branch(if_true, eq, v0, Operand(at)); |
4515 __ Branch(if_true, eq, v0, Operand(at)); | |
4516 } | |
4517 // Check for JS objects => true. | 4511 // Check for JS objects => true. |
4518 __ GetObjectType(v0, v0, a1); | 4512 __ GetObjectType(v0, v0, a1); |
4519 __ Branch(if_false, lt, a1, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 4513 __ Branch(if_false, lt, a1, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
4520 __ lbu(a1, FieldMemOperand(v0, Map::kInstanceTypeOffset)); | 4514 __ lbu(a1, FieldMemOperand(v0, Map::kInstanceTypeOffset)); |
4521 __ Branch(if_false, gt, a1, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 4515 __ Branch(if_false, gt, a1, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
4522 // Check for undetectable objects => false. | 4516 // Check for undetectable objects => false. |
4523 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); | 4517 __ lbu(a1, FieldMemOperand(v0, Map::kBitFieldOffset)); |
4524 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); | 4518 __ And(a1, a1, Operand(1 << Map::kIsUndetectable)); |
4525 Split(eq, a1, Operand(zero_reg), if_true, if_false, fall_through); | 4519 Split(eq, a1, Operand(zero_reg), if_true, if_false, fall_through); |
4526 } else { | 4520 } else { |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4855 Assembler::target_address_at(pc_immediate_load_address)) == | 4849 Assembler::target_address_at(pc_immediate_load_address)) == |
4856 reinterpret_cast<uint64_t>( | 4850 reinterpret_cast<uint64_t>( |
4857 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4851 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4858 return OSR_AFTER_STACK_CHECK; | 4852 return OSR_AFTER_STACK_CHECK; |
4859 } | 4853 } |
4860 | 4854 |
4861 | 4855 |
4862 } } // namespace v8::internal | 4856 } } // namespace v8::internal |
4863 | 4857 |
4864 #endif // V8_TARGET_ARCH_MIPS64 | 4858 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |