Lines Matching refs:Code
6 // * Redistributions of source code must retain the above copyright
177 // Reserve no more than 1/8 of the memory for the code range.
311 // and does not count available bytes already in the old space or code
375 PrintPID("Code space, used: %6" V8_PTR_PREFIX "d KB"
608 // Note: as weak callbacks can execute arbitrary code, we cannot
1151 // Visitor class to verify pointers in code or data space do not point into
1416 // Copy objects reachable from the code flushing candidates list.
2157 // We should explicitly record code entry slot for compaction because
2162 Code* code = Code::cast(Code::GetObjectFromEntryAddress(code_entry_slot));
2164 RecordCodeEntrySlot(code_entry_slot, code);
2330 // Scavenging code relies on the fact that new space object
2991 // gcc-4.4 has problem generating correct code of following snippet:
3114 // in JSObjects. The hash code has a special value so that it will not match
3117 // hash code in place. The hash code for the hidden_string is zero to ensure
3187 // Allocate cache for external strings pointing to native source code.
3621 Code* illegal = isolate_->builtins()->builtin(Builtins::kIllegal);
3625 Code* construct_stub =
3758 // can't use the fast case code for short ASCII strings below, but
3987 MaybeObject* Heap::LookupSingleCharacterStringFromCode(uint16_t code) {
3988 if (code <= String::kMaxOneByteCharCode) {
3989 Object* value = single_character_string_cache()->get(code);
3993 buffer[0] = static_cast<uint8_t>(code);
3999 single_character_string_cache()->set(code, result);
4008 answer->Set(0, code);
4091 Code::Flags flags,
4095 // Allocate ByteArray before the Code object, so that we do not risk
4096 // leaving uninitialized Code object (and breaking the heap).
4103 int obj_size = Code::SizeFor(body_size);
4106 // Large code objects and code objects which should stay at a fixed address
4120 // Discard the first code allocation, which was on a page where it could be
4129 Code* code = Code::cast(result);
4131 isolate_->code_range()->contains(code->address()));
4132 code->set_instruction_size(desc.instr_size);
4133 code->set_relocation_info(reloc_info);
4134 code->set_flags(flags);
4135 if (code->is_call_stub() || code->is_keyed_call_stub()) {
4136 code->set_check_type(RECEIVER_MAP_CHECK);
4138 code->set_is_crankshafted(crankshafted);
4139 code->set_deoptimization_data(empty_fixed_array(), SKIP_WRITE_BARRIER);
4140 code->InitializeTypeFeedbackInfoNoWriteBarrier(undefined_value());
4141 code->set_handler_table(empty_fixed_array(), SKIP_WRITE_BARRIER);
4142 code->set_gc_metadata(Smi::FromInt(0));
4143 code->set_ic_age(global_ic_age_);
4144 code->set_prologue_offset(kPrologueOffsetNotSet);
4145 if (code->kind() == Code::OPTIMIZED_FUNCTION) {
4146 code->set_marked_for_deoptimization(false);
4148 // Allow self references to created code object by patching the handle to
4149 // point to the newly allocated Code object.
4151 *(self_reference.location()) = code;
4153 // Migrate generated code.
4154 // The generated code can contain Object** values (typically from handles)
4156 // objects. These pointers can include references to the code object itself,
4158 code->CopyFrom(desc);
4162 code->Verify();
4165 return code;
4169 MaybeObject* Heap::CopyCode(Code* code) {
4170 // Allocate an object the same size as the code object.
4171 int obj_size = code->Size();
4182 // Copy code object.
4183 Address old_addr = code->address();
4187 Code* new_code = Code::cast(result);
4189 isolate_->code_range()->contains(code->address()));
4195 MaybeObject* Heap::CopyCode(Code* code, Vector<byte> reloc_info) {
4196 // Allocate ByteArray before the Code object, so that we do not risk
4197 // leaving uninitialized Code object (and breaking the heap).
4206 int new_body_size = RoundUp(code->instruction_size(), kObjectAlignment);
4208 int new_obj_size = Code::SizeFor(new_body_size);
4210 Address old_addr = code->address();
4213 static_cast<size_t>(code->instruction_end() - old_addr);
4225 // Copy code object.
4231 Code* new_code = Code::cast(result);
4241 isolate_->code_range()->contains(code->address()));
4246 code->Verify();
4299 function->set_code(shared->code());
4467 // verification code has to cope with (temporarily) invalid objects. See
4669 // TODO(mvstanton): this body of code is duplicate with AllocateJSArrayStorage
6018 // the code space.
6019 // TODO(ulan): Once we enable code compaction for incremental marking,
6076 // compilation cache to avoid hanging on to source code and
6077 // generated code for cached functions.
6116 PrintF(">>>>>> Code Stats (%s) >>>>>>\n", title);
6118 // We do not look for code in new space, map space, or old space. If code
6149 PrintF("Code space : ");
6524 // We only have code, sequential strings, or fixed arrays in large
6594 // Iterate over the builtin code objects and code stubs in the
6595 // heap. Note that it is not necessary to iterate over code objects
6629 // Iterate over the pointers the Serialization/Deserialization code is
6671 // of memory for each semispace because code in the snapshot has
6672 // write-barrier code that relies on the size and alignment of new
6845 // Initialize the code space, set its maximum capacity to the old
6847 // On 64-bit platform(s), we put all code objects in a 2 GB range of
6876 // The large object code space may contain code or data. We set the memory
6878 // explicitly when allocating large code objects.
8019 index = FIRST_CODE_KIND_SUB_TYPE + Code::name; \