| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2377 DO_SMI_CHECK); | 2377 DO_SMI_CHECK); |
| 2378 __ lw(scratch, FieldMemOperand(value, HeapNumber::kExponentOffset)); | 2378 __ lw(scratch, FieldMemOperand(value, HeapNumber::kExponentOffset)); |
| 2379 EmitFalseBranch(instr, ne, scratch, Operand(0x80000000)); | 2379 EmitFalseBranch(instr, ne, scratch, Operand(0x80000000)); |
| 2380 __ lw(scratch, FieldMemOperand(value, HeapNumber::kMantissaOffset)); | 2380 __ lw(scratch, FieldMemOperand(value, HeapNumber::kMantissaOffset)); |
| 2381 __ mov(at, zero_reg); | 2381 __ mov(at, zero_reg); |
| 2382 } | 2382 } |
| 2383 EmitBranch(instr, eq, scratch, Operand(at)); | 2383 EmitBranch(instr, eq, scratch, Operand(at)); |
| 2384 } | 2384 } |
| 2385 | 2385 |
| 2386 | 2386 |
| 2387 Condition LCodeGen::EmitIsObject(Register input, | |
| 2388 Register temp1, | |
| 2389 Register temp2, | |
| 2390 Label* is_not_object, | |
| 2391 Label* is_object) { | |
| 2392 __ JumpIfSmi(input, is_not_object); | |
| 2393 | |
| 2394 __ LoadRoot(temp2, Heap::kNullValueRootIndex); | |
| 2395 __ Branch(is_object, eq, input, Operand(temp2)); | |
| 2396 | |
| 2397 // Load map. | |
| 2398 __ lw(temp1, FieldMemOperand(input, HeapObject::kMapOffset)); | |
| 2399 // Undetectable objects behave like undefined. | |
| 2400 __ lbu(temp2, FieldMemOperand(temp1, Map::kBitFieldOffset)); | |
| 2401 __ And(temp2, temp2, Operand(1 << Map::kIsUndetectable)); | |
| 2402 __ Branch(is_not_object, ne, temp2, Operand(zero_reg)); | |
| 2403 | |
| 2404 // Load instance type and check that it is in object type range. | |
| 2405 __ lbu(temp2, FieldMemOperand(temp1, Map::kInstanceTypeOffset)); | |
| 2406 __ Branch(is_not_object, | |
| 2407 lt, temp2, Operand(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); | |
| 2408 | |
| 2409 return le; | |
| 2410 } | |
| 2411 | |
| 2412 | |
| 2413 void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) { | |
| 2414 Register reg = ToRegister(instr->value()); | |
| 2415 Register temp1 = ToRegister(instr->temp()); | |
| 2416 Register temp2 = scratch0(); | |
| 2417 | |
| 2418 Condition true_cond = | |
| 2419 EmitIsObject(reg, temp1, temp2, | |
| 2420 instr->FalseLabel(chunk_), instr->TrueLabel(chunk_)); | |
| 2421 | |
| 2422 EmitBranch(instr, true_cond, temp2, | |
| 2423 Operand(LAST_NONCALLABLE_SPEC_OBJECT_TYPE)); | |
| 2424 } | |
| 2425 | |
| 2426 | |
| 2427 Condition LCodeGen::EmitIsString(Register input, | 2387 Condition LCodeGen::EmitIsString(Register input, |
| 2428 Register temp1, | 2388 Register temp1, |
| 2429 Label* is_not_string, | 2389 Label* is_not_string, |
| 2430 SmiCheck check_needed = INLINE_SMI_CHECK) { | 2390 SmiCheck check_needed = INLINE_SMI_CHECK) { |
| 2431 if (check_needed == INLINE_SMI_CHECK) { | 2391 if (check_needed == INLINE_SMI_CHECK) { |
| 2432 __ JumpIfSmi(input, is_not_string); | 2392 __ JumpIfSmi(input, is_not_string); |
| 2433 } | 2393 } |
| 2434 __ GetObjectType(input, temp1, temp1); | 2394 __ GetObjectType(input, temp1, temp1); |
| 2435 | 2395 |
| 2436 return lt; | 2396 return lt; |
| (...skipping 3530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5967 __ Push(at, ToRegister(instr->function())); | 5927 __ Push(at, ToRegister(instr->function())); |
| 5968 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5928 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5969 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5929 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5970 } | 5930 } |
| 5971 | 5931 |
| 5972 | 5932 |
| 5973 #undef __ | 5933 #undef __ |
| 5974 | 5934 |
| 5975 } // namespace internal | 5935 } // namespace internal |
| 5976 } // namespace v8 | 5936 } // namespace v8 |
| OLD | NEW |