Home | History | Annotate | Download | only in src

Lines Matching refs:Code

6 //     * Redistributions of source code must retain the above copyright
48 // so code pages don't need PROT_EXEC.
96 Code* DeoptimizerData::FindDeoptimizingCode(Address addr) {
100 if (node->code()->contains(addr)) return *node->code();
106 void DeoptimizerData::RemoveDeoptimizingCode(Code* code) {
110 if (*cur->code() == code) {
120 // Deoptimizing code is removed through weak callback. Each object is expected
126 // We rely on this function not causing a GC. It is called from generated code
194 // Get the function and code from the frame.
196 Code* code = frame->LookupCode();
198 // Locate the deoptimization point in the code. As we are at a call the
199 // return address must be at a place in the code with deoptimization support.
200 SafepointEntry safepoint_entry = code->GetSafepointEntry(frame->pc());
206 unsigned stack_slots = code->stack_slots();
215 code);
334 // function list of the given context and adds their code to the list of
335 // code objects to be deoptimized.
338 ZoneList<Code*>* codes,
351 // Extract this function from the context's list and remember the code.
352 Code* code = function->code();
353 ASSERT(code->kind() == Code::OPTIMIZED_FUNCTION);
354 if (code->marked_for_deoptimization()) {
355 ASSERT(codes->Contains(code));
357 code->set_marked_for_deoptimization(true);
358 codes->Add(code, zone);
361 // Replace the function's code with the shared code.
362 function->set_code(shared->code());
363 // Evict the code from the optimized code map.
364 shared->EvictFromOptimizedCodeMap(code, "deoptimized function");
400 explicit DeoptimizeWithMatchingCodeFilter(Code* code) : code_(code) {}
402 return function->code() == code_;
405 Code* code_;
412 return function->code()->marked_for_deoptimization();
445 Code* code = function->code();
446 if (code->kind() != Code::OPTIMIZED_FUNCTION) return;
447 DeoptimizeWithMatchingCodeFilter filter(code);
459 ZoneList<Code*> codes(4, &zone);
480 void Deoptimizer::DeoptimizeCodeList(Isolate* isolate, ZoneList<Code*>* codes) {
483 // Mark the code; any functions refering to this code will be selected.
490 // code from the optimized function lists.
497 // Note that selecting code unlinks the functions that refer to it.
502 // Now deoptimize all the code.
509 void Deoptimizer::DeoptimizeCode(Isolate* isolate, Code* code) {
513 // Do platform-specific patching of the optimized code.
514 PatchCodeForDeoptimization(isolate, code);
516 // Add the deoptimizing code to the list.
517 DeoptimizingCodeListNode* node = new DeoptimizingCodeListNode(code);
523 // Tell collector to treat this code object in a special way and
525 isolate->heap()->mark_compact_collector()->InvalidateCode(code);
536 data->RemoveDeoptimizingCode(*node->code());
589 Code* optimized_code)
644 Code* Deoptimizer::FindOptimizedCode(JSFunction* function,
645 Code* optimized_code) {
650 Code* compiled_code =
653 ? static_cast<Code*>(isolate_->FindCodeObject(from_))
659 // function. The return address (from_) points to unoptimized code.
660 Code* compiled_code = function->code();
661 ASSERT(compiled_code->kind() == Code::OPTIMIZED_FUNCTION);
678 PrintF("%s", Code::Kind2String(compiled_code_->kind()));
755 // Print the source code if available.
778 // We rely on this function not causing a GC. It is called from generated code
789 compiled_code_->kind() == Code::OPTIMIZED_FUNCTION) {
944 top_address = input_->GetRegister(fp_reg.code()) - (2 * kPointerSize) -
968 // function code and AST id of the bailout.
997 ASSERT(!is_bottommost || (input_->GetRegister(fp_reg.code()) +
1000 if (is_topmost) output_frame->SetRegister(fp_reg.code(), fp_value);
1022 if (is_topmost) output_frame->SetRegister(context_reg.code(), value);
1051 Code* non_optimized_code = function->shared()->code();
1067 Code* continuation = builtins->builtin(Builtins::kNotifyDeoptimized);
1173 Code* adaptor_trampoline =
1185 Code* construct_stub = builtins->builtin(Builtins::kJSConstructStubGeneric);
1276 V8PRIxPTR " ; code object\n",
1338 // StackFrame::INTERNAL (FP, context, frame type, code object, see
1407 // Get Code object from accessor stub.
1412 Code* accessor_stub = isolate_->builtins()->builtin(name);
1417 " ; code object\n",
1477 compiled_code_->kind() != Code::OPTIMIZED_FUNCTION);
1509 intptr_t top_address = input_->GetRegister(fp_reg.code()) -
1529 intptr_t frame_ptr = input_->GetRegister(fp_reg.code());
1530 output_frame->SetRegister(fp_reg.code(), frame_ptr);
1542 output_frame->SetRegister(context_reg.code(), value);
1635 Code* trampoline = NULL;
1643 Code* notify_failure =
2566 // Optimized code assumes that the argument object has not been
2580 void Deoptimizer::PatchInterruptCode(Code* unoptimized_code,
2581 Code* interrupt_code,
2582 Code* replacement_code) {
2584 // call to an unconditional call to the replacement code.
2606 void Deoptimizer::RevertInterruptCode(Code* unoptimized_code,
2607 Code* interrupt_code,
2608 Code* replacement_code) {
2635 void Deoptimizer::VerifyInterruptCode(Code* unoptimized_code,
2636 Code* interrupt_code,
2637 Code* replacement_code,
2643 CHECK_LE(static_cast<int>(loop_depth), Code::kMaxLoopNestingMarker);
2665 // environment at the OSR entry. The code for that his built into
2667 } else if (compiled_code_->kind() == Code::OPTIMIZED_FUNCTION) {
2751 // references. This is fine because the deoptimizer's code section
2964 buffer_->Add(reg.code(), zone());
2970 buffer_->Add(reg.code(), zone());
2976 buffer_->Add(reg.code(), zone());
3106 DeoptimizingCodeListNode::DeoptimizingCodeListNode(Code* code): next_(NULL) {
3107 GlobalHandles* global_handles = code->GetIsolate()->global_handles();
3108 // Globalize the code object and make it weak.
3109 code_ = Handle<Code>::cast(global_handles->Create(code));
3282 // Get the source position using the unoptimized code.
3284 Code* code = Code::cast(deoptimizer->isolate()->FindCodeObject(pc));
3285 source_position_ = code->SourcePosition(pc);