Lines Matching full:code
2 // Use of this source code is governed by a BSD-style license that can be
16 Handle<Code> PropertyICCompiler::Find(Handle<Name> name,
17 Handle<Map> stub_holder, Code::Kind kind,
20 Code::Flags flags =
21 Code::ComputeMonomorphicFlags(kind, extra_state, cache_holder);
23 if (probe->IsCode()) return handle(Code::cast(probe));
24 return Handle<Code>::null();
36 Handle<Code> PropertyICCompiler::ComputeKeyedLoadMonomorphicHandler(
43 // stub code needs to check that dynamically anyway.
48 Handle<Code> stub;
68 Handle<Code> PropertyICCompiler::ComputeKeyedStoreMonomorphicHandler(
80 PropertyICCompiler compiler(isolate, Code::KEYED_STORE_IC, extra_state);
81 Handle<Code> code =
83 return code;
87 Code* PropertyICCompiler::FindPreMonomorphic(Isolate* isolate, Code::Kind kind,
89 Code::Flags flags = Code::ComputeFlags(kind, PREMONOMORPHIC, state);
94 Object* code = dictionary->ValueAt(entry);
97 return reinterpret_cast<Code*>(code);
101 static void FillCache(Isolate* isolate, Handle<Code> code) {
103 isolate->factory()->non_monomorphic_cache(), code->flags(), code);
108 Handle<Code> PropertyICCompiler::ComputeStore(Isolate* isolate,
111 Code::Flags flags = Code::ComputeFlags(Code::STORE_IC, ic_state, extra_state);
115 if (entry != -1) return Handle<Code>(Code::cast(cache->ValueAt(entry)));
117 PropertyICCompiler compiler(isolate, Code::STORE_IC);
118 Handle<Code> code;
120 code = compiler.CompileStoreInitialize(flags);
122 code = compiler.CompileStorePreMonomorphic(flags);
124 code = compiler.CompileStoreGeneric(flags);
126 code = compiler.CompileStoreMegamorphic(flags);
131 FillCache(isolate, code);
132 return code;
136 Handle<Code> PropertyICCompiler::ComputeCompareNil(Handle<Map> receiver_map,
141 Handle<Code> cached_ic =
142 Find(name, receiver_map, Code::COMPARE_NIL_IC, stub->GetExtraICState());
146 Code::FindAndReplacePattern pattern;
149 Handle<Code> ic = stub->GetCodeCopy(pattern);
170 PropertyICCompiler compiler(isolate, Code::KEYED_STORE_IC, extra_state);
176 Handle<Code> PropertyICCompiler::CompileLoadInitialize(Code::Flags flags) {
178 Handle<Code> code = GetCodeWithFlags(flags, "CompileLoadInitialize");
179 PROFILE(isolate(), CodeCreateEvent(Logger::LOAD_INITIALIZE_TAG, *code, 0));
180 return code;
184 Handle<Code> PropertyICCompiler::CompileStoreInitialize(Code::Flags flags) {
186 Handle<Code> code = GetCodeWithFlags(flags, "CompileStoreInitialize");
187 PROFILE(isolate(), CodeCreateEvent(Logger::STORE_INITIALIZE_TAG, *code, 0));
188 return code;
192 Handle<Code> PropertyICCompiler::CompileStorePreMonomorphic(Code::Flags flags) {
194 Handle<Code> code = GetCodeWithFlags(flags, "CompileStorePreMonomorphic");
196 CodeCreateEvent(Logger::STORE_PREMONOMORPHIC_TAG, *code, 0));
197 return code;
201 Handle<Code> PropertyICCompiler::CompileStoreGeneric(Code::Flags flags) {
202 ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags);
205 Handle<Code> code = GetCodeWithFlags(flags, "CompileStoreGeneric");
206 PROFILE(isolate(), CodeCreateEvent(Logger::STORE_GENERIC_TAG, *code, 0));
207 return code;
211 Handle<Code> PropertyICCompiler::CompileStoreMegamorphic(Code::Flags flags) {
213 Handle<Code> code = GetCodeWithFlags(flags, "CompileStoreMegamorphic");
214 PROFILE(isolate(), CodeCreateEvent(Logger::STORE_MEGAMORPHIC_TAG, *code, 0));
215 return code;
219 Handle<Code> PropertyICCompiler::GetCode(Code::Kind kind, Code::StubType type,
222 Code::Flags flags =
223 Code::ComputeFlags(kind, state, extra_ic_state_, type, cache_holder());
224 Handle<Code> code = GetCodeWithFlags(flags, name);
225 PROFILE(isolate(), CodeCreateEvent(log_kind(code), *code, *name));
227 code->VerifyEmbeddedObjects();
229 return code;
238 Handle<Code> cached_stub;
242 // TODO(mvstanton): The code below is doing pessimistic elements
281 Handle<Code> PropertyICCompiler::CompileKeyedStoreMonomorphicHandler(
285 Handle<Code> stub;
299 Handle<Code> PropertyICCompiler::CompileKeyedStoreMonomorphic(
301 Handle<Code> stub =
311 return GetCode(kind(), Code::NORMAL, factory()->empty_string());