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

Unified Diff: src/ic/ic-inl.h

Issue 483683005: Move IC code into a subdir and move ic-compilation related code from stub-cache into ic-compiler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix BUILD.gn Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic/ic-compiler.cc ('k') | src/ic/stub-cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ic-inl.h
diff --git a/src/ic-inl.h b/src/ic/ic-inl.h
similarity index 82%
rename from src/ic-inl.h
rename to src/ic/ic-inl.h
index c7954ce13a3f8c681869b2f3aea416a90bfa84de..f984cee6ff8fdc77994e738eb947f700da628784 100644
--- a/src/ic-inl.h
+++ b/src/ic/ic-inl.h
@@ -5,7 +5,7 @@
#ifndef V8_IC_INL_H_
#define V8_IC_INL_H_
-#include "src/ic.h"
+#include "src/ic/ic.h"
#include "src/compiler.h"
#include "src/debug.h"
@@ -27,8 +27,8 @@ Address IC::address() const {
// At least one break point is active perform additional test to ensure that
// break point locations are updated correctly.
- if (debug->IsDebugBreak(Assembler::target_address_at(result,
- raw_constant_pool()))) {
+ if (debug->IsDebugBreak(
+ Assembler::target_address_at(result, raw_constant_pool()))) {
// If the call site is a call to debug break then return the address in
// the original code instead of the address in the running code. This will
// cause the original code to be updated and keeps the breakpoint active in
@@ -93,8 +93,7 @@ Code* IC::GetTargetAtAddress(Address address,
}
-void IC::SetTargetAtAddress(Address address,
- Code* target,
+void IC::SetTargetAtAddress(Address address, Code* target,
ConstantPoolArray* constant_pool) {
DCHECK(target->is_inline_cache_stub() || target->is_compare_ic_stub());
Heap* heap = target->GetHeap();
@@ -108,8 +107,8 @@ void IC::SetTargetAtAddress(Address address,
StoreIC::GetStrictMode(target->extra_ic_state()));
}
#endif
- Assembler::set_target_address_at(
- address, constant_pool, target->instruction_start());
+ Assembler::set_target_address_at(address, constant_pool,
+ target->instruction_start());
if (heap->gc_state() == Heap::MARK_COMPACT) {
heap->mark_compact_collector()->RecordCodeTargetPatch(address, target);
} else {
@@ -119,6 +118,46 @@ void IC::SetTargetAtAddress(Address address,
}
+void IC::set_target(Code* code) {
+#ifdef VERIFY_HEAP
+ code->VerifyEmbeddedObjectsDependency();
+#endif
+ SetTargetAtAddress(address(), code, constant_pool());
+ target_set_ = true;
+}
+
+
+void LoadIC::set_target(Code* code) {
+ // The contextual mode must be preserved across IC patching.
+ DCHECK(GetContextualMode(code->extra_ic_state()) ==
+ GetContextualMode(target()->extra_ic_state()));
+
+ IC::set_target(code);
+}
+
+
+void StoreIC::set_target(Code* code) {
+ // Strict mode must be preserved across IC patching.
+ DCHECK(GetStrictMode(code->extra_ic_state()) ==
+ GetStrictMode(target()->extra_ic_state()));
+ IC::set_target(code);
+}
+
+
+void KeyedStoreIC::set_target(Code* code) {
+ // Strict mode must be preserved across IC patching.
+ DCHECK(GetStrictMode(code->extra_ic_state()) == strict_mode());
+ IC::set_target(code);
+}
+
+
+Code* IC::raw_target() const {
+ return GetTargetAtAddress(address(), constant_pool());
+}
+
+void IC::UpdateTarget() { target_ = handle(raw_target(), isolate_); }
+
+
template <class TypeClass>
JSFunction* IC::GetRootConstructor(TypeClass* type, Context* native_context) {
if (type->Is(TypeClass::Boolean())) {
@@ -184,6 +223,7 @@ IC::State CallIC::FeedbackToState(Handle<FixedArray> vector,
return state;
}
-} } // namespace v8::internal
+}
+} // namespace v8::internal
#endif // V8_IC_INL_H_
« no previous file with comments | « src/ic/ic-compiler.cc ('k') | src/ic/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698