-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* #82: Fixed strings, added loading of klasses * #82: make format * #94: corresponding cpp files * #94: Added commentary * #94: make format * #94: Removed Data, added `isObject` field * #94: getStringByStringPoolPos * #97: make format
- Loading branch information
1 parent
0a3f08c
commit 858ac6a
Showing
16 changed files
with
291 additions
and
30 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
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 @@ | ||
#pragma once | ||
|
||
#include <vector> | ||
|
||
#include "ChaiVM/interpreter/instruction.hpp" | ||
#include "ChaiVM/memory/linear-allocator.hpp" | ||
#include "ChaiVM/memory/linear-buffer.hpp" | ||
#include "ChaiVM/types.hpp" | ||
|
||
namespace chai::interpreter { | ||
|
||
struct Field { | ||
public: | ||
chai::interpreter::Immidiate name_; | ||
bool isObject_; | ||
}; | ||
|
||
struct Klass { | ||
public: | ||
chai::interpreter::Immidiate name_; | ||
std::vector<Field> fields_; | ||
|
||
chsize_t size(); | ||
}; | ||
|
||
} // namespace chai::interpreter |
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,30 @@ | ||
#pragma once | ||
|
||
#include "vector" | ||
#include <cstdint> | ||
|
||
#include "ChaiVM/interpreter/instruction.hpp" | ||
#include "ChaiVM/types.hpp" | ||
#include "ChaiVM/utils/io-bytes.hpp" | ||
|
||
namespace chai::utils::fileformat { | ||
|
||
enum FieldTag : uint8_t { I64 = 1, F64 = 2 }; | ||
|
||
struct FieldInfo { | ||
interpreter::Immidiate name_; | ||
uint8_t isObject_; | ||
interpreter::Immidiate tagOrKlassNum_; | ||
}; | ||
|
||
struct KlassInfo { | ||
interpreter::Immidiate name_; | ||
uint8_t nFields_; | ||
std::vector<FieldInfo> fields_; | ||
|
||
chai::interpreter::Immidiate addField(FieldInfo field); | ||
|
||
void dump(std::ofstream &ofs) const; | ||
}; | ||
|
||
} // namespace chai::utils::fileformat |
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
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,7 @@ | ||
#include "ChaiVM/interpreter/code-manager/klass.hpp" | ||
|
||
namespace chai::interpreter { | ||
|
||
chsize_t Klass::size() { return fields_.size(); } | ||
|
||
} // namespace chai::interpreter |
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
Oops, something went wrong.
858ac6a
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.
Puzzle
94-179b6abd
discovered ininclude/ChaiVM/utils/file-format/chai-file.hpp
) and submitted as #98. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.