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 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 2346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2357 __ cmp(FieldOperand(value, HeapNumber::kExponentOffset), | 2357 __ cmp(FieldOperand(value, HeapNumber::kExponentOffset), |
2358 Immediate(0x1)); | 2358 Immediate(0x1)); |
2359 EmitFalseBranch(instr, no_overflow); | 2359 EmitFalseBranch(instr, no_overflow); |
2360 __ cmp(FieldOperand(value, HeapNumber::kMantissaOffset), | 2360 __ cmp(FieldOperand(value, HeapNumber::kMantissaOffset), |
2361 Immediate(0x00000000)); | 2361 Immediate(0x00000000)); |
2362 EmitBranch(instr, equal); | 2362 EmitBranch(instr, equal); |
2363 } | 2363 } |
2364 } | 2364 } |
2365 | 2365 |
2366 | 2366 |
2367 Condition LCodeGen::EmitIsObject(Register input, | |
2368 Register temp1, | |
2369 Label* is_not_object, | |
2370 Label* is_object) { | |
2371 __ JumpIfSmi(input, is_not_object); | |
2372 | |
2373 __ cmp(input, isolate()->factory()->null_value()); | |
2374 __ j(equal, is_object); | |
2375 | |
2376 __ mov(temp1, FieldOperand(input, HeapObject::kMapOffset)); | |
2377 // Undetectable objects behave like undefined. | |
2378 __ test_b(FieldOperand(temp1, Map::kBitFieldOffset), | |
2379 1 << Map::kIsUndetectable); | |
2380 __ j(not_zero, is_not_object); | |
2381 | |
2382 __ movzx_b(temp1, FieldOperand(temp1, Map::kInstanceTypeOffset)); | |
2383 __ cmp(temp1, FIRST_NONCALLABLE_SPEC_OBJECT_TYPE); | |
2384 __ j(below, is_not_object); | |
2385 __ cmp(temp1, LAST_NONCALLABLE_SPEC_OBJECT_TYPE); | |
2386 return below_equal; | |
2387 } | |
2388 | |
2389 | |
2390 void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) { | |
2391 Register reg = ToRegister(instr->value()); | |
2392 Register temp = ToRegister(instr->temp()); | |
2393 | |
2394 Condition true_cond = EmitIsObject( | |
2395 reg, temp, instr->FalseLabel(chunk_), instr->TrueLabel(chunk_)); | |
2396 | |
2397 EmitBranch(instr, true_cond); | |
2398 } | |
2399 | |
2400 | |
2401 Condition LCodeGen::EmitIsString(Register input, | 2367 Condition LCodeGen::EmitIsString(Register input, |
2402 Register temp1, | 2368 Register temp1, |
2403 Label* is_not_string, | 2369 Label* is_not_string, |
2404 SmiCheck check_needed = INLINE_SMI_CHECK) { | 2370 SmiCheck check_needed = INLINE_SMI_CHECK) { |
2405 if (check_needed == INLINE_SMI_CHECK) { | 2371 if (check_needed == INLINE_SMI_CHECK) { |
2406 __ JumpIfSmi(input, is_not_string); | 2372 __ JumpIfSmi(input, is_not_string); |
2407 } | 2373 } |
2408 | 2374 |
2409 Condition cond = masm_->IsObjectStringType(input, temp1, temp1); | 2375 Condition cond = masm_->IsObjectStringType(input, temp1, temp1); |
2410 | 2376 |
(...skipping 3373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5784 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5750 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5785 } | 5751 } |
5786 | 5752 |
5787 | 5753 |
5788 #undef __ | 5754 #undef __ |
5789 | 5755 |
5790 } // namespace internal | 5756 } // namespace internal |
5791 } // namespace v8 | 5757 } // namespace v8 |
5792 | 5758 |
5793 #endif // V8_TARGET_ARCH_IA32 | 5759 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |