-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add d8 for disassembling javascript #4721
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
compilers=&v8 | ||
defaultCompiler=v8trunk | ||
|
||
group.v8.compilers=v8trunk:v8113 | ||
group.v8.isSemver=false | ||
group.v8.baseName=v8 | ||
|
||
compiler.v8trunk.exe=/opt/compiler-explorer/d8-trunk/d8 | ||
compiler.v8trunk.options=--print-opt-code --redirect-code-traces --allow-natives-syntax | ||
|
||
compiler.v8113.exe=/opt/compiler-explorer/d8-11.3/d8 | ||
compiler.v8113.options=--print-opt-code --redirect-code-traces --allow-natives-syntax | ||
|
||
supportsBinary=false | ||
interpreted=true | ||
compilerType=v8 | ||
objdumper= | ||
demangler= | ||
postProcess= | ||
options= | ||
supportsExecute=false | ||
stubText= |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Default settings for v8 | ||
|
||
compilers=&v8 | ||
defaultCompiler=v8trunk | ||
|
||
group.v8.compilers=v8trunk:v8113 | ||
group.v8.isSemver=false | ||
group.v8.baseName=v8 | ||
|
||
compiler.v8trunk.exe=d8 | ||
compiler.v8trunk.options=--print-opt-code --redirect-code-traces --allow-natives-syntax | ||
|
||
compiler.v8113.exe=d8 | ||
compiler.v8113.options=--print-opt-code --redirect-code-traces --allow-natives-syntax | ||
|
||
supportsBinary=false | ||
interpreted=true | ||
compilerType=v8 | ||
objdumper= | ||
demangler= | ||
postProcess= | ||
options= | ||
supportsExecute=false | ||
stubText= | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some extra whitespace here (I can remove it though) |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function square(a) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this file is misnamed: elsewhere you declare the suffix as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason I have named this file a You can see that it wants to ignore all the files in Javascript files can be named with the extension I thought this is an acceptable workaround to this dilemma. However if you want me to fix this in another way, please suggest how I should go about it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have updated the configuration in the language files to use the .mjs extension There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see any failing checks now. Please tell me if I am missing something. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks : I understand what happened here. This workaround works for me! |
||
let result = a * a; | ||
return result; | ||
} | ||
|
||
// Call function once to fill type information | ||
square(23); | ||
|
||
// Call function again to go from uninitialized -> pre-monomorphic -> monomorphic | ||
square(13); | ||
%OptimizeFunctionOnNextCall(square); | ||
square(71); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright (c) 2023, Compiler Explorer Authors | ||
// All rights reserved. | ||
// | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided that the following conditions are met: | ||
// | ||
// * Redistributions of source code must retain the above copyright notice, | ||
// this list of conditions and the following disclaimer. | ||
// * Redistributions in binary form must reproduce the above copyright | ||
// notice, this list of conditions and the following disclaimer in the | ||
// documentation and/or other materials provided with the distribution. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
// POSSIBILITY OF SUCH DAMAGE. | ||
|
||
import path from 'path'; | ||
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js'; | ||
import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js'; | ||
import {BaseCompiler} from '../base-compiler.js'; | ||
|
||
export class V8Compiler extends BaseCompiler { | ||
static get key() { | ||
return 'v8'; | ||
} | ||
|
||
constructor(compilerInfo: PreliminaryCompilerInfo, env) { | ||
super(compilerInfo, env); | ||
this.compiler.demangler = ''; | ||
this.demanglerClass = null; | ||
} | ||
|
||
override getIrOutputFilename(inputFilename: string, filters: ParseFiltersAndOutputOptions): string { | ||
return this.filename(path.dirname(inputFilename) + '/code.asm'); | ||
} | ||
|
||
public override getOutputFilename(dirPath: string, outputFilebase: string, key?: any) { | ||
let filename; | ||
if (key && key.backendOptions && key.backendOptions.customOutputFilename) { | ||
filename = key.backendOptions.customOutputFilename; | ||
} else { | ||
filename = 'code.asm'; | ||
} | ||
|
||
if (dirPath) { | ||
return path.join(dirPath, filename); | ||
} else { | ||
return filename; | ||
} | ||
} | ||
|
||
override optionsForFilter(filters: ParseFiltersAndOutputOptions, outputFilename: string) { | ||
return []; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I'll get this one installed too.