| OLD | NEW |
| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // ICs as strict mode. The strict-ness of the IC must be preserved. | 82 // ICs as strict mode. The strict-ness of the IC must be preserved. |
| 83 Code* old_target = GetTargetAtAddress(address); | 83 Code* old_target = GetTargetAtAddress(address); |
| 84 if (old_target->kind() == Code::STORE_IC || | 84 if (old_target->kind() == Code::STORE_IC || |
| 85 old_target->kind() == Code::KEYED_STORE_IC) { | 85 old_target->kind() == Code::KEYED_STORE_IC) { |
| 86 ASSERT(old_target->extra_ic_state() == target->extra_ic_state()); | 86 ASSERT(old_target->extra_ic_state() == target->extra_ic_state()); |
| 87 } | 87 } |
| 88 #endif | 88 #endif |
| 89 Assembler::set_target_address_at(address, target->instruction_start()); | 89 Assembler::set_target_address_at(address, target->instruction_start()); |
| 90 target->GetHeap()->incremental_marking()->RecordCodeTargetPatch(address, | 90 target->GetHeap()->incremental_marking()->RecordCodeTargetPatch(address, |
| 91 target); | 91 target); |
| 92 StackFrameIterator it; |
| 93 if (it.done()) return; |
| 94 it.Advance(); |
| 95 StackFrame* raw_frame = it.frame(); |
| 96 if (raw_frame->is_java_script()) { |
| 97 JSFunction* function = |
| 98 JSFunction::cast(JavaScriptFrame::cast(raw_frame)->function()); |
| 99 function->set_profiler_ticks(0); |
| 100 Isolate::Current()->runtime_profiler()->NotifyICChanged(); |
| 101 } |
| 92 } | 102 } |
| 93 | 103 |
| 94 | 104 |
| 95 InlineCacheHolderFlag IC::GetCodeCacheForObject(Object* object, | 105 InlineCacheHolderFlag IC::GetCodeCacheForObject(Object* object, |
| 96 JSObject* holder) { | 106 JSObject* holder) { |
| 97 if (object->IsJSObject()) { | 107 if (object->IsJSObject()) { |
| 98 return GetCodeCacheForObject(JSObject::cast(object), holder); | 108 return GetCodeCacheForObject(JSObject::cast(object), holder); |
| 99 } | 109 } |
| 100 // If the object is a value, we use the prototype map for the cache. | 110 // If the object is a value, we use the prototype map for the cache. |
| 101 ASSERT(object->IsString() || object->IsNumber() || object->IsBoolean()); | 111 ASSERT(object->IsString() || object->IsNumber() || object->IsBoolean()); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 123 JSObject* IC::GetCodeCacheHolder(Object* object, InlineCacheHolderFlag holder) { | 133 JSObject* IC::GetCodeCacheHolder(Object* object, InlineCacheHolderFlag holder) { |
| 124 Object* map_owner = (holder == OWN_MAP ? object : object->GetPrototype()); | 134 Object* map_owner = (holder == OWN_MAP ? object : object->GetPrototype()); |
| 125 ASSERT(map_owner->IsJSObject()); | 135 ASSERT(map_owner->IsJSObject()); |
| 126 return JSObject::cast(map_owner); | 136 return JSObject::cast(map_owner); |
| 127 } | 137 } |
| 128 | 138 |
| 129 | 139 |
| 130 } } // namespace v8::internal | 140 } } // namespace v8::internal |
| 131 | 141 |
| 132 #endif // V8_IC_INL_H_ | 142 #endif // V8_IC_INL_H_ |
| OLD | NEW |