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/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/code-stubs.h" | 6 #include "src/code-stubs.h" |
7 #include "src/cpu-profiler.h" | 7 #include "src/cpu-profiler.h" |
8 #include "src/hydrogen-osr.h" | 8 #include "src/hydrogen-osr.h" |
9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
(...skipping 2470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2481 DO_SMI_CHECK); | 2481 DO_SMI_CHECK); |
2482 __ lwu(scratch, FieldMemOperand(value, HeapNumber::kExponentOffset)); | 2482 __ lwu(scratch, FieldMemOperand(value, HeapNumber::kExponentOffset)); |
2483 EmitFalseBranch(instr, ne, scratch, Operand(0x80000000)); | 2483 EmitFalseBranch(instr, ne, scratch, Operand(0x80000000)); |
2484 __ lwu(scratch, FieldMemOperand(value, HeapNumber::kMantissaOffset)); | 2484 __ lwu(scratch, FieldMemOperand(value, HeapNumber::kMantissaOffset)); |
2485 __ mov(at, zero_reg); | 2485 __ mov(at, zero_reg); |
2486 } | 2486 } |
2487 EmitBranch(instr, eq, scratch, Operand(at)); | 2487 EmitBranch(instr, eq, scratch, Operand(at)); |
2488 } | 2488 } |
2489 | 2489 |
2490 | 2490 |
2491 Condition LCodeGen::EmitIsObject(Register input, | |
2492 Register temp1, | |
2493 Register temp2, | |
2494 Label* is_not_object, | |
2495 Label* is_object) { | |
2496 __ JumpIfSmi(input, is_not_object); | |
2497 | |
2498 __ LoadRoot(temp2, Heap::kNullValueRootIndex); | |
2499 __ Branch(is_object, eq, input, Operand(temp2)); | |
2500 | |
2501 // Load map. | |
2502 __ ld(temp1, FieldMemOperand(input, HeapObject::kMapOffset)); | |
2503 // Undetectable objects behave like undefined. | |
2504 __ lbu(temp2, FieldMemOperand(temp1, Map::kBitFieldOffset)); | |
2505 __ And(temp2, temp2, Operand(1 << Map::kIsUndetectable)); | |
2506 __ Branch(is_not_object, ne, temp2, Operand(zero_reg)); | |
2507 | |
2508 // Load instance type and check that it is in object type range. | |
2509 __ lbu(temp2, FieldMemOperand(temp1, Map::kInstanceTypeOffset)); | |
2510 __ Branch(is_not_object, | |
2511 lt, temp2, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); | |
2512 | |
2513 return le; | |
2514 } | |
2515 | |
2516 | |
2517 void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) { | |
2518 Register reg = ToRegister(instr->value()); | |
2519 Register temp1 = ToRegister(instr->temp()); | |
2520 Register temp2 = scratch0(); | |
2521 | |
2522 Condition true_cond = | |
2523 EmitIsObject(reg, temp1, temp2, | |
2524 instr->FalseLabel(chunk_), instr->TrueLabel(chunk_)); | |
2525 | |
2526 EmitBranch(instr, true_cond, temp2, | |
2527 Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); | |
2528 } | |
2529 | |
2530 | |
2531 Condition LCodeGen::EmitIsString(Register input, | 2491 Condition LCodeGen::EmitIsString(Register input, |
2532 Register temp1, | 2492 Register temp1, |
2533 Label* is_not_string, | 2493 Label* is_not_string, |
2534 SmiCheck check_needed = INLINE_SMI_CHECK) { | 2494 SmiCheck check_needed = INLINE_SMI_CHECK) { |
2535 if (check_needed == INLINE_SMI_CHECK) { | 2495 if (check_needed == INLINE_SMI_CHECK) { |
2536 __ JumpIfSmi(input, is_not_string); | 2496 __ JumpIfSmi(input, is_not_string); |
2537 } | 2497 } |
2538 __ GetObjectType(input, temp1, temp1); | 2498 __ GetObjectType(input, temp1, temp1); |
2539 | 2499 |
2540 return lt; | 2500 return lt; |
(...skipping 3613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6154 __ Push(at, ToRegister(instr->function())); | 6114 __ Push(at, ToRegister(instr->function())); |
6155 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6115 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6156 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6116 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6157 } | 6117 } |
6158 | 6118 |
6159 | 6119 |
6160 #undef __ | 6120 #undef __ |
6161 | 6121 |
6162 } // namespace internal | 6122 } // namespace internal |
6163 } // namespace v8 | 6123 } // namespace v8 |
OLD | NEW |