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 "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
10 #include "codegen.h" | 10 #include "codegen.h" |
(...skipping 3399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3410 Register current = scratch0; | 3410 Register current = scratch0; |
3411 Label loop_again; | 3411 Label loop_again; |
3412 | 3412 |
3413 // scratch contained elements pointer. | 3413 // scratch contained elements pointer. |
3414 mov(current, object); | 3414 mov(current, object); |
3415 | 3415 |
3416 // Loop based on the map going up the prototype chain. | 3416 // Loop based on the map going up the prototype chain. |
3417 bind(&loop_again); | 3417 bind(&loop_again); |
3418 mov(current, FieldOperand(current, HeapObject::kMapOffset)); | 3418 mov(current, FieldOperand(current, HeapObject::kMapOffset)); |
3419 mov(scratch1, FieldOperand(current, Map::kBitField2Offset)); | 3419 mov(scratch1, FieldOperand(current, Map::kBitField2Offset)); |
3420 and_(scratch1, Map::kElementsKindMask); | 3420 DecodeField<Map::ElementsKindBits>(scratch1); |
3421 shr(scratch1, Map::kElementsKindShift); | |
3422 cmp(scratch1, Immediate(DICTIONARY_ELEMENTS)); | 3421 cmp(scratch1, Immediate(DICTIONARY_ELEMENTS)); |
3423 j(equal, found); | 3422 j(equal, found); |
3424 mov(current, FieldOperand(current, Map::kPrototypeOffset)); | 3423 mov(current, FieldOperand(current, Map::kPrototypeOffset)); |
3425 cmp(current, Immediate(factory->null_value())); | 3424 cmp(current, Immediate(factory->null_value())); |
3426 j(not_equal, &loop_again); | 3425 j(not_equal, &loop_again); |
3427 } | 3426 } |
3428 | 3427 |
3429 | 3428 |
3430 void MacroAssembler::TruncatingDiv(Register dividend, int32_t divisor) { | 3429 void MacroAssembler::TruncatingDiv(Register dividend, int32_t divisor) { |
3431 ASSERT(!dividend.is(eax)); | 3430 ASSERT(!dividend.is(eax)); |
3432 ASSERT(!dividend.is(edx)); | 3431 ASSERT(!dividend.is(edx)); |
3433 MultiplierAndShift ms(divisor); | 3432 MultiplierAndShift ms(divisor); |
3434 mov(eax, Immediate(ms.multiplier())); | 3433 mov(eax, Immediate(ms.multiplier())); |
3435 imul(dividend); | 3434 imul(dividend); |
3436 if (divisor > 0 && ms.multiplier() < 0) add(edx, dividend); | 3435 if (divisor > 0 && ms.multiplier() < 0) add(edx, dividend); |
3437 if (divisor < 0 && ms.multiplier() > 0) sub(edx, dividend); | 3436 if (divisor < 0 && ms.multiplier() > 0) sub(edx, dividend); |
3438 if (ms.shift() > 0) sar(edx, ms.shift()); | 3437 if (ms.shift() > 0) sar(edx, ms.shift()); |
3439 mov(eax, dividend); | 3438 mov(eax, dividend); |
3440 shr(eax, 31); | 3439 shr(eax, 31); |
3441 add(edx, eax); | 3440 add(edx, eax); |
3442 } | 3441 } |
3443 | 3442 |
3444 | 3443 |
3445 } } // namespace v8::internal | 3444 } } // namespace v8::internal |
3446 | 3445 |
3447 #endif // V8_TARGET_ARCH_IA32 | 3446 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |