Home | History | Annotate | Download | only in src

Lines Matching refs:Code

6 //     * Redistributions of source code must retain the above copyright
1255 accumulator->Add("<Code>");
1374 reinterpret_cast<Code*>(this)->CodeIterateBody(v);
2835 // Code will be set on the JavaScript side.
3004 // present, add it with attributes NONE. This code is an exact clone of
3289 Handle<Code> code) {
3292 object->UpdateMapCodeCache(*name, *code));
3296 MaybeObject* JSObject::UpdateMapCodeCache(String* name, Code* code) {
3310 return map()->UpdateCodeCache(name, code);
3592 // Do not generate permanent identity hash code if not requested.
3724 // hidden symbols hash code is zero (and no other string has hash
3725 // code zero) it will always occupy the first entry if present.
3773 // hidden symbols hash code is zero (and no other string has hash
3774 // code zero) it will always occupy the first entry if present.
4521 // caches which have a global property cell reference directly in the code.
4842 Handle<Code> code) {
4845 map->UpdateCodeCache(*name, *code));
4848 MaybeObject* Map::UpdateCodeCache(String* name, Code* code) {
4849 // Allocate the code cache if not present.
4858 // Update the code cache.
4859 return CodeCache::cast(code_cache())->Update(name, code);
4863 Object* Map::FindInCodeCache(String* name, Code::Flags flags) {
4864 // Do a lookup if a code cache exists.
4873 int Map::IndexInCodeCache(Object* name, Code* code) {
4874 // Get the internal index if a code cache exists.
4876 return CodeCache::cast(code_cache())->GetIndex(name, code);
4882 void Map::RemoveFromCodeCache(String* name, Code* code, int index) {
4884 // RemoveFromCodeCache so the code cache must be there.
4886 CodeCache::cast(code_cache())->RemoveByIndex(name, code, index);
5107 MaybeObject* CodeCache::Update(String* name, Code* code) {
5111 if (code
5112 // Make sure that a hash table is allocated for the normal load code cache.
5121 return UpdateNormalTypeCache(name, code);
5124 return UpdateDefaultCache(name, code);
5129 MaybeObject* CodeCache::UpdateDefaultCache(String* name, Code* code) {
5130 // When updating the default code cache we disregard the type encoded in the
5133 Code::Flags flags = Code::RemoveTypeFromFlags(code->flags());
5135 // First check whether we can update existing code cache without
5149 cache->set(i + kCodeCacheEntryCodeOffset, code);
5153 Code::Flags found =
5154 Code::cast(cache->get(i + kCodeCacheEntryCodeOffset))->flags();
5155 if (Code::RemoveTypeFromFlags(found) == flags) {
5156 cache->set(i + kCodeCacheEntryCodeOffset, code);
5162 // Reached the end of the code cache. If there were deleted
5166 cache->set(deleted_index + kCodeCacheEntryCodeOffset, code);
5170 // Extend the code cache with some new entries (at least one). Must be a
5180 // Add the (name, code) pair to the new cache.
5183 cache->set(length + kCodeCacheEntryCodeOffset, code);
5189 MaybeObject* CodeCache::UpdateNormalTypeCache(String* name, Code* code) {
5193 { MaybeObject* maybe_new_cache = cache->Put(name, code);
5201 Object* CodeCache::Lookup(String* name, Code::Flags flags) {
5202 if (Code::ExtractTypeFromFlags(flags) == NORMAL) {
5210 Object* CodeCache::LookupDefaultCache(String* name, Code::Flags flags) {
5219 Code* code = Code::cast(cache->get(i + kCodeCacheEntryCodeOffset));
5220 if (code->flags() == flags) {
5221 return code;
5229 Object* CodeCache::LookupNormalTypeCache(String* name, Code::Flags flags) {
5239 int CodeCache::GetIndex(Object* name, Code* code) {
5240 if (code->type() == NORMAL) {
5243 return cache->GetIndex(String::cast(name), code->flags());
5249 if (array->get(i + kCodeCacheEntryCodeOffset) == code) return i + 1;
5255 void CodeCache::RemoveByIndex(Object* name, Code* code, int index) {
5256 if (code->type() == NORMAL) {
5259 ASSERT(cache->GetIndex(String::cast(name), code->flags()) == index);
5269 array->set_null(index); // Code.
5274 // The key in the code cache hash table consists of the property name and the
5275 // code object. The actual match is on the name and the code flags. If a key
5276 // is created using the flags and not a code object it can only be used for
5280 CodeCacheHashTableKey(String* name, Code::Flags flags)
5283 CodeCacheHashTableKey(String* name, Code* code)
5285 flags_(code->flags()),
5286 code_(code) { }
5293 Code::Flags flags = Code::cast(pair->get(1))->flags();
5300 static uint32_t NameFlagsHashHelper(String* name, Code::Flags flags) {
5309 Code* code = Code::cast(pair->get(1));
5310 return NameFlagsHashHelper(name, code->flags());
5327 Code::Flags flags_;
5329 Code* code_;
5333 Object* CodeCacheHashTable::Lookup(String* name, Code::Flags flags) {
5341 MaybeObject* CodeCacheHashTable::Put(String* name, Code* code) {
5342 CodeCacheHashTableKey key(name, code);
5358 cache->set(EntryToIndex(entry) + 1, code);
5364 int CodeCacheHashTable::GetIndex(String* name, Code::Flags flags) {
5382 Code::Flags flags,
5383 Handle<Code> code) {
5385 CALL_HEAP_FUNCTION_VOID(isolate, cache->Update(maps, flags, *code));
5390 Code::Flags flags,
5391 Code* code) {
5409 { MaybeObject* maybe_new_cache = hash_table->Put(maps, flags, code);
5418 Code::Flags flags) {
5532 Code* code) {
5545 cache->set(EntryToIndex(entry) + 1, code);
5912 // Found an element with the same hash-code.
6867 // Fast check: if hash code is computed for both strings
7017 // Should only be called if hash code has not yet been computed.
7022 // Compute the hash code.
7037 // Store the hash code in the object.
7040 // Check the hash code is there.
7080 Hash(); // force computation of hash code
7373 // the code entry.
7383 code()->optimizable());
7397 // Compile the source information to a code object.
7420 function->ReplaceCode(function->shared()->code());
7446 Code* code = shared_info->code();
7447 if (code->kind() == Code::OPTIMIZED_FUNCTION) return true;
7449 if (code->kind() != Code::FUNCTION) return true;
7450 return code->optimizable();
7604 // Check the basic conditions for generating inline constructor code.
7702 // Support function for printing the source code to a StringStream
7743 static bool IsCodeEquivalent(Code* code, Code* recompiled) {
7744 if (code->instruction_size() != recompiled->instruction_size()) return false;
7745 ByteArray* code_relocation = code->relocation_info();
7756 void SharedFunctionInfo::EnableDeoptimizationSupport(Code* recompiled) {
7759 Code* code = this->code();
7760 if (IsCodeEquivalent(code, recompiled)) {
7761 // Copy the deoptimization data from the recompiled code.
7762 code->set_deoptimization_data(recompiled->deoptimization_data());
7763 code->set_has_deoptimization_support(true);
7766 // old code, we have to replace it. We should try to avoid this
7777 // code as non-optimizable. The marker on the shared function info
7778 // is there because we flush non-optimized code thereby loosing the
7779 // non-optimizable information for the code. When the code is
7784 // Code should be the lazy compilation stub or else unoptimized. If the
7785 // latter, disable optimization for the code too.
7786 ASSERT(code()->kind() == Code::FUNCTION || code()->kind() == Code::BUILTIN);
7787 if (code()->kind() == Code::FUNCTION) {
7788 code()->set_optimizable(false);
7798 Code* unoptimized = code();
7875 code()->ClearInlineCaches();
7877 if (code()->kind() == Code::FUNCTION) {
7878 code()->set_profiler_ticks(0);
7883 code()->set_optimizable(true);
7957 Object* target = Code::GetCodeFromTargetAddress(rinfo->target_address());
7960 CHECK_EQ(target, old_target); // VisitPointer doesn't change Code* *target.
7965 Object* code = Code::GetObjectFromEntryAddress(entry_address);
7966 Object* old_code = code;
7967 VisitPointer(&code);
7968 if (code != old_code) {
7969 Memory::Address_at(entry_address) = reinterpret_cast<Code*>(code)->entry();
7990 Object* target = Code::GetCodeFromTargetAddress(rinfo->call_address());
7993 CHECK_EQ(target, old_target); // VisitPointer doesn't change Code* *target.
8006 void Code::InvalidateRelocation() {
8011 void Code::Relocate(intptr_t delta) {
8019 void Code::CopyFrom(const CodeDesc& desc) {
8022 // copy code
8046 // rewrite code handles in inline cache targets to direct
8047 // pointers to the first instruction in the code object
8049 Code* code = Code::cast(*p);
8050 it.rinfo()->set_target_address(code->instruction_start(),
8060 // Locate the source position which is closest to the address in the code. This
8064 int Code::SourcePosition(Address pc) {
8068 // position. All the code needs to be considered as the sequence of the
8069 // instructions in the code does not necessarily follow the same order as the
8094 // Same as Code::SourcePosition above except it only looks for statement
8096 int Code::SourceStatementPosition(Address pc) {
8116 SafepointEntry Code::GetSafepointEntry(Address pc) {
8122 void Code::SetNoStackCheckTable() {
8129 Map* Code::FindFirstMap() {
8142 void Code::ClearInlineCaches() {
8149 Code* target(Code::GetCodeFromTargetAddress(info->target_address()));
8297 // Identify kind of code.
8298 const char* Code::Kind2String(Kind kind) {
8320 const char* Code::ICState2String(InlineCacheState state) {
8335 const char* Code::PropertyType2String(PropertyType type) {
8353 void Code::PrintExtraICState(FILE* out, Kind kind, ExtraICState extra) {
8378 void Code::Disassemble(const char* name, FILE* out) {
10532 // code computation, we use a combination of the hash of the
10533 // script source code and the start position of the calling scope.
10658 int chars_; // Caches the number of characters when computing the hash code.
10899 // perform further lookups in code stubs (and significant performance boost
10900 // a certain style of code).
12496 // Make sure the key object has an identity hash code.
12557 // Make sure the key object has an identity hash code.
12604 // Check if there is a break point at this code position.
12606 // Get the break point info object for this code position.
12610 // point info object there is no break point at this code position.
12616 // Get the break point info object for this code position.
12618 // Find the index of the break point info object for this code position.
12627 // Clear a break point at the specified code position.
12653 // Adding a new break point for a code position which did not have any
12693 // Get the break point objects for a code position.
12737 // Find the index of the break point info object for the specified code