| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 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 2299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2310 void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) { | 2310 void LCodeGen::DoCmpConstantEqAndBranch(LCmpConstantEqAndBranch* instr) { |
| 2311 Register left = ToRegister(instr->left()); | 2311 Register left = ToRegister(instr->left()); |
| 2312 int true_block = chunk_->LookupDestination(instr->true_block_id()); | 2312 int true_block = chunk_->LookupDestination(instr->true_block_id()); |
| 2313 int false_block = chunk_->LookupDestination(instr->false_block_id()); | 2313 int false_block = chunk_->LookupDestination(instr->false_block_id()); |
| 2314 | 2314 |
| 2315 __ cmp(left, instr->hydrogen()->right()); | 2315 __ cmp(left, instr->hydrogen()->right()); |
| 2316 EmitBranch(true_block, false_block, equal); | 2316 EmitBranch(true_block, false_block, equal); |
| 2317 } | 2317 } |
| 2318 | 2318 |
| 2319 | 2319 |
| 2320 void LCodeGen::DoIsNilAndBranch(LIsNilAndBranch* instr) { | |
| 2321 Register reg = ToRegister(instr->value()); | |
| 2322 int false_block = chunk_->LookupDestination(instr->false_block_id()); | |
| 2323 | |
| 2324 // If the expression is known to be untagged or a smi, then it's definitely | |
| 2325 // not null, and it can't be a an undetectable object. | |
| 2326 if (instr->hydrogen()->representation().IsSpecialization() || | |
| 2327 instr->hydrogen()->type().IsSmi()) { | |
| 2328 EmitGoto(false_block); | |
| 2329 return; | |
| 2330 } | |
| 2331 | |
| 2332 int true_block = chunk_->LookupDestination(instr->true_block_id()); | |
| 2333 Handle<Object> nil_value = instr->nil() == kNullValue ? | |
| 2334 factory()->null_value() : | |
| 2335 factory()->undefined_value(); | |
| 2336 __ cmp(reg, nil_value); | |
| 2337 if (instr->kind() == kStrictEquality) { | |
| 2338 EmitBranch(true_block, false_block, equal); | |
| 2339 } else { | |
| 2340 Handle<Object> other_nil_value = instr->nil() == kNullValue ? | |
| 2341 factory()->undefined_value() : | |
| 2342 factory()->null_value(); | |
| 2343 Label* true_label = chunk_->GetAssemblyLabel(true_block); | |
| 2344 Label* false_label = chunk_->GetAssemblyLabel(false_block); | |
| 2345 __ j(equal, true_label); | |
| 2346 __ cmp(reg, other_nil_value); | |
| 2347 __ j(equal, true_label); | |
| 2348 __ JumpIfSmi(reg, false_label); | |
| 2349 // Check for undetectable objects by looking in the bit field in | |
| 2350 // the map. The object has already been smi checked. | |
| 2351 Register scratch = ToRegister(instr->temp()); | |
| 2352 __ mov(scratch, FieldOperand(reg, HeapObject::kMapOffset)); | |
| 2353 __ movzx_b(scratch, FieldOperand(scratch, Map::kBitFieldOffset)); | |
| 2354 __ test(scratch, Immediate(1 << Map::kIsUndetectable)); | |
| 2355 EmitBranch(true_block, false_block, not_zero); | |
| 2356 } | |
| 2357 } | |
| 2358 | |
| 2359 | |
| 2360 Condition LCodeGen::EmitIsObject(Register input, | 2320 Condition LCodeGen::EmitIsObject(Register input, |
| 2361 Register temp1, | 2321 Register temp1, |
| 2362 Label* is_not_object, | 2322 Label* is_not_object, |
| 2363 Label* is_object) { | 2323 Label* is_object) { |
| 2364 __ JumpIfSmi(input, is_not_object); | 2324 __ JumpIfSmi(input, is_not_object); |
| 2365 | 2325 |
| 2366 __ cmp(input, isolate()->factory()->null_value()); | 2326 __ cmp(input, isolate()->factory()->null_value()); |
| 2367 __ j(equal, is_object); | 2327 __ j(equal, is_object); |
| 2368 | 2328 |
| 2369 __ mov(temp1, FieldOperand(input, HeapObject::kMapOffset)); | 2329 __ mov(temp1, FieldOperand(input, HeapObject::kMapOffset)); |
| (...skipping 4169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6539 FixedArray::kHeaderSize - kPointerSize)); | 6499 FixedArray::kHeaderSize - kPointerSize)); |
| 6540 __ bind(&done); | 6500 __ bind(&done); |
| 6541 } | 6501 } |
| 6542 | 6502 |
| 6543 | 6503 |
| 6544 #undef __ | 6504 #undef __ |
| 6545 | 6505 |
| 6546 } } // namespace v8::internal | 6506 } } // namespace v8::internal |
| 6547 | 6507 |
| 6548 #endif // V8_TARGET_ARCH_IA32 | 6508 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |