OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 Handle<SharedFunctionInfo> shared(function->shared()); | 114 Handle<SharedFunctionInfo> shared(function->shared()); |
115 Code* code = shared->code(); | 115 Code* code = shared->code(); |
116 ASSERT(Debug::HasDebugInfo(shared)); | 116 ASSERT(Debug::HasDebugInfo(shared)); |
117 Code* original_code = Debug::GetDebugInfo(shared)->original_code(); | 117 Code* original_code = Debug::GetDebugInfo(shared)->original_code(); |
118 ASSERT(original_code->IsCode()); | 118 ASSERT(original_code->IsCode()); |
119 // Get the address of the call site in the active code. This is the | 119 // Get the address of the call site in the active code. This is the |
120 // place where the call to DebugBreakXXX is and where the IC | 120 // place where the call to DebugBreakXXX is and where the IC |
121 // normally would be. | 121 // normally would be. |
122 Address addr = pc() - Assembler::kTargetAddrToReturnAddrDist; | 122 Address addr = pc() - Assembler::kTargetAddrToReturnAddrDist; |
123 // Return the address in the original code. This is the place where | 123 // Return the address in the original code. This is the place where |
124 // the call which has been overwriten by the DebugBreakXXX resides | 124 // the call which has been overwritten by the DebugBreakXXX resides |
125 // and the place where the inline cache system should look. | 125 // and the place where the inline cache system should look. |
126 int delta = original_code->instruction_start() - code->instruction_start(); | 126 int delta = original_code->instruction_start() - code->instruction_start(); |
127 return addr + delta; | 127 return addr + delta; |
128 } | 128 } |
129 | 129 |
130 | 130 |
131 IC::State IC::StateFrom(Code* target, Object* receiver) { | 131 IC::State IC::StateFrom(Code* target, Object* receiver) { |
132 IC::State state = target->ic_state(); | 132 IC::State state = target->ic_state(); |
133 | 133 |
134 if (state != MONOMORPHIC) return state; | 134 if (state != MONOMORPHIC) return state; |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 | 1155 |
1156 // Expand the properties array. | 1156 // Expand the properties array. |
1157 FixedArray* old_storage = object->properties(); | 1157 FixedArray* old_storage = object->properties(); |
1158 int new_unused = transition->unused_property_fields(); | 1158 int new_unused = transition->unused_property_fields(); |
1159 int new_size = old_storage->length() + new_unused + 1; | 1159 int new_size = old_storage->length() + new_unused + 1; |
1160 Object* result = old_storage->CopySize(new_size); | 1160 Object* result = old_storage->CopySize(new_size); |
1161 if (result->IsFailure()) return result; | 1161 if (result->IsFailure()) return result; |
1162 FixedArray* new_storage = FixedArray::cast(result); | 1162 FixedArray* new_storage = FixedArray::cast(result); |
1163 new_storage->set(old_storage->length(), value); | 1163 new_storage->set(old_storage->length(), value); |
1164 | 1164 |
1165 // Set the new property value and do the map tranistion. | 1165 // Set the new property value and do the map transition. |
1166 object->set_properties(new_storage); | 1166 object->set_properties(new_storage); |
1167 object->set_map(transition); | 1167 object->set_map(transition); |
1168 | 1168 |
1169 // Return the stored value. | 1169 // Return the stored value. |
1170 return value; | 1170 return value; |
1171 } | 1171 } |
1172 | 1172 |
1173 | 1173 |
1174 void StoreIC::GenerateInitialize(MacroAssembler* masm) { | 1174 void StoreIC::GenerateInitialize(MacroAssembler* masm) { |
1175 Generate(masm, ExternalReference(IC_Utility(kStoreIC_Miss))); | 1175 Generate(masm, ExternalReference(IC_Utility(kStoreIC_Miss))); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1209 #undef ADDR | 1209 #undef ADDR |
1210 }; | 1210 }; |
1211 | 1211 |
1212 | 1212 |
1213 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 1213 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
1214 return IC_utilities[id]; | 1214 return IC_utilities[id]; |
1215 } | 1215 } |
1216 | 1216 |
1217 | 1217 |
1218 } } // namespace v8::internal | 1218 } } // namespace v8::internal |
OLD | NEW |