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

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

Issue 9235007: Handle single element array growth + transition in generic KeyedStoreIC (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: final version Created 8 years, 10 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/contexts.h » ('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 2861 matching lines...) Expand 10 before | Expand all | Expand 10 after
2872 } 2872 }
2873 } else { 2873 } else {
2874 // Slot is in the current function context. Move it into the 2874 // Slot is in the current function context. Move it into the
2875 // destination register in case we store into it (the write barrier 2875 // destination register in case we store into it (the write barrier
2876 // cannot be allowed to destroy the context in esi). 2876 // cannot be allowed to destroy the context in esi).
2877 mov(dst, cp); 2877 mov(dst, cp);
2878 } 2878 }
2879 } 2879 }
2880 2880
2881 2881
2882 void MacroAssembler::LoadGlobalInitialConstructedArrayMap( 2882 void MacroAssembler::LoadTransitionedArrayMapConditional(
2883 ElementsKind expected_kind,
2884 ElementsKind transitioned_kind,
2885 Register map_in_out,
2886 Register scratch,
2887 Label* no_map_match) {
2888 // Load the global or builtins object from the current context.
2889 ldr(scratch, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
2890 ldr(scratch, FieldMemOperand(scratch, GlobalObject::kGlobalContextOffset));
2891
2892 // Check that the function's map is the same as the expected cached map.
2893 int expected_index =
2894 Context::GetContextMapIndexFromElementsKind(expected_kind);
2895 ldr(ip, MemOperand(scratch, Context::SlotOffset(expected_index)));
2896 cmp(map_in_out, ip);
2897 b(ne, no_map_match);
2898
2899 // Use the transitioned cached map.
2900 int trans_index =
2901 Context::GetContextMapIndexFromElementsKind(transitioned_kind);
2902 ldr(map_in_out, MemOperand(scratch, Context::SlotOffset(trans_index)));
2903 }
2904
2905
2906 void MacroAssembler::LoadInitialArrayMap(
2883 Register function_in, Register scratch, Register map_out) { 2907 Register function_in, Register scratch, Register map_out) {
2884 ASSERT(!function_in.is(map_out)); 2908 ASSERT(!function_in.is(map_out));
2885 Label done; 2909 Label done;
2886 ldr(map_out, FieldMemOperand(function_in, 2910 ldr(map_out, FieldMemOperand(function_in,
2887 JSFunction::kPrototypeOrInitialMapOffset)); 2911 JSFunction::kPrototypeOrInitialMapOffset));
2888 if (!FLAG_smi_only_arrays) { 2912 if (!FLAG_smi_only_arrays) {
2889 // Load the global or builtins object from the current context. 2913 LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS,
2890 ldr(scratch, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); 2914 FAST_ELEMENTS,
2891 ldr(scratch, FieldMemOperand(scratch, GlobalObject::kGlobalContextOffset)); 2915 map_out,
2892 2916 scratch,
2893 // Check that the function's map is same as the cached map. 2917 &done);
2894 ldr(ip, MemOperand(
2895 scratch, Context::SlotOffset(Context::SMI_JS_ARRAY_MAP_INDEX)));
2896 cmp(map_out, ip);
2897 b(ne, &done);
2898
2899 // Use the cached transitioned map.
2900 ldr(map_out,
2901 MemOperand(scratch,
2902 Context::SlotOffset(Context::OBJECT_JS_ARRAY_MAP_INDEX)));
2903 } 2918 }
2904 bind(&done); 2919 bind(&done);
2905 } 2920 }
2906 2921
2907 2922
2908 void MacroAssembler::LoadGlobalFunction(int index, Register function) { 2923 void MacroAssembler::LoadGlobalFunction(int index, Register function) {
2909 // Load the global or builtins object from the current context. 2924 // Load the global or builtins object from the current context.
2910 ldr(function, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); 2925 ldr(function, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
2911 // Load the global context from the global or builtins object. 2926 // Load the global context from the global or builtins object.
2912 ldr(function, FieldMemOperand(function, 2927 ldr(function, FieldMemOperand(function,
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
3720 void CodePatcher::EmitCondition(Condition cond) { 3735 void CodePatcher::EmitCondition(Condition cond) {
3721 Instr instr = Assembler::instr_at(masm_.pc_); 3736 Instr instr = Assembler::instr_at(masm_.pc_);
3722 instr = (instr & ~kCondMask) | cond; 3737 instr = (instr & ~kCondMask) | cond;
3723 masm_.emit(instr); 3738 masm_.emit(instr);
3724 } 3739 }
3725 3740
3726 3741
3727 } } // namespace v8::internal 3742 } } // namespace v8::internal
3728 3743
3729 #endif // V8_TARGET_ARCH_ARM 3744 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/contexts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698