Home | History | Annotate | Download | only in src

Lines Matching refs:Code

6 //     * Redistributions of source code must retain the above copyright
607 // Compile the code.
610 ASSERT(!info.code().is_null());
611 tracker.RecordRootFunctionInfo(info.code());
681 // from JavaScript. It contains Code object, which is kept wrapped
697 void SetFunctionCode(Handle<Code> function_code,
715 Handle<Code> GetFunctionCode() {
718 return Handle<Code>::cast(raw_result);
816 // Saves only function code, because for a script function we
818 void FunctionCode(Handle<Code> function_code) {
825 // Saves full information about a function: its code, its scope info
834 info.SetFunctionCode(Handle<Code>(shared->code()),
924 // Visitor that collects all references to a particular code object,
925 // including "CODE_TARGET" references in other code objects.
929 explicit ReferenceCollectorVisitor(Code* original)
942 if (Code::GetObjectFromEntryAddress(entry) == original_) {
949 Code::GetCodeFromTargetAddress(rinfo->target_address()) == original_) {
960 void Replace(Code* substitution) {
975 Code* original_;
983 static void ReplaceCodeObject(Code* original, Code* substitution) {
994 // Iterate over all roots. Stack frames may have pointer into original code,
1011 // Check whether the code is natural function code (not a lazy-compile stub
1012 // code).
1013 static bool IsJSFunctionCode(Code* code) {
1014 return code->kind() == Code::FUNCTION;
1018 // Returns true if an instance of candidate were inlined into function's code.
1022 if (function->code()->kind() != Code::OPTIMIZED_FUNCTION) return false;
1025 DeoptimizationInputData::cast(function->code()->deoptimization_data());
1089 if (IsJSFunctionCode(shared_info->code())) {
1090 Handle<Code> code = compile_info_wrapper.GetFunctionCode();
1091 ReplaceCodeObject(shared_info->code(), *code);
1100 Handle<Code> new_original_code =
1182 // Auto-growing buffer for writing relocation info code section. This buffer
1257 // Patch positions in code (changes relocation info section) and possibly
1258 // returns new instance of code.
1259 static Handle<Code> PatchPositionsInCode(
1260 Handle<Code> code,
1263 RelocInfoBuffer buffer_writer(code->relocation_size(),
1264 code->instruction_start());
1268 for (RelocIterator it(*code); !it.done(); it.next()) {
1286 if (buffer.length() == code->relocation_size()) {
1287 // Simply patch relocation area of code.
1288 memcpy(code->relocation_start(), buffer.start(), buffer.length());
1289 return code;
1292 // rewrite it inside code object. Instead we have to create a new
1293 // code object.
1294 Handle<Code> result(FACTORY->CopyCode(code, buffer));
1324 if (IsJSFunctionCode(info->code())) {
1325 // Patch relocation info section of the code.
1326 Handle<Code> patched_code = PatchPositionsInCode(Handle<Code>(info->code()),
1328 if (*patched_code != info->code()) {
1329 // Replace all references to the code across the heap. In particular,
1330 // some stubs may refer to this code and this code may be being executed
1331 // on stack (it is safe to substitute the code object on stack, because
1334 ReplaceCodeObject(info->code(), *patched_code);
1398 for (RelocIterator it(parent_shared->code()); !it.done(); it.next()) {
1477 Code* pre_top_frame_code = pre_top_frame->LookupCode();
1489 // OK, we can drop our own code.
1494 } else if (pre_top_frame_code->kind() == Code::STUB &&
1517 Handle<Code> code = Isolate::Current()->builtins()->FrameDropper_LiveEdit();
1518 top_frame->set_pc(code->entry());
1522 Debug::SetUpFrameDropperFrame(bottom_js_frame, code);
1734 void LiveEditFunctionTracker::RecordRootFunctionInfo(Handle<Code> code) {
1735 isolate_->active_function_info_listener()->FunctionCode(code);
1762 void LiveEditFunctionTracker::RecordRootFunctionInfo(Handle<Code> code) {