Ignore:
Timestamp:
Sep 11, 2014, 1:52:22 AM (11 years ago)
Author:
[email protected]
Message:

[JavaScriptCore] Fix FTL on platform EFL.
https://bugs.webkit.org/show_bug.cgi?id=133571

Reviewed by Filip Pizlo.

.:

Revert r169181.

  • Source/cmake/FindLIBCXXABI.cmake: Removed.
  • Source/cmake/OptionsEfl.cmake:

Source/JavaScriptCore:

There are no compact_unwind sections on Linux systems so FTL crashes.
We have to parse eh_frame in FTLUnwindInfo instead of compact_unwind
and get the information for stack unwinding from there.

  • CMakeLists.txt: Revert r169181.
  • ftl/FTLCompile.cpp:

Change section name literals to use SECTION_NAME macro, because of architecture differencies.
(JSC::FTL::mmAllocateCodeSection):
(JSC::FTL::mmAllocateDataSection):
(JSC::FTL::compile):

  • ftl/FTLJITCode.h:

We need the SECTION_NAME macro in FTLCompile and FTLLink, so we define it here.

  • ftl/FTLLink.cpp:

(JSC::FTL::link):

  • ftl/FTLState.h:
  • ftl/FTLState.cpp:

(JSC::FTL::State::State):

  • ftl/FTLUnwindInfo.h:
  • ftl/FTLUnwindInfo.cpp:

Lift the eh_frame parsing method from LLVM/libcxxabi project and modify it for our purposes.
Parse eh_frame on Linux instead of compact_unwind.
(JSC::FTL::UnwindInfo::parse):

Tools:

  • efl/install-dependencies: Revert r169181.
  • efl/jhbuild.modules: Clone and build a custom branch.

This branch contains some fix for FTL of platform EFL.
The branch is a fork of llvm r206311.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ftl/FTLCompile.cpp

    r173213 r173509  
    11/*
    22 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
     3 * Copyright (C) 2014 Samsung Electronics
     4 * Copyright (C) 2014 University of Szeged
    35 *
    46 * Redistribution and use in source and binary forms, with or without
     
    6264    // LLVM used to put __compact_unwind in a code section. We keep this here defensively,
    6365    // for clients that use older LLVMs.
    64     if (!strcmp(sectionName, "__compact_unwind")) {
    65         state.compactUnwind = result->start();
    66         state.compactUnwindSize = result->sizeInBytes();
     66    if (!strcmp(sectionName, SECTION_NAME("compact_unwind"))) {
     67        state.unwindDataSection = result->start();
     68        state.unwindDataSectionSize = result->sizeInBytes();
    6769    }
    6870   
     
    8183
    8284    // Allocate the GOT in the code section to make it reachable for all code.
    83     if (!strcmp(sectionName, "__got"))
     85    if (!strcmp(sectionName, SECTION_NAME("got")))
    8486        return mmAllocateCodeSection(opaqueState, size, alignment, sectionID, sectionName);
    8587
     
    8890    RefPtr<DataSection> section = adoptRef(new DataSection(size, alignment));
    8991
    90     if (!strcmp(sectionName, "__llvm_stackmaps"))
     92    if (!strcmp(sectionName, SECTION_NAME("llvm_stackmaps")))
    9193        state.stackmapsSection = section;
    9294    else {
    9395        state.jitCode->addDataSection(section);
    9496        state.dataSectionNames.append(sectionName);
    95         if (!strcmp(sectionName, "__compact_unwind")) {
    96             state.compactUnwind = section->base();
    97             state.compactUnwindSize = size;
     97#if OS(DARWIN)
     98        if (!strcmp(sectionName, SECTION_NAME("compact_unwind"))) {
     99#elif OS(LINUX)
     100        if (!strcmp(sectionName, SECTION_NAME("eh_frame"))) {
     101#endif
     102            state.unwindDataSection = section->base();
     103            state.unwindDataSectionSize = size;
    98104        }
    99105    }
     
    718724   
    719725    bool didSeeUnwindInfo = state.jitCode->unwindInfo.parse(
    720         state.compactUnwind, state.compactUnwindSize, state.generatedFunction);
     726        state.unwindDataSection, state.unwindDataSectionSize,
     727        state.generatedFunction);
    721728    if (shouldShowDisassembly()) {
    722729        dataLog("Unwind info for ", CodeBlockWithJITType(state.graph.m_codeBlock, JITCode::FTLJIT), ":\n");
     
    752759        if (shouldShowDisassembly()) {
    753760            for (unsigned i = 0; i < state.jitCode->handles().size(); ++i) {
    754                 if (state.codeSectionNames[i] != "__text")
     761                if (state.codeSectionNames[i] != SECTION_NAME("text"))
    755762                    continue;
    756763               
Note: See TracChangeset for help on using the changeset viewer.