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

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

Issue 8111006: Allow new-space JSFunction objects as constant-function properties. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: rebased Created 9 years 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 // -- sp[0] : holder (set by CheckPrototypes) 568 // -- sp[0] : holder (set by CheckPrototypes)
569 // -- sp[4] : callee js function 569 // -- sp[4] : callee js function
570 // -- sp[8] : call data 570 // -- sp[8] : call data
571 // -- sp[12] : last js argument 571 // -- sp[12] : last js argument
572 // -- ... 572 // -- ...
573 // -- sp[(argc + 3) * 4] : first js argument 573 // -- sp[(argc + 3) * 4] : first js argument
574 // -- sp[(argc + 4) * 4] : receiver 574 // -- sp[(argc + 4) * 4] : receiver
575 // ----------------------------------- 575 // -----------------------------------
576 // Get the function and setup the context. 576 // Get the function and setup the context.
577 Handle<JSFunction> function = optimization.constant_function(); 577 Handle<JSFunction> function = optimization.constant_function();
578 __ mov(r5, Operand(function)); 578 __ LoadHeapObject(r5, function);
579 __ ldr(cp, FieldMemOperand(r5, JSFunction::kContextOffset)); 579 __ ldr(cp, FieldMemOperand(r5, JSFunction::kContextOffset));
580 580
581 // Pass the additional arguments FastHandleApiCall expects. 581 // Pass the additional arguments FastHandleApiCall expects.
582 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); 582 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info();
583 Handle<Object> call_data(api_call_info->data()); 583 Handle<Object> call_data(api_call_info->data());
584 if (masm->isolate()->heap()->InNewSpace(*call_data)) { 584 if (masm->isolate()->heap()->InNewSpace(*call_data)) {
585 __ Move(r0, api_call_info); 585 __ Move(r0, api_call_info);
586 __ ldr(r6, FieldMemOperand(r0, CallHandlerInfo::kDataOffset)); 586 __ ldr(r6, FieldMemOperand(r0, CallHandlerInfo::kDataOffset));
587 } else { 587 } else {
588 __ Move(r6, call_data); 588 __ Move(r6, call_data);
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 __ Ret(); 1092 __ Ret();
1093 } 1093 }
1094 1094
1095 1095
1096 void StubCompiler::GenerateLoadConstant(Handle<JSObject> object, 1096 void StubCompiler::GenerateLoadConstant(Handle<JSObject> object,
1097 Handle<JSObject> holder, 1097 Handle<JSObject> holder,
1098 Register receiver, 1098 Register receiver,
1099 Register scratch1, 1099 Register scratch1,
1100 Register scratch2, 1100 Register scratch2,
1101 Register scratch3, 1101 Register scratch3,
1102 Handle<Object> value, 1102 Handle<JSFunction> value,
1103 Handle<String> name, 1103 Handle<String> name,
1104 Label* miss) { 1104 Label* miss) {
1105 // Check that the receiver isn't a smi. 1105 // Check that the receiver isn't a smi.
1106 __ JumpIfSmi(receiver, miss); 1106 __ JumpIfSmi(receiver, miss);
1107 1107
1108 // Check that the maps haven't changed. 1108 // Check that the maps haven't changed.
1109 CheckPrototypes( 1109 CheckPrototypes(
1110 object, receiver, holder, scratch1, scratch2, scratch3, name, miss); 1110 object, receiver, holder, scratch1, scratch2, scratch3, name, miss);
1111 1111
1112 // Return the constant value. 1112 // Return the constant value.
1113 __ mov(r0, Operand(value)); 1113 __ LoadHeapObject(r0, value);
1114 __ Ret(); 1114 __ Ret();
1115 } 1115 }
1116 1116
1117 1117
1118 void StubCompiler::GenerateLoadCallback(Handle<JSObject> object, 1118 void StubCompiler::GenerateLoadCallback(Handle<JSObject> object,
1119 Handle<JSObject> holder, 1119 Handle<JSObject> holder,
1120 Register receiver, 1120 Register receiver,
1121 Register name_reg, 1121 Register name_reg,
1122 Register scratch1, 1122 Register scratch1,
1123 Register scratch2, 1123 Register scratch2,
(...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after
2683 __ bind(&miss); 2683 __ bind(&miss);
2684 GenerateLoadMiss(masm(), Code::LOAD_IC); 2684 GenerateLoadMiss(masm(), Code::LOAD_IC);
2685 2685
2686 // Return the generated code. 2686 // Return the generated code.
2687 return GetCode(CALLBACKS, name); 2687 return GetCode(CALLBACKS, name);
2688 } 2688 }
2689 2689
2690 2690
2691 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object, 2691 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object,
2692 Handle<JSObject> holder, 2692 Handle<JSObject> holder,
2693 Handle<Object> value, 2693 Handle<JSFunction> value,
2694 Handle<String> name) { 2694 Handle<String> name) {
2695 // ----------- S t a t e ------------- 2695 // ----------- S t a t e -------------
2696 // -- r0 : receiver 2696 // -- r0 : receiver
2697 // -- r2 : name 2697 // -- r2 : name
2698 // -- lr : return address 2698 // -- lr : return address
2699 // ----------------------------------- 2699 // -----------------------------------
2700 Label miss; 2700 Label miss;
2701 2701
2702 GenerateLoadConstant(object, holder, r0, r3, r1, r4, value, name, &miss); 2702 GenerateLoadConstant(object, holder, r0, r3, r1, r4, value, name, &miss);
2703 __ bind(&miss); 2703 __ bind(&miss);
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
2823 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); 2823 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC);
2824 2824
2825 return GetCode(CALLBACKS, name); 2825 return GetCode(CALLBACKS, name);
2826 } 2826 }
2827 2827
2828 2828
2829 Handle<Code> KeyedLoadStubCompiler::CompileLoadConstant( 2829 Handle<Code> KeyedLoadStubCompiler::CompileLoadConstant(
2830 Handle<String> name, 2830 Handle<String> name,
2831 Handle<JSObject> receiver, 2831 Handle<JSObject> receiver,
2832 Handle<JSObject> holder, 2832 Handle<JSObject> holder,
2833 Handle<Object> value) { 2833 Handle<JSFunction> value) {
2834 // ----------- S t a t e ------------- 2834 // ----------- S t a t e -------------
2835 // -- lr : return address 2835 // -- lr : return address
2836 // -- r0 : key 2836 // -- r0 : key
2837 // -- r1 : receiver 2837 // -- r1 : receiver
2838 // ----------------------------------- 2838 // -----------------------------------
2839 Label miss; 2839 Label miss;
2840 2840
2841 // Check the key is the cached one. 2841 // Check the key is the cached one.
2842 __ cmp(r0, Operand(name)); 2842 __ cmp(r0, Operand(name));
2843 __ b(ne, &miss); 2843 __ b(ne, &miss);
(...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after
4234 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); 4234 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss();
4235 __ Jump(ic_miss, RelocInfo::CODE_TARGET); 4235 __ Jump(ic_miss, RelocInfo::CODE_TARGET);
4236 } 4236 }
4237 4237
4238 4238
4239 #undef __ 4239 #undef __
4240 4240
4241 } } // namespace v8::internal 4241 } } // namespace v8::internal
4242 4242
4243 #endif // V8_TARGET_ARCH_ARM 4243 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/ia32/assembler-ia32.h » ('j') | src/objects-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698