-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f6902a
commit fb56c0b
Showing
8 changed files
with
168 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
compilers=&v8 | ||
defaultCompiler=v8trunk | ||
|
||
group.v8.compilers=v8trunk:v8111 | ||
group.v8.isSemver=false | ||
group.v8.baseName=v8 | ||
|
||
compiler.v8trunk.exe=/opt/compiler-explorer/d8-trunk/out/x64.release/d8 | ||
compiler.v8trunk.options=--print-code --redirect-code-traces --allow-natives-syntax | ||
|
||
compiler.v8111.exe=/opt/compiler-explorer/d8-11.1/out/x64.release/d8 | ||
compiler.v8111.options=--print-code --redirect-code-traces --allow-natives-syntax | ||
|
||
supportsBinary=false | ||
interpreted=true | ||
compilerType=v8 | ||
objdumper= | ||
demangler= | ||
postProcess= | ||
options= | ||
supportsExecute=false | ||
stubText= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:v8111 | ||
group.v8.isSemver=false | ||
group.v8.baseName=v8 | ||
|
||
compiler.v8trunk.exe=d8 | ||
compiler.v8trunk.options=--print-code --redirect-code-traces --allow-natives-syntax | ||
|
||
compiler.v8111.exe=d8 | ||
compiler.v8111.options=--print-code --redirect-code-traces --allow-natives-syntax | ||
|
||
supportsBinary=false | ||
interpreted=true | ||
compilerType=v8 | ||
objdumper= | ||
demangler= | ||
postProcess= | ||
options= | ||
supportsExecute=false | ||
stubText= | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function square(a) { | ||
let result = a * a; | ||
return result; | ||
} | ||
|
||
// Call function once to fill type information | ||
square(23, 2); | ||
|
||
// Call function again to go from uninitialized -> pre-monomorphic -> monomorphic | ||
square(13, 43); | ||
%OptimizeFunctionOnNextCall(square); | ||
square(71, 19); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.