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/arm/lithium-codegen-arm.h" | 5 #include "src/arm/lithium-codegen-arm.h" |
6 #include "src/arm/lithium-gap-resolver-arm.h" | 6 #include "src/arm/lithium-gap-resolver-arm.h" |
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/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 2442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2453 DO_SMI_CHECK); | 2453 DO_SMI_CHECK); |
2454 __ ldr(scratch, FieldMemOperand(value, HeapNumber::kExponentOffset)); | 2454 __ ldr(scratch, FieldMemOperand(value, HeapNumber::kExponentOffset)); |
2455 __ ldr(ip, FieldMemOperand(value, HeapNumber::kMantissaOffset)); | 2455 __ ldr(ip, FieldMemOperand(value, HeapNumber::kMantissaOffset)); |
2456 __ cmp(scratch, Operand(0x80000000)); | 2456 __ cmp(scratch, Operand(0x80000000)); |
2457 __ cmp(ip, Operand(0x00000000), eq); | 2457 __ cmp(ip, Operand(0x00000000), eq); |
2458 } | 2458 } |
2459 EmitBranch(instr, eq); | 2459 EmitBranch(instr, eq); |
2460 } | 2460 } |
2461 | 2461 |
2462 | 2462 |
2463 Condition LCodeGen::EmitIsObject(Register input, | |
2464 Register temp1, | |
2465 Label* is_not_object, | |
2466 Label* is_object) { | |
2467 Register temp2 = scratch0(); | |
2468 __ JumpIfSmi(input, is_not_object); | |
2469 | |
2470 __ LoadRoot(temp2, Heap::kNullValueRootIndex); | |
2471 __ cmp(input, temp2); | |
2472 __ b(eq, is_object); | |
2473 | |
2474 // Load map. | |
2475 __ ldr(temp1, FieldMemOperand(input, HeapObject::kMapOffset)); | |
2476 // Undetectable objects behave like undefined. | |
2477 __ ldrb(temp2, FieldMemOperand(temp1, Map::kBitFieldOffset)); | |
2478 __ tst(temp2, Operand(1 << Map::kIsUndetectable)); | |
2479 __ b(ne, is_not_object); | |
2480 | |
2481 // Load instance type and check that it is in object type range. | |
2482 __ ldrb(temp2, FieldMemOperand(temp1, Map::kInstanceTypeOffset)); | |
2483 __ cmp(temp2, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); | |
2484 __ b(lt, is_not_object); | |
2485 __ cmp(temp2, Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); | |
2486 return le; | |
2487 } | |
2488 | |
2489 | |
2490 void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) { | |
2491 Register reg = ToRegister(instr->value()); | |
2492 Register temp1 = ToRegister(instr->temp()); | |
2493 | |
2494 Condition true_cond = | |
2495 EmitIsObject(reg, temp1, | |
2496 instr->FalseLabel(chunk_), instr->TrueLabel(chunk_)); | |
2497 | |
2498 EmitBranch(instr, true_cond); | |
2499 } | |
2500 | |
2501 | |
2502 Condition LCodeGen::EmitIsString(Register input, | 2463 Condition LCodeGen::EmitIsString(Register input, |
2503 Register temp1, | 2464 Register temp1, |
2504 Label* is_not_string, | 2465 Label* is_not_string, |
2505 SmiCheck check_needed = INLINE_SMI_CHECK) { | 2466 SmiCheck check_needed = INLINE_SMI_CHECK) { |
2506 if (check_needed == INLINE_SMI_CHECK) { | 2467 if (check_needed == INLINE_SMI_CHECK) { |
2507 __ JumpIfSmi(input, is_not_string); | 2468 __ JumpIfSmi(input, is_not_string); |
2508 } | 2469 } |
2509 __ CompareObjectType(input, temp1, temp1, FIRST_NONSTRING_TYPE); | 2470 __ CompareObjectType(input, temp1, temp1, FIRST_NONSTRING_TYPE); |
2510 | 2471 |
2511 return lt; | 2472 return lt; |
(...skipping 3400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5912 __ push(ToRegister(instr->function())); | 5873 __ push(ToRegister(instr->function())); |
5913 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5874 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5914 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5875 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5915 } | 5876 } |
5916 | 5877 |
5917 | 5878 |
5918 #undef __ | 5879 #undef __ |
5919 | 5880 |
5920 } // namespace internal | 5881 } // namespace internal |
5921 } // namespace v8 | 5882 } // namespace v8 |
OLD | NEW |