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/x64/stub-cache-x64.cc

Issue 10515008: Added LoadIC stub for getters. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Incorporated review comments. Created 8 years, 6 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/stub-cache.cc ('k') | no next file » | 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 2680 matching lines...) Expand 10 before | Expand all | Expand 10 after
2691 GenerateLoadCallback(object, holder, rax, rcx, rdx, rbx, rdi, callback, 2691 GenerateLoadCallback(object, holder, rax, rcx, rdx, rbx, rdi, callback,
2692 name, &miss); 2692 name, &miss);
2693 __ bind(&miss); 2693 __ bind(&miss);
2694 GenerateLoadMiss(masm(), Code::LOAD_IC); 2694 GenerateLoadMiss(masm(), Code::LOAD_IC);
2695 2695
2696 // Return the generated code. 2696 // Return the generated code.
2697 return GetCode(CALLBACKS, name); 2697 return GetCode(CALLBACKS, name);
2698 } 2698 }
2699 2699
2700 2700
2701 Handle<Code> LoadStubCompiler::CompileLoadViaGetter(
2702 Handle<String> name,
2703 Handle<JSObject> receiver,
2704 Handle<JSObject> holder,
2705 Handle<JSFunction> getter) {
2706 // ----------- S t a t e -------------
2707 // -- rax : receiver
2708 // -- rcx : name
2709 // -- rsp[0] : return address
2710 // -----------------------------------
2711 Label miss;
2712
2713 // Check that the maps haven't changed.
2714 __ JumpIfSmi(rax, &miss);
2715 CheckPrototypes(receiver, rax, holder, rbx, rdx, rdi, name, &miss);
2716
2717 {
2718 FrameScope scope(masm(), StackFrame::INTERNAL);
2719
2720 // Call the JavaScript getter with the receiver on the stack.
2721 __ push(rax);
2722 __ InvokeFunction(getter, ParameterCount(0), CALL_FUNCTION,
2723 NullCallWrapper(), CALL_AS_METHOD);
2724
2725 // Restore context register.
2726 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
2727 }
2728 __ ret(0);
2729
2730 __ bind(&miss);
2731 GenerateLoadMiss(masm(), Code::LOAD_IC);
2732
2733 // Return the generated code.
2734 return GetCode(CALLBACKS, name);
2735 }
2736
2737
2701 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object, 2738 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object,
2702 Handle<JSObject> holder, 2739 Handle<JSObject> holder,
2703 Handle<JSFunction> value, 2740 Handle<JSFunction> value,
2704 Handle<String> name) { 2741 Handle<String> name) {
2705 // ----------- S t a t e ------------- 2742 // ----------- S t a t e -------------
2706 // -- rax : receiver 2743 // -- rax : receiver
2707 // -- rcx : name 2744 // -- rcx : name
2708 // -- rsp[0] : return address 2745 // -- rsp[0] : return address
2709 // ----------------------------------- 2746 // -----------------------------------
2710 Label miss; 2747 Label miss;
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after
3912 __ jmp(ic_slow, RelocInfo::CODE_TARGET); 3949 __ jmp(ic_slow, RelocInfo::CODE_TARGET);
3913 } 3950 }
3914 } 3951 }
3915 3952
3916 3953
3917 #undef __ 3954 #undef __
3918 3955
3919 } } // namespace v8::internal 3956 } } // namespace v8::internal
3920 3957
3921 #endif // V8_TARGET_ARCH_X64 3958 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/stub-cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698