Home | History | Annotate | Download | only in src

Lines Matching defs:code

6 //     * Redistributions of source code must retain the above copyright
516 // Compile the code.
519 ASSERT(!info.code().is_null());
520 tracker.RecordRootFunctionInfo(info.code());
590 // from JavaScript. It contains Code object, which is kept wrapped
606 void SetFunctionCode(Handle<Code> function_code,
624 Handle<Code> GetFunctionCode() {
627 return Handle<Code>::cast(raw_result);
725 // Saves only function code, because for a script function we
727 void FunctionCode(Handle<Code> function_code) {
734 // Saves full information about a function: its code, its scope info
743 info.SetFunctionCode(Handle<Code>(shared->code()),
852 // Visitor that collects all references to a particular code object,
853 // including "CODE_TARGET" references in other code objects.
857 explicit ReferenceCollectorVisitor(Code* original)
870 if (Code::GetObjectFromEntryAddress(entry) == original_) {
877 Code::GetCodeFromTargetAddress(rinfo->target_address()) == original_) {
888 void Replace(Code* substitution) {
903 Code* original_;
911 static void ReplaceCodeObject(Code* original, Code* substitution) {
921 // Iterate over all roots. Stack frames may have pointer into original code,
939 // Check whether the code is natural function code (not a lazy-compile stub
940 // code).
941 static bool IsJSFunctionCode(Code* code) {
942 return code->kind() == Code::FUNCTION;
946 // Returns true if an instance of candidate were inlined into function's code.
950 if (function->code()->kind() != Code::OPTIMIZED_FUNCTION) return false;
953 DeoptimizationInputData::cast(function->code()->deoptimization_data());
1015 if (IsJSFunctionCode(shared_info->code())) {
1016 Handle<Code> code = compile_info_wrapper.GetFunctionCode();
1017 ReplaceCodeObject(shared_info->code(), *code);
1026 Handle<Code> new_original_code =
1108 // Auto-growing buffer for writing relocation info code section. This buffer
1183 // Patch positions in code (changes relocation info section) and possibly
1184 // returns new instance of code.
1185 static Handle<Code> PatchPositionsInCode(Handle<Code> code,
1188 RelocInfoBuffer buffer_writer(code->relocation_size(),
1189 code->instruction_start());
1193 for (RelocIterator it(*code); !it.done(); it.next()) {
1211 if (buffer.length() == code->relocation_size()) {
1212 // Simply patch relocation area of code.
1213 memcpy(code->relocation_start(), buffer.start(), buffer.length());
1214 return code;
1217 // rewrite it inside code object. Instead we have to create a new
1218 // code object.
1219 Handle<Code> result(FACTORY->CopyCode(code, buffer));
1247 if (IsJSFunctionCode(info->code())) {
1248 // Patch relocation info section of the code.
1249 Handle<Code> patched_code = PatchPositionsInCode(Handle<Code>(info->code()),
1251 if (*patched_code != info->code()) {
1252 // Replace all references to the code across the heap. In particular,
1253 // some stubs may refer to this code and this code may be being executed
1254 // on stack (it is safe to substitute the code object on stack, because
1257 ReplaceCodeObject(info->code(), *patched_code);
1321 for (RelocIterator it(parent_shared->code()); !it.done(); it.next()) {
1400 Code* pre_top_frame_code = pre_top_frame->LookupCode();
1412 // OK, we can drop our own code.
1414 } else if (pre_top_frame_code->kind() == Code::STUB &&
1437 Handle<Code> code = Isolate::Current()->builtins()->FrameDropper_LiveEdit();
1438 top_frame->set_pc(code->entry());
1442 Debug::SetUpFrameDropperFrame(bottom_js_frame, code);
1653 void LiveEditFunctionTracker::RecordRootFunctionInfo(Handle<Code> code) {
1654 isolate_->active_function_info_listener()->FunctionCode(code);
1681 void LiveEditFunctionTracker::RecordRootFunctionInfo(Handle<Code> code) {