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

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

Issue 160265: Change the updating of the counters for global stub use (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 4 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 | « no previous file | src/ia32/stub-cache-ia32.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 Object* CallStubCompiler::CompileCallGlobal(JSObject* object, 739 Object* CallStubCompiler::CompileCallGlobal(JSObject* object,
740 GlobalObject* holder, 740 GlobalObject* holder,
741 JSGlobalPropertyCell* cell, 741 JSGlobalPropertyCell* cell,
742 JSFunction* function, 742 JSFunction* function,
743 String* name) { 743 String* name) {
744 // ----------- S t a t e ------------- 744 // ----------- S t a t e -------------
745 // -- lr: return address 745 // -- lr: return address
746 // ----------------------------------- 746 // -----------------------------------
747 Label miss; 747 Label miss;
748 748
749 __ IncrementCounter(&Counters::call_global_inline, 1, r1, r3);
750
751 // Get the number of arguments. 749 // Get the number of arguments.
752 const int argc = arguments().immediate(); 750 const int argc = arguments().immediate();
753 751
754 // Get the receiver from the stack. 752 // Get the receiver from the stack.
755 __ ldr(r0, MemOperand(sp, argc * kPointerSize)); 753 __ ldr(r0, MemOperand(sp, argc * kPointerSize));
756 754
757 // If the object is the holder then we know that it's a global 755 // If the object is the holder then we know that it's a global
758 // object which can only happen for contextual calls. In this case, 756 // object which can only happen for contextual calls. In this case,
759 // the receiver cannot be a smi. 757 // the receiver cannot be a smi.
760 if (object != holder) { 758 if (object != holder) {
(...skipping 16 matching lines...) Expand all
777 // necessary. 775 // necessary.
778 if (object->IsGlobalObject()) { 776 if (object->IsGlobalObject()) {
779 __ ldr(r3, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset)); 777 __ ldr(r3, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset));
780 __ str(r3, MemOperand(sp, argc * kPointerSize)); 778 __ str(r3, MemOperand(sp, argc * kPointerSize));
781 } 779 }
782 780
783 // Setup the context (function already in r1). 781 // Setup the context (function already in r1).
784 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); 782 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
785 783
786 // Jump to the cached code (tail call). 784 // Jump to the cached code (tail call).
785 __ IncrementCounter(&Counters::call_global_inline, 1, r1, r3);
787 ASSERT(function->is_compiled()); 786 ASSERT(function->is_compiled());
788 Handle<Code> code(function->code()); 787 Handle<Code> code(function->code());
789 ParameterCount expected(function->shared()->formal_parameter_count()); 788 ParameterCount expected(function->shared()->formal_parameter_count());
790 __ InvokeCode(code, expected, arguments(), 789 __ InvokeCode(code, expected, arguments(),
791 RelocInfo::CODE_TARGET, JUMP_FUNCTION); 790 RelocInfo::CODE_TARGET, JUMP_FUNCTION);
792 791
793 // Handle call cache miss. 792 // Handle call cache miss.
794 __ bind(&miss); 793 __ bind(&miss);
795 __ DecrementCounter(&Counters::call_global_inline, 1, r1, r3);
796 __ IncrementCounter(&Counters::call_global_inline_miss, 1, r1, r3); 794 __ IncrementCounter(&Counters::call_global_inline_miss, 1, r1, r3);
797 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); 795 Handle<Code> ic = ComputeCallMiss(arguments().immediate());
798 __ Jump(ic, RelocInfo::CODE_TARGET); 796 __ Jump(ic, RelocInfo::CODE_TARGET);
799 797
800 // Return the generated code. 798 // Return the generated code.
801 return GetCode(NORMAL, name); 799 return GetCode(NORMAL, name);
802 } 800 }
803 801
804 802
805 Object* StoreStubCompiler::CompileStoreField(JSObject* object, 803 Object* StoreStubCompiler::CompileStoreField(JSObject* object,
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 JSGlobalPropertyCell* cell, 944 JSGlobalPropertyCell* cell,
947 String* name) { 945 String* name) {
948 // ----------- S t a t e ------------- 946 // ----------- S t a t e -------------
949 // -- r0 : value 947 // -- r0 : value
950 // -- r2 : name 948 // -- r2 : name
951 // -- lr : return address 949 // -- lr : return address
952 // -- [sp] : receiver 950 // -- [sp] : receiver
953 // ----------------------------------- 951 // -----------------------------------
954 Label miss; 952 Label miss;
955 953
956 __ IncrementCounter(&Counters::named_store_global_inline, 1, r1, r3);
957
958 // Check that the map of the global has not changed. 954 // Check that the map of the global has not changed.
959 __ ldr(r1, MemOperand(sp, 0 * kPointerSize)); 955 __ ldr(r1, MemOperand(sp, 0 * kPointerSize));
960 __ ldr(r3, FieldMemOperand(r1, HeapObject::kMapOffset)); 956 __ ldr(r3, FieldMemOperand(r1, HeapObject::kMapOffset));
961 __ cmp(r3, Operand(Handle<Map>(object->map()))); 957 __ cmp(r3, Operand(Handle<Map>(object->map())));
962 __ b(ne, &miss); 958 __ b(ne, &miss);
963 959
964 // Store the value in the cell. 960 // Store the value in the cell.
965 __ mov(r2, Operand(Handle<JSGlobalPropertyCell>(cell))); 961 __ mov(r2, Operand(Handle<JSGlobalPropertyCell>(cell)));
966 __ str(r0, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset)); 962 __ str(r0, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset));
967 963
964 __ IncrementCounter(&Counters::named_store_global_inline, 1, r1, r3);
968 __ Ret(); 965 __ Ret();
969 966
970 // Handle store cache miss. 967 // Handle store cache miss.
971 __ bind(&miss); 968 __ bind(&miss);
972 __ DecrementCounter(&Counters::named_store_global_inline, 1, r1, r3);
973 __ IncrementCounter(&Counters::named_store_global_inline_miss, 1, r1, r3); 969 __ IncrementCounter(&Counters::named_store_global_inline_miss, 1, r1, r3);
974 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); 970 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss));
975 __ Jump(ic, RelocInfo::CODE_TARGET); 971 __ Jump(ic, RelocInfo::CODE_TARGET);
976 972
977 // Return the generated code. 973 // Return the generated code.
978 return GetCode(NORMAL, name); 974 return GetCode(NORMAL, name);
979 } 975 }
980 976
981 977
982 Object* LoadStubCompiler::CompileLoadField(JSObject* object, 978 Object* LoadStubCompiler::CompileLoadField(JSObject* object,
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 JSGlobalPropertyCell* cell, 1074 JSGlobalPropertyCell* cell,
1079 String* name, 1075 String* name,
1080 bool is_dont_delete) { 1076 bool is_dont_delete) {
1081 // ----------- S t a t e ------------- 1077 // ----------- S t a t e -------------
1082 // -- r2 : name 1078 // -- r2 : name
1083 // -- lr : return address 1079 // -- lr : return address
1084 // -- [sp] : receiver 1080 // -- [sp] : receiver
1085 // ----------------------------------- 1081 // -----------------------------------
1086 Label miss; 1082 Label miss;
1087 1083
1088 __ IncrementCounter(&Counters::named_load_global_inline, 1, r1, r3);
1089
1090 // Get the receiver from the stack. 1084 // Get the receiver from the stack.
1091 __ ldr(r1, MemOperand(sp, 0 * kPointerSize)); 1085 __ ldr(r1, MemOperand(sp, 0 * kPointerSize));
1092 1086
1093 // If the object is the holder then we know that it's a global 1087 // If the object is the holder then we know that it's a global
1094 // object which can only happen for contextual calls. In this case, 1088 // object which can only happen for contextual calls. In this case,
1095 // the receiver cannot be a smi. 1089 // the receiver cannot be a smi.
1096 if (object != holder) { 1090 if (object != holder) {
1097 __ tst(r1, Operand(kSmiTagMask)); 1091 __ tst(r1, Operand(kSmiTagMask));
1098 __ b(eq, &miss); 1092 __ b(eq, &miss);
1099 } 1093 }
1100 1094
1101 // Check that the map of the global has not changed. 1095 // Check that the map of the global has not changed.
1102 CheckPrototypes(object, r1, holder, r3, r0, name, &miss); 1096 CheckPrototypes(object, r1, holder, r3, r0, name, &miss);
1103 1097
1104 // Get the value from the cell. 1098 // Get the value from the cell.
1105 __ mov(r3, Operand(Handle<JSGlobalPropertyCell>(cell))); 1099 __ mov(r3, Operand(Handle<JSGlobalPropertyCell>(cell)));
1106 __ ldr(r0, FieldMemOperand(r3, JSGlobalPropertyCell::kValueOffset)); 1100 __ ldr(r0, FieldMemOperand(r3, JSGlobalPropertyCell::kValueOffset));
1107 1101
1108 // Check for deleted property if property can actually be deleted. 1102 // Check for deleted property if property can actually be deleted.
1109 if (!is_dont_delete) { 1103 if (!is_dont_delete) {
1110 __ cmp(r0, Operand(Factory::the_hole_value())); 1104 __ cmp(r0, Operand(Factory::the_hole_value()));
1111 __ b(eq, &miss); 1105 __ b(eq, &miss);
1112 } 1106 }
1113 1107
1108 __ IncrementCounter(&Counters::named_load_global_inline, 1, r1, r3);
1114 __ Ret(); 1109 __ Ret();
1115 1110
1116 __ bind(&miss); 1111 __ bind(&miss);
1117 __ DecrementCounter(&Counters::named_load_global_inline, 1, r1, r3);
1118 __ IncrementCounter(&Counters::named_load_global_inline_miss, 1, r1, r3); 1112 __ IncrementCounter(&Counters::named_load_global_inline_miss, 1, r1, r3);
1119 GenerateLoadMiss(masm(), Code::LOAD_IC); 1113 GenerateLoadMiss(masm(), Code::LOAD_IC);
1120 1114
1121 // Return the generated code. 1115 // Return the generated code.
1122 return GetCode(NORMAL, name); 1116 return GetCode(NORMAL, name);
1123 } 1117 }
1124 1118
1125 1119
1126 Object* KeyedLoadStubCompiler::CompileLoadField(String* name, 1120 Object* KeyedLoadStubCompiler::CompileLoadField(String* name,
1127 JSObject* receiver, 1121 JSObject* receiver,
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1330 __ Jump(ic, RelocInfo::CODE_TARGET); 1324 __ Jump(ic, RelocInfo::CODE_TARGET);
1331 1325
1332 // Return the generated code. 1326 // Return the generated code.
1333 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); 1327 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name);
1334 } 1328 }
1335 1329
1336 1330
1337 #undef __ 1331 #undef __
1338 1332
1339 } } // namespace v8::internal 1333 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698