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

Unified Diff: src/stub-cache.cc

Issue 142893003: Merge bleeding_edge 18658:18677 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 11 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/stub-cache.h ('k') | src/type-info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/stub-cache.cc
diff --git a/src/stub-cache.cc b/src/stub-cache.cc
index cb8d29402be83d460b99e06ac739304fc4827f7e..1ab249e0af76d9477d89f58094e9292a5e77230e 100644
--- a/src/stub-cache.cc
+++ b/src/stub-cache.cc
@@ -297,9 +297,7 @@ Handle<Code> StubCache::ComputeCallConstant(int argc,
CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name));
GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code));
- if (CallStubCompiler::CanBeCached(function)) {
- HeapObject::UpdateMapCodeCache(stub_holder, name, code);
- }
+ HeapObject::UpdateMapCodeCache(stub_holder, name, code);
return code;
}
@@ -402,9 +400,7 @@ Handle<Code> StubCache::ComputeCallGlobal(int argc,
PROFILE(isolate(),
CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_IC_TAG), *code, *name));
GDBJIT(AddCode(GDBJITInterface::CALL_IC, *name, *code));
- if (CallStubCompiler::CanBeCached(function)) {
- HeapObject::UpdateMapCodeCache(receiver, name, code);
- }
+ HeapObject::UpdateMapCodeCache(receiver, name, code);
return code;
}
@@ -419,10 +415,8 @@ static void FillCache(Isolate* isolate, Handle<Code> code) {
Code* StubCache::FindCallInitialize(int argc, Code::Kind kind) {
- ExtraICState extra_state =
- CallICBase::StringStubState::encode(DEFAULT_STRING_STUB);
- Code::Flags flags =
- Code::ComputeFlags(kind, UNINITIALIZED, extra_state, Code::NORMAL, argc);
+ Code::Flags flags = Code::ComputeFlags(
+ kind, UNINITIALIZED, kNoExtraICState, Code::NORMAL, argc);
UnseededNumberDictionary* dictionary =
isolate()->heap()->non_monomorphic_cache();
int entry = dictionary->FindEntry(isolate(), flags);
@@ -448,10 +442,8 @@ Code* StubCache::FindPreMonomorphicIC(Code::Kind kind, ExtraICState state) {
Handle<Code> StubCache::ComputeCallInitialize(int argc, Code::Kind kind) {
- ExtraICState extra_state =
- CallICBase::ComputeExtraICState(DEFAULT_STRING_STUB);
- Code::Flags flags =
- Code::ComputeFlags(kind, UNINITIALIZED, extra_state, Code::NORMAL, argc);
+ Code::Flags flags = Code::ComputeFlags(
+ kind, UNINITIALIZED, kNoExtraICState, Code::NORMAL, argc);
Handle<UnseededNumberDictionary> cache =
isolate_->factory()->non_monomorphic_cache();
int entry = cache->FindEntry(isolate_, flags);
@@ -883,12 +875,10 @@ RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorOnly) {
static MaybeObject* ThrowReferenceError(Isolate* isolate, Name* name) {
// If the load is non-contextual, just return the undefined result.
- // Note that both keyed and non-keyed loads may end up here, so we
- // can't use either LoadIC or KeyedLoadIC constructors.
+ // Note that both keyed and non-keyed loads may end up here.
HandleScope scope(isolate);
- IC ic(IC::NO_EXTRA_FRAME, isolate);
- ASSERT(ic.IsLoadStub());
- if (!ic.IsContextual()) {
+ LoadIC ic(IC::NO_EXTRA_FRAME, isolate);
+ if (ic.contextual_mode() != CONTEXTUAL) {
return isolate->heap()->undefined_value();
}
@@ -1047,9 +1037,6 @@ Handle<Code> StubCompiler::CompileCallNormal(Code::Flags flags) {
int argc = Code::ExtractArgumentsCountFromFlags(flags);
Code::Kind kind = Code::ExtractKindFromFlags(flags);
if (kind == Code::CALL_IC) {
- // Call normal is always with a explict receiver.
- ASSERT(!CallIC::Contextual::decode(
- Code::ExtractExtraICStateFromFlags(flags)));
CallIC::GenerateNormal(masm(), argc);
} else {
KeyedCallIC::GenerateNormal(masm(), argc);
@@ -1105,7 +1092,7 @@ Handle<Code> StubCompiler::CompileLoadPreMonomorphic(Code::Flags flags) {
Handle<Code> StubCompiler::CompileLoadMegamorphic(Code::Flags flags) {
ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags);
- ContextualMode mode = IC::GetContextualMode(extra_state);
+ ContextualMode mode = LoadIC::GetContextualMode(extra_state);
LoadIC::GenerateMegamorphic(masm(), mode);
Handle<Code> code = GetCodeWithFlags(flags, "CompileLoadMegamorphic");
PROFILE(isolate(),
@@ -1902,18 +1889,6 @@ bool CallStubCompiler::HasCustomCallGenerator(Handle<JSFunction> function) {
}
-bool CallStubCompiler::CanBeCached(Handle<JSFunction> function) {
- if (function->shared()->HasBuiltinFunctionId()) {
- BuiltinFunctionId id = function->shared()->builtin_function_id();
-#define CALL_GENERATOR_CASE(name) if (id == k##name) return false;
- SITE_SPECIFIC_CALL_GENERATORS(CALL_GENERATOR_CASE)
-#undef CALL_GENERATOR_CASE
- }
-
- return true;
-}
-
-
Handle<Code> CallStubCompiler::CompileCustomCall(
Handle<Object> object,
Handle<JSObject> holder,
« no previous file with comments | « src/stub-cache.h ('k') | src/type-info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698