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

Side by Side Diff: src/mips/stub-cache-mips.cc

Issue 10910110: Fixed deoptimization of inlined getters. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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/mips/lithium-codegen-mips.cc ('k') | src/objects.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 2938 matching lines...) Expand 10 before | Expand all | Expand 10 after
2949 GenerateLoadCallback(object, holder, a0, a2, a3, a1, t0, t1, callback, name, 2949 GenerateLoadCallback(object, holder, a0, a2, a3, a1, t0, t1, callback, name,
2950 &miss); 2950 &miss);
2951 __ bind(&miss); 2951 __ bind(&miss);
2952 GenerateLoadMiss(masm(), Code::LOAD_IC); 2952 GenerateLoadMiss(masm(), Code::LOAD_IC);
2953 2953
2954 // Return the generated code. 2954 // Return the generated code.
2955 return GetCode(Code::CALLBACKS, name); 2955 return GetCode(Code::CALLBACKS, name);
2956 } 2956 }
2957 2957
2958 2958
2959 #undef __
2960 #define __ ACCESS_MASM(masm)
2961
2962
2963 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
2964 Handle<JSFunction> getter) {
2965 // ----------- S t a t e -------------
2966 // -- a0 : receiver
2967 // -- a2 : name
2968 // -- ra : return address
2969 // -----------------------------------
2970 {
2971 FrameScope scope(masm, StackFrame::INTERNAL);
2972
2973 if (!getter.is_null()) {
2974 // Call the JavaScript getter with the receiver on the stack.
2975 __ push(a0);
2976 ParameterCount actual(0);
2977 __ InvokeFunction(getter, actual, CALL_FUNCTION, NullCallWrapper(),
2978 CALL_AS_METHOD);
2979 } else {
2980 // If we generate a global code snippet for deoptimization only, remember
2981 // the place to continue after deoptimization.
2982 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset());
2983 }
2984
2985 // Restore context register.
2986 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2987 }
2988 __ Ret();
2989 }
2990
2991
2992 #undef __
2993 #define __ ACCESS_MASM(masm())
2994
2995
2959 Handle<Code> LoadStubCompiler::CompileLoadViaGetter( 2996 Handle<Code> LoadStubCompiler::CompileLoadViaGetter(
2960 Handle<String> name, 2997 Handle<String> name,
2961 Handle<JSObject> receiver, 2998 Handle<JSObject> receiver,
2962 Handle<JSObject> holder, 2999 Handle<JSObject> holder,
2963 Handle<JSFunction> getter) { 3000 Handle<JSFunction> getter) {
2964 // ----------- S t a t e ------------- 3001 // ----------- S t a t e -------------
2965 // -- a0 : receiver 3002 // -- a0 : receiver
2966 // -- a2 : name 3003 // -- a2 : name
2967 // -- ra : return address 3004 // -- ra : return address
2968 // ----------------------------------- 3005 // -----------------------------------
2969 Label miss; 3006 Label miss;
2970 3007
2971 // Check that the maps haven't changed. 3008 // Check that the maps haven't changed.
2972 __ JumpIfSmi(a0, &miss); 3009 __ JumpIfSmi(a0, &miss);
2973 CheckPrototypes(receiver, a0, holder, a3, t0, a1, name, &miss); 3010 CheckPrototypes(receiver, a0, holder, a3, t0, a1, name, &miss);
2974 3011
2975 { 3012 GenerateLoadViaGetter(masm(), getter);
2976 FrameScope scope(masm(), StackFrame::INTERNAL);
2977
2978 // Call the JavaScript getter with the receiver on the stack.
2979 __ push(a0);
2980 ParameterCount actual(0);
2981 __ InvokeFunction(getter, actual, CALL_FUNCTION, NullCallWrapper(),
2982 CALL_AS_METHOD);
2983
2984 // Restore context register.
2985 __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2986 }
2987 __ Ret();
2988 3013
2989 __ bind(&miss); 3014 __ bind(&miss);
2990 GenerateLoadMiss(masm(), Code::LOAD_IC); 3015 GenerateLoadMiss(masm(), Code::LOAD_IC);
2991 3016
2992 // Return the generated code. 3017 // Return the generated code.
2993 return GetCode(Code::CALLBACKS, name); 3018 return GetCode(Code::CALLBACKS, name);
2994 } 3019 }
2995 3020
2996 3021
2997 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object, 3022 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object,
(...skipping 1812 matching lines...) Expand 10 before | Expand all | Expand 10 after
4810 __ Jump(ic_slow, RelocInfo::CODE_TARGET); 4835 __ Jump(ic_slow, RelocInfo::CODE_TARGET);
4811 } 4836 }
4812 } 4837 }
4813 4838
4814 4839
4815 #undef __ 4840 #undef __
4816 4841
4817 } } // namespace v8::internal 4842 } } // namespace v8::internal
4818 4843
4819 #endif // V8_TARGET_ARCH_MIPS 4844 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698