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

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

Issue 10442015: Rollback of r11638, r11636 on trunk branch. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 8 years, 7 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/arm/macro-assembler-arm.h ('k') | src/arm/stub-cache-arm.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 1850 matching lines...) Expand 10 before | Expand all | Expand 10 after
1861 Heap::RootListIndex index) { 1861 Heap::RootListIndex index) {
1862 ASSERT(!obj.is(ip)); 1862 ASSERT(!obj.is(ip));
1863 LoadRoot(ip, index); 1863 LoadRoot(ip, index);
1864 cmp(obj, ip); 1864 cmp(obj, ip);
1865 } 1865 }
1866 1866
1867 1867
1868 void MacroAssembler::CheckFastElements(Register map, 1868 void MacroAssembler::CheckFastElements(Register map,
1869 Register scratch, 1869 Register scratch,
1870 Label* fail) { 1870 Label* fail) {
1871 STATIC_ASSERT(FAST_SMI_ELEMENTS == 0); 1871 STATIC_ASSERT(FAST_SMI_ONLY_ELEMENTS == 0);
1872 STATIC_ASSERT(FAST_HOLEY_SMI_ELEMENTS == 1); 1872 STATIC_ASSERT(FAST_ELEMENTS == 1);
1873 STATIC_ASSERT(FAST_ELEMENTS == 2);
1874 STATIC_ASSERT(FAST_HOLEY_ELEMENTS == 3);
1875 ldrb(scratch, FieldMemOperand(map, Map::kBitField2Offset)); 1873 ldrb(scratch, FieldMemOperand(map, Map::kBitField2Offset));
1876 cmp(scratch, Operand(Map::kMaximumBitField2FastHoleyElementValue)); 1874 cmp(scratch, Operand(Map::kMaximumBitField2FastElementValue));
1877 b(hi, fail); 1875 b(hi, fail);
1878 } 1876 }
1879 1877
1880 1878
1881 void MacroAssembler::CheckFastObjectElements(Register map, 1879 void MacroAssembler::CheckFastObjectElements(Register map,
1882 Register scratch, 1880 Register scratch,
1883 Label* fail) { 1881 Label* fail) {
1884 STATIC_ASSERT(FAST_SMI_ELEMENTS == 0); 1882 STATIC_ASSERT(FAST_SMI_ONLY_ELEMENTS == 0);
1885 STATIC_ASSERT(FAST_HOLEY_SMI_ELEMENTS == 1); 1883 STATIC_ASSERT(FAST_ELEMENTS == 1);
1886 STATIC_ASSERT(FAST_ELEMENTS == 2);
1887 STATIC_ASSERT(FAST_HOLEY_ELEMENTS == 3);
1888 ldrb(scratch, FieldMemOperand(map, Map::kBitField2Offset)); 1884 ldrb(scratch, FieldMemOperand(map, Map::kBitField2Offset));
1889 cmp(scratch, Operand(Map::kMaximumBitField2FastHoleySmiElementValue)); 1885 cmp(scratch, Operand(Map::kMaximumBitField2FastSmiOnlyElementValue));
1890 b(ls, fail); 1886 b(ls, fail);
1891 cmp(scratch, Operand(Map::kMaximumBitField2FastHoleyElementValue)); 1887 cmp(scratch, Operand(Map::kMaximumBitField2FastElementValue));
1892 b(hi, fail); 1888 b(hi, fail);
1893 } 1889 }
1894 1890
1895 1891
1896 void MacroAssembler::CheckFastSmiElements(Register map, 1892 void MacroAssembler::CheckFastSmiOnlyElements(Register map,
1897 Register scratch, 1893 Register scratch,
1898 Label* fail) { 1894 Label* fail) {
1899 STATIC_ASSERT(FAST_SMI_ELEMENTS == 0); 1895 STATIC_ASSERT(FAST_SMI_ONLY_ELEMENTS == 0);
1900 STATIC_ASSERT(FAST_HOLEY_SMI_ELEMENTS == 1);
1901 ldrb(scratch, FieldMemOperand(map, Map::kBitField2Offset)); 1896 ldrb(scratch, FieldMemOperand(map, Map::kBitField2Offset));
1902 cmp(scratch, Operand(Map::kMaximumBitField2FastHoleySmiElementValue)); 1897 cmp(scratch, Operand(Map::kMaximumBitField2FastSmiOnlyElementValue));
1903 b(hi, fail); 1898 b(hi, fail);
1904 } 1899 }
1905 1900
1906 1901
1907 void MacroAssembler::StoreNumberToDoubleElements(Register value_reg, 1902 void MacroAssembler::StoreNumberToDoubleElements(Register value_reg,
1908 Register key_reg, 1903 Register key_reg,
1909 Register receiver_reg, 1904 Register receiver_reg,
1910 Register elements_reg, 1905 Register elements_reg,
1911 Register scratch1, 1906 Register scratch1,
1912 Register scratch2, 1907 Register scratch2,
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
1995 1990
1996 1991
1997 void MacroAssembler::CompareMap(Register obj, 1992 void MacroAssembler::CompareMap(Register obj,
1998 Register scratch, 1993 Register scratch,
1999 Handle<Map> map, 1994 Handle<Map> map,
2000 Label* early_success, 1995 Label* early_success,
2001 CompareMapMode mode) { 1996 CompareMapMode mode) {
2002 ldr(scratch, FieldMemOperand(obj, HeapObject::kMapOffset)); 1997 ldr(scratch, FieldMemOperand(obj, HeapObject::kMapOffset));
2003 cmp(scratch, Operand(map)); 1998 cmp(scratch, Operand(map));
2004 if (mode == ALLOW_ELEMENT_TRANSITION_MAPS) { 1999 if (mode == ALLOW_ELEMENT_TRANSITION_MAPS) {
2005 ElementsKind kind = map->elements_kind(); 2000 Map* transitioned_fast_element_map(
2006 if (IsFastElementsKind(kind)) { 2001 map->LookupElementsTransitionMap(FAST_ELEMENTS, NULL));
2007 bool packed = IsFastPackedElementsKind(kind); 2002 ASSERT(transitioned_fast_element_map == NULL ||
2008 Map* current_map = *map; 2003 map->elements_kind() != FAST_ELEMENTS);
2009 while (CanTransitionToMoreGeneralFastElementsKind(kind, packed)) { 2004 if (transitioned_fast_element_map != NULL) {
2010 kind = GetNextMoreGeneralFastElementsKind(kind, packed); 2005 b(eq, early_success);
2011 current_map = current_map->LookupElementsTransitionMap(kind, NULL); 2006 cmp(scratch, Operand(Handle<Map>(transitioned_fast_element_map)));
2012 if (!current_map) break; 2007 }
2013 b(eq, early_success); 2008
2014 cmp(scratch, Operand(Handle<Map>(current_map))); 2009 Map* transitioned_double_map(
2015 } 2010 map->LookupElementsTransitionMap(FAST_DOUBLE_ELEMENTS, NULL));
2011 ASSERT(transitioned_double_map == NULL ||
2012 map->elements_kind() == FAST_SMI_ONLY_ELEMENTS);
2013 if (transitioned_double_map != NULL) {
2014 b(eq, early_success);
2015 cmp(scratch, Operand(Handle<Map>(transitioned_double_map)));
2016 } 2016 }
2017 } 2017 }
2018 } 2018 }
2019 2019
2020 2020
2021 void MacroAssembler::CheckMap(Register obj, 2021 void MacroAssembler::CheckMap(Register obj,
2022 Register scratch, 2022 Register scratch,
2023 Handle<Map> map, 2023 Handle<Map> map,
2024 Label* fail, 2024 Label* fail,
2025 SmiCheckType smi_check_type, 2025 SmiCheckType smi_check_type,
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
2858 ElementsKind expected_kind, 2858 ElementsKind expected_kind,
2859 ElementsKind transitioned_kind, 2859 ElementsKind transitioned_kind,
2860 Register map_in_out, 2860 Register map_in_out,
2861 Register scratch, 2861 Register scratch,
2862 Label* no_map_match) { 2862 Label* no_map_match) {
2863 // Load the global or builtins object from the current context. 2863 // Load the global or builtins object from the current context.
2864 ldr(scratch, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); 2864 ldr(scratch, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
2865 ldr(scratch, FieldMemOperand(scratch, GlobalObject::kGlobalContextOffset)); 2865 ldr(scratch, FieldMemOperand(scratch, GlobalObject::kGlobalContextOffset));
2866 2866
2867 // Check that the function's map is the same as the expected cached map. 2867 // Check that the function's map is the same as the expected cached map.
2868 ldr(scratch, 2868 int expected_index =
2869 MemOperand(scratch, 2869 Context::GetContextMapIndexFromElementsKind(expected_kind);
2870 Context::SlotOffset(Context::JS_ARRAY_MAPS_INDEX))); 2870 ldr(ip, MemOperand(scratch, Context::SlotOffset(expected_index)));
2871 size_t offset = expected_kind * kPointerSize + 2871 cmp(map_in_out, ip);
2872 FixedArrayBase::kHeaderSize;
2873 cmp(map_in_out, scratch);
2874 b(ne, no_map_match); 2872 b(ne, no_map_match);
2875 2873
2876 // Use the transitioned cached map. 2874 // Use the transitioned cached map.
2877 offset = transitioned_kind * kPointerSize + 2875 int trans_index =
2878 FixedArrayBase::kHeaderSize; 2876 Context::GetContextMapIndexFromElementsKind(transitioned_kind);
2879 ldr(map_in_out, FieldMemOperand(scratch, offset)); 2877 ldr(map_in_out, MemOperand(scratch, Context::SlotOffset(trans_index)));
2880 } 2878 }
2881 2879
2882 2880
2883 void MacroAssembler::LoadInitialArrayMap( 2881 void MacroAssembler::LoadInitialArrayMap(
2884 Register function_in, Register scratch, 2882 Register function_in, Register scratch, Register map_out) {
2885 Register map_out, bool can_have_holes) {
2886 ASSERT(!function_in.is(map_out)); 2883 ASSERT(!function_in.is(map_out));
2887 Label done; 2884 Label done;
2888 ldr(map_out, FieldMemOperand(function_in, 2885 ldr(map_out, FieldMemOperand(function_in,
2889 JSFunction::kPrototypeOrInitialMapOffset)); 2886 JSFunction::kPrototypeOrInitialMapOffset));
2890 if (!FLAG_smi_only_arrays) { 2887 if (!FLAG_smi_only_arrays) {
2891 ElementsKind kind = can_have_holes ? FAST_HOLEY_ELEMENTS : FAST_ELEMENTS; 2888 LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS,
2892 LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, 2889 FAST_ELEMENTS,
2893 kind,
2894 map_out, 2890 map_out,
2895 scratch, 2891 scratch,
2896 &done); 2892 &done);
2897 } else if (can_have_holes) {
2898 LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS,
2899 FAST_HOLEY_SMI_ELEMENTS,
2900 map_out,
2901 scratch,
2902 &done);
2903 } 2893 }
2904 bind(&done); 2894 bind(&done);
2905 } 2895 }
2906 2896
2907 2897
2908 void MacroAssembler::LoadGlobalFunction(int index, Register function) { 2898 void MacroAssembler::LoadGlobalFunction(int index, Register function) {
2909 // Load the global or builtins object from the current context. 2899 // Load the global or builtins object from the current context.
2910 ldr(function, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); 2900 ldr(function, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
2911 // Load the global context from the global or builtins object. 2901 // Load the global context from the global or builtins object.
2912 ldr(function, FieldMemOperand(function, 2902 ldr(function, FieldMemOperand(function,
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
3779 void CodePatcher::EmitCondition(Condition cond) { 3769 void CodePatcher::EmitCondition(Condition cond) {
3780 Instr instr = Assembler::instr_at(masm_.pc_); 3770 Instr instr = Assembler::instr_at(masm_.pc_);
3781 instr = (instr & ~kCondMask) | cond; 3771 instr = (instr & ~kCondMask) | cond;
3782 masm_.emit(instr); 3772 masm_.emit(instr);
3783 } 3773 }
3784 3774
3785 3775
3786 } } // namespace v8::internal 3776 } } // namespace v8::internal
3787 3777
3788 #endif // V8_TARGET_ARCH_ARM 3778 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/arm/stub-cache-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698