Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/ia32/macro-assembler-ia32.cc

Issue 196133017: Experimental parser: merge r19949 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2815 matching lines...) Expand 10 before | Expand all | Expand 10 after
2826 } 2826 }
2827 2827
2828 2828
2829 void MacroAssembler::Move(Register dst, Register src) { 2829 void MacroAssembler::Move(Register dst, Register src) {
2830 if (!dst.is(src)) { 2830 if (!dst.is(src)) {
2831 mov(dst, src); 2831 mov(dst, src);
2832 } 2832 }
2833 } 2833 }
2834 2834
2835 2835
2836 void MacroAssembler::Move(Register dst, Immediate imm) {
2837 if (imm.is_zero()) {
2838 xor_(dst, dst);
2839 } else {
2840 mov(dst, imm);
2841 }
2842 }
2843
2844
2836 void MacroAssembler::SetCounter(StatsCounter* counter, int value) { 2845 void MacroAssembler::SetCounter(StatsCounter* counter, int value) {
2837 if (FLAG_native_code_counters && counter->Enabled()) { 2846 if (FLAG_native_code_counters && counter->Enabled()) {
2838 mov(Operand::StaticVariable(ExternalReference(counter)), Immediate(value)); 2847 mov(Operand::StaticVariable(ExternalReference(counter)), Immediate(value));
2839 } 2848 }
2840 } 2849 }
2841 2850
2842 2851
2843 void MacroAssembler::IncrementCounter(StatsCounter* counter, int value) { 2852 void MacroAssembler::IncrementCounter(StatsCounter* counter, int value) {
2844 ASSERT(value > 0); 2853 ASSERT(value > 0);
2845 if (FLAG_native_code_counters && counter->Enabled()) { 2854 if (FLAG_native_code_counters && counter->Enabled()) {
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
3596 mov(scratch1, FieldOperand(current, Map::kBitField2Offset)); 3605 mov(scratch1, FieldOperand(current, Map::kBitField2Offset));
3597 and_(scratch1, Map::kElementsKindMask); 3606 and_(scratch1, Map::kElementsKindMask);
3598 shr(scratch1, Map::kElementsKindShift); 3607 shr(scratch1, Map::kElementsKindShift);
3599 cmp(scratch1, Immediate(DICTIONARY_ELEMENTS)); 3608 cmp(scratch1, Immediate(DICTIONARY_ELEMENTS));
3600 j(equal, found); 3609 j(equal, found);
3601 mov(current, FieldOperand(current, Map::kPrototypeOffset)); 3610 mov(current, FieldOperand(current, Map::kPrototypeOffset));
3602 cmp(current, Immediate(factory->null_value())); 3611 cmp(current, Immediate(factory->null_value()));
3603 j(not_equal, &loop_again); 3612 j(not_equal, &loop_again);
3604 } 3613 }
3605 3614
3615
3616 void MacroAssembler::FlooringDiv(Register dividend, int32_t divisor) {
3617 ASSERT(!dividend.is(eax));
3618 ASSERT(!dividend.is(edx));
3619 MultiplierAndShift ms(divisor);
3620 mov(eax, Immediate(ms.multiplier()));
3621 imul(dividend);
3622 if (divisor > 0 && ms.multiplier() < 0) add(edx, dividend);
3623 if (divisor < 0 && ms.multiplier() > 0) sub(edx, dividend);
3624 if (ms.shift() > 0) sar(edx, ms.shift());
3625 }
3626
3627
3606 } } // namespace v8::internal 3628 } } // namespace v8::internal
3607 3629
3608 #endif // V8_TARGET_ARCH_IA32 3630 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.h ('k') | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698