Home | History | Annotate | Download | only in src

Lines Matching refs:Code

6 //     * Redistributions of source code must retain the above copyright
1549 accumulator->Add("<Code>");
1688 reinterpret_cast<Code*>(this)->CodeIterateBody(v);
3679 // Code will be set on the JavaScript side.
3972 // present, add it with attributes NONE. This code is an exact clone of
4410 // except for the code cache, which can contain some ics which can be
4453 Handle<Code> code) {
4456 object->UpdateMapCodeCache(*name, *code));
4460 MaybeObject* JSObject::UpdateMapCodeCache(Name* name, Code* code) {
4474 return map()->UpdateCodeCache(name, code);
4754 // Do not generate permanent identity hash code if not requested.
4902 // hidden strings hash code is zero (and no other name has hash
4903 // code zero) it will always occupy the first entry if present.
4975 // hidden strings hash code is zero (and no other name has hash
4976 // code zero) it will always occupy the first entry if present.
6108 // caches which have a global property cell reference directly in the code.
6952 Handle<Code> code) {
6955 map->UpdateCodeCache(*name, *code));
6959 MaybeObject* Map::UpdateCodeCache(Name* name, Code* code) {
6960 ASSERT(!is_shared() || code->allowed_in_shared_map_code_cache());
6962 // Allocate the code cache if not present.
6971 // Update the code cache.
6972 return CodeCache::cast(code_cache())->Update(name, code);
6976 Object* Map::FindInCodeCache(Name* name, Code::Flags flags) {
6977 // Do a lookup if a code cache exists.
6986 int Map::IndexInCodeCache(Object* name, Code* code) {
6987 // Get the internal index if a code cache exists.
6989 return CodeCache::cast(code_cache())->GetIndex(name, code);
6995 void Map::RemoveFromCodeCache(Name* name, Code* code, int index) {
6997 // RemoveFromCodeCache so the code cache must be there.
6999 CodeCache::cast(code_cache())->RemoveByIndex(name, code, index);
7192 MaybeObject* CodeCache::Update(Name* name, Code* code) {
7196 if (code->type() == Code::NORMAL) {
7197 // Make sure that a hash table is allocated for the normal load code cache.
7207 return UpdateNormalTypeCache(name, code);
7210 return UpdateDefaultCache(name, code);
7215 MaybeObject* CodeCache::UpdateDefaultCache(Name* name, Code* code) {
7216 // When updating the default code cache we disregard the type encoded in the
7219 Code::Flags flags = Code::RemoveTypeFromFlags(code->flags());
7221 // First check whether we can update existing code cache without
7235 cache->set(i + kCodeCacheEntryCodeOffset, code);
7239 Code::Flags found =
7240 Code::cast(cache->get(i + kCodeCacheEntryCodeOffset))->flags();
7241 if (Code::RemoveTypeFromFlags(found) == flags) {
7242 cache->set(i + kCodeCacheEntryCodeOffset, code);
7248 // Reached the end of the code cache. If there were deleted
7252 cache->set(deleted_index + kCodeCacheEntryCodeOffset, code);
7256 // Extend the code cache with some new entries (at least one). Must be a
7266 // Add the (name, code) pair to the new cache.
7269 cache->set(length + kCodeCacheEntryCodeOffset, code);
7275 MaybeObject* CodeCache::UpdateNormalTypeCache(Name* name, Code* code) {
7279 { MaybeObject* maybe_new_cache = cache->Put(name, code);
7287 Object* CodeCache::Lookup(Name* name, Code::Flags flags) {
7288 if (Code::ExtractTypeFromFlags(flags) == Code::NORMAL) {
7296 Object* CodeCache::LookupDefaultCache(Name* name, Code::Flags flags) {
7305 Code* code = Code::cast(cache->get(i + kCodeCacheEntryCodeOffset));
7306 if (code->flags() == flags) {
7307 return code;
7315 Object* CodeCache::LookupNormalTypeCache(Name* name, Code::Flags flags) {
7325 int CodeCache::GetIndex(Object* name, Code* code) {
7326 if (code->type() == Code::NORMAL) {
7329 return cache->GetIndex(Name::cast(name), code->flags());
7335 if (array->get(i + kCodeCacheEntryCodeOffset) == code) return i + 1;
7341 void CodeCache::RemoveByIndex(Object* name, Code* code, int index) {
7342 if (code->type() == Code::NORMAL) {
7345 ASSERT(cache->GetIndex(Name::cast(name), code->flags()) == index);
7355 array->set_null(index); // Code.
7360 // The key in the code cache hash table consists of the property name and the
7361 // code object. The actual match is on the name and the code flags. If a key
7362 // is created using the flags and not a code object it can only be used for
7366 CodeCacheHashTableKey(Name* name, Code::Flags flags)
7369 Code* code)
7371 flags_(code->flags()),
7372 code_(code) { }
7379 Code::Flags flags = Code::cast(pair->get(1))->flags();
7386 static uint32_t NameFlagsHashHelper(Name* name, Code::Flags flags) {
7395 Code* code = Code::cast(pair->get(1));
7396 return NameFlagsHashHelper(name, code->flags());
7413 Code::Flags flags_;
7415 Code* code_;
7419 Object* CodeCacheHashTable::Lookup(Name* name, Code::Flags flags) {
7427 MaybeObject* CodeCacheHashTable::Put(Name* name, Code* code) {
7428 CodeCacheHashTableKey key(name, code);
7444 cache->set(EntryToIndex(entry) + 1, code);
7450 int CodeCacheHashTable::GetIndex(Name* name, Code::Flags flags) {
7468 Code::Flags flags,
7469 Handle<Code> code) {
7471 CALL_HEAP_FUNCTION_VOID(isolate, cache->Update(maps, flags, *code));
7476 Code::Flags flags,
7477 Code* code) {
7496 { MaybeObject* maybe_new_cache = hash_table->Put(maps, flags, code);
7505 Code::Flags flags) {
7619 Code* code) {
7632 cache->set(EntryToIndex(entry) + 1, code);
8667 // Fast check: if hash code is computed for both strings
8839 // Should only be called if hash code has not yet been computed.
8842 // Store the hash code in the object.
8846 // Check the hash code is there.
8887 Hash(); // force computation of hash code
9213 // the code entry.
9224 code()->optimizable());
9235 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable());
9253 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable());
9263 // break points were set, the code would point to the lazy-compile builtin.
9266 ASSERT(shared()->allows_lazy_compilation() || code()->optimizable());
9281 // Compile the source information to a code object.
9304 Handle<Code> code,
9308 shared->AddToOptimizedCodeMap(*native_context, *code, *literals));
9313 Code* code,
9315 ASSERT(code->kind() == Code::OPTIMIZED_FUNCTION);
9322 // No optimized code map.
9324 // Crate 3 entries per context {context, code, literals}.
9328 new_code_map->set(kEntriesStart + 1, code);
9339 new_code_map->set(old_length + 1, code);
9351 ASSERT(Code::cast(new_code_map->get(i + 1))->kind() ==
9352 Code::OPTIMIZED_FUNCTION);
9370 Code* code = Code::cast(code_map->get(index));
9371 ASSERT(code != NULL);
9373 function->ReplaceCode(code);
9381 // enqueued with code flushing and we remove it now.
9392 void SharedFunctionInfo::EvictFromOptimizedCodeMap(Code* optimized_code,
9401 if (Code::cast(code_map->get(i + 1)) == optimized_code) {
9403 PrintF("[evicting entry from optimizing code map (%s) for ", reason);
9443 function->ReplaceCode(function->shared()->code());
9475 Code* code = shared_info->code();
9476 if (code->kind() == Code::OPTIMIZED_FUNCTION) return true;
9478 if (code->kind() != Code::FUNCTION) return true;
9479 return code->optimizable();
9735 // Support function for printing the source code to a StringStream
9776 static bool IsCodeEquivalent(Code* code, Code* recompiled) {
9777 if (code->instruction_size() != recompiled->instruction_size()) return false;
9778 ByteArray* code_relocation = code->relocation_info();
9789 void SharedFunctionInfo::EnableDeoptimizationSupport(Code* recompiled) {
9792 Code* code = this->code();
9793 if (IsCodeEquivalent(code, recompiled)) {
9794 // Copy the deoptimization data from the recompiled code.
9795 code->set_deoptimization_data(recompiled->deoptimization_data());
9796 code->set_has_deoptimization_support(true);
9799 // old code, we have to replace it. We should try to avoid this
9810 // code as non-optimizable. The marker on the shared function info
9811 // is there because we flush non-optimized code thereby loosing the
9812 // non-optimizable information for the code. When the code is
9817 // Code should be the lazy compilation stub or else unoptimized. If the
9818 // latter, disable optimization for the code too.
9819 ASSERT(code()->kind() == Code::FUNCTION || code()->kind() == Code::BUILTIN);
9820 if (code()->kind() == Code::FUNCTION) {
9821 code()->set_optimizable(false);
9833 Code* unoptimized = code();
9910 code()->ClearInlineCaches();
9912 if (code()->kind() == Code::FUNCTION) {
9913 code()->set_profiler_ticks(0);
9918 code()->set_optimizable(true);
9982 PrintF("[didn't find optimized code in optimized code map for ");
10009 Object* target = Code::GetCodeFromTargetAddress(rinfo->target_address());
10012 CHECK_EQ(target, old_target); // VisitPointer doesn't change Code* *target.
10026 Object* code = Code::GetObjectFromEntryAddress(entry_address);
10027 Object* old_code = code;
10028 VisitPointer(&code);
10029 if (code != old_code) {
10030 Memory::Address_at(entry_address) = reinterpret_cast<Code*>(code)->entry();
10051 Object* target = Code::GetCodeFromTargetAddress(rinfo->call_address());
10054 CHECK_EQ(target, old_target); // VisitPointer doesn't change Code* *target.
10070 void Code::InvalidateRelocation() {
10075 void Code::Relocate(intptr_t delta) {
10083 void Code::CopyFrom(const CodeDesc& desc) {
10086 // copy code
10114 // rewrite code handles in inline cache targets to direct
10115 // pointers to the first instruction in the code object
10117 Code* code = Code::cast(*p);
10118 it.rinfo()->set_target_address(code->instruction_start(),
10131 // Locate the source position which is closest to the address in the code. This
10135 int Code::SourcePosition(Address pc) {
10139 // position. All the code needs to be considered as the sequence of the
10140 // instructions in the code does not necessarily follow the same order as the
10165 // Same as Code::SourcePosition above except it only looks for statement
10167 int Code::SourceStatementPosition(Address pc) {
10187 SafepointEntry Code::GetSafepointEntry(Address pc) {
10193 Object* Code::FindNthObject(int n, Map* match_map) {
10210 Map* Code::FindFirstMap() {
10216 void Code::ReplaceNthObject(int n,
10238 void Code::FindAllMaps(MapHandleList* maps) {
10250 void Code::ReplaceFirstMap(Map* replace_with) {
10255 Code* Code::FindFirstCode() {
10261 return Code::GetCodeFromTargetAddress(info->target_address());
10267 void Code::FindAllCode(CodeHandleList* code_list, int length) {
10275 Code* code = Code::GetCodeFromTargetAddress(info->target_address());
10276 ASSERT(code->kind() == Code::STUB);
10277 code_list->Add(Handle<Code>(code));
10283 Name* Code::FindFirstName() {
10296 void Code::ReplaceNthCell(int n, Cell* replace_with) {
10311 void Code::ClearInlineCaches() {
10318 Code* target(Code::GetCodeFromTargetAddress(info->target_address()));
10326 void Code::ClearTypeFeedbackCells(Heap* heap) {
10344 bool Code::allowed_in_shared_map_code_cache() {
10351 void Code::MakeCodeAgeSequenceYoung(byte* sequence) {
10356 void Code::MakeOlder(MarkingParity current_parity) {
10370 bool Code::IsOld() {
10380 byte* Code::FindCodeAgeSequence() {
10390 int Code::GetAge() {
10393 return Code::kNoAge;
10402 void Code::GetCodeAgeAndParity(Code* code, Age* age,
10406 Code* stub = NULL;
10409 if (code == stub) { \
10415 if (code == stub) { \
10426 Code* Code::GetCodeAgeStub(Age age, MarkingParity parity) {
10432 Code* stub = parity == EVEN_MARKING_PARITY \
10447 void Code::PrintDeoptLocation(int bailout_id) {
10469 bool Code::CanDeoptAt(Address pc) {
10482 // Identify kind of code.
10483 const char* Code::Kind2String(Kind kind) {
10555 Code::Kind stub_kind = static_cast<Code::Kind>(iterator.Next());
10675 const char* Code::ICState2String(InlineCacheState state) {
10691 const char* Code::StubType2String(StubType type) {
10706 void Code::PrintExtraICState(FILE* out, Kind kind, ExtraICState extra) {
10732 void Code::Disassemble(const char* name, FILE* out) {
11208 Handle<Code> code) {
11210 Handle<DependentCode>(dependent_code()), group, code);
11249 // we process embedded maps of an optimized code in one batch.
11284 Code* code) {
11293 set_object_at(i, code);
11344 bool DependentCode::Contains(DependencyGroup group, Code* code) {
11348 if (object_at(i) == code) return true;
11365 // Collect all the code to deoptimize.
11367 ZoneList<Code*> codes(end - start, &zone);
11370 Code* code = code_at(i);
11371 if (!code->marked_for_deoptimization()) codes.Add(code, &zone);
13314 // code computation, we use a combination of the hash of the
13315 // script source code and the start position of the calling scope.
13439 int chars_; // Caches the number of characters when computing the hash code.
13637 // to perform further lookups in code stubs (and significant performance
13638 // boost a certain style of code).
14553 // for code compiled with different settings.
15332 // Make sure the key object has an identity hash code.
15393 // Make sure the key object has an identity hash code.
15492 // Check if there is a break point at this code position.
15494 // Get the break point info object for this code position.
15498 // point info object there is no break point at this code
15504 // Get the break point info object for this code position.
15506 // Find the index of the break point info object for this code position.
15515 // Clear a break point at the specified code position.
15543 // Adding a new break point for a code position which did not have any
15583 // Get the break point objects for a code position.
15627 // Find the index of the break point info object for the specified code
15919 // embedded into code.
15967 void PropertyCell::AddDependentCode(Handle<Code> code) {
15970 DependentCode::kPropertyCellChangedGroup, code);