-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(#61): Start on x86-64 JIT backend
This change adds the fundamentals for a x86-64 JIT backend which translates the Brainfuck instruction list onto x86-64 instructions.
- Loading branch information
1 parent
1833d5e
commit 10d1266
Showing
5 changed files
with
411 additions
and
2 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
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,31 @@ | ||
/* | ||
* Copyright 2016 Fabian Mastenbroek | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
#ifndef JIT_H | ||
#define JIT_H | ||
|
||
#define BRAINFUCK_EUNAVAILABLE 2 /**< Feature not implemented or unavailable */ | ||
|
||
/** | ||
* Execute the given list of instructions using a Just-in-Time compiler. | ||
* | ||
* @param root The first in the list of instructions. | ||
* @param context The context within the execution takes place. | ||
* @return A negative non-zero integer to indicate a failure, zero on success. | ||
*/ | ||
int brainfuck_execute_jit(struct BrainfuckInstruction *, | ||
struct BrainfuckExecutionContext *); | ||
|
||
#endif /* JIT_H */ |
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,30 @@ | ||
/* | ||
* Copyright 2016 Fabian Mastenbroek | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include <jit.h> | ||
|
||
/** | ||
* Execute the given list of instructions using a Just-in-Time compiler. | ||
* | ||
* @param root The first in the list of instructions. | ||
* @param context The context within the execution takes place. | ||
* @return A negative non-zero integer to indicate a failure, zero on success. | ||
*/ | ||
int brainfuck_execute_jit(BrainfuckInstruction *root, | ||
BrainfuckExecutionContext *context) | ||
{ | ||
return BRAINFUCK_EUNAVAILABLE; | ||
} |
Oops, something went wrong.