-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
language-server: support avm2 intrinsics when using AIR SDK (closes #727
- Loading branch information
1 parent
4317ee2
commit d7bcdcd
Showing
16 changed files
with
660 additions
and
187 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
35 changes: 35 additions & 0 deletions
35
distribution/src/assembly/intrinsics/avm2/intrinsics/memory/lf32.as
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,35 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
package avm2.intrinsics.memory | ||
{ | ||
/** | ||
* Load 32 bit <code>float</code>. | ||
* | ||
* <p> | ||
* Load a 32 bit (IEEE 754), little-endian, float from global memory | ||
* and promote to 64 bit (IEEE 754) double/Number. | ||
* </p> | ||
* | ||
* <p> | ||
* The MOPS opcodes all access the backing store of the ByteArray represented | ||
* by the current app domain's <code>ApplicationDomain.domainMemory</code> property. | ||
* </p> | ||
* | ||
* <p> | ||
* Address ranges for accesses will be range checked using standard comparisons. | ||
* No address alignment is necessary. | ||
* </p> | ||
* | ||
* <p> | ||
* opcode <b>lf32</b> = <code>56</code> (<code>0x38</code>). | ||
* </p> | ||
* | ||
* @langversion 3.0 | ||
* @playerversion Flash 11.6 | ||
* @playerversion AIR 11.6 | ||
* | ||
* @throws RangeError Range check failures will result in an <code>InvalidRangeError</code> exception. | ||
*/ | ||
public native function lf32(addr:int):Number; | ||
} |
35 changes: 35 additions & 0 deletions
35
distribution/src/assembly/intrinsics/avm2/intrinsics/memory/lf64.as
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,35 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
package avm2.intrinsics.memory | ||
{ | ||
/** | ||
* Load 64 bit <code>float</code>. | ||
* | ||
* <p> | ||
* Load a 64 bit (IEEE 754), little-endian, float from global memory | ||
* and promote to 64 bit (IEEE 754) double/Number. | ||
* </p> | ||
* | ||
* <p> | ||
* The MOPS opcodes all access the backing store of the ByteArray represented | ||
* by the current app domain's <code>ApplicationDomain.domainMemory</code> property. | ||
* </p> | ||
* | ||
* <p> | ||
* Address ranges for accesses will be range checked using standard comparisons. | ||
* No address alignment is necessary. | ||
* </p> | ||
* | ||
* <p> | ||
* opcode <b>lf64</b> = <code>57</code> (<code>0x39</code>). | ||
* </p> | ||
* | ||
* @langversion 3.0 | ||
* @playerversion Flash 11.6 | ||
* @playerversion AIR 11.6 | ||
* | ||
* @throws RangeError Range check failures will result in an <code>InvalidRangeError</code> exception. | ||
*/ | ||
public native function lf64(addr:int):Number; | ||
} |
34 changes: 34 additions & 0 deletions
34
distribution/src/assembly/intrinsics/avm2/intrinsics/memory/li16.as
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,34 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
package avm2.intrinsics.memory | ||
{ | ||
/** | ||
* Load 16 bit <code>integer</code>. | ||
* | ||
* <p> | ||
* Load a 16 bit, little-endian, unsigned integer from global memory. | ||
* </p> | ||
* | ||
* <p> | ||
* The MOPS opcodes all access the backing store of the ByteArray represented | ||
* by the current app domain's <code>ApplicationDomain.domainMemory</code> property. | ||
* </p> | ||
* | ||
* <p> | ||
* Address ranges for accesses will be range checked using standard comparisons. | ||
* No address alignment is necessary. | ||
* </p> | ||
* | ||
* <p> | ||
* opcode <b>li16</b> = <code>54</code> (<code>0x36</code>). | ||
* </p> | ||
* | ||
* @langversion 3.0 | ||
* @playerversion Flash 11.6 | ||
* @playerversion AIR 11.6 | ||
* | ||
* @throws RangeError Range check failures will result in an <code>InvalidRangeError</code> exception. | ||
*/ | ||
public native function li16( addr:int ):int; | ||
} |
34 changes: 34 additions & 0 deletions
34
distribution/src/assembly/intrinsics/avm2/intrinsics/memory/li32.as
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,34 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
package avm2.intrinsics.memory | ||
{ | ||
/** | ||
* Load 32 bit <code>integer</code>. | ||
* | ||
* <p> | ||
* Load a 32 bit, little-endian, signed integer from global memory. | ||
* </p> | ||
* | ||
* <p> | ||
* The MOPS opcodes all access the backing store of the ByteArray represented | ||
* by the current app domain's <code>ApplicationDomain.domainMemory</code> property. | ||
* </p> | ||
* | ||
* <p> | ||
* Address ranges for accesses will be range checked using standard comparisons. | ||
* No address alignment is necessary. | ||
* </p> | ||
* | ||
* <p> | ||
* opcode <b>li32</b> = <code>55</code> (<code>0x37</code>). | ||
* </p> | ||
* | ||
* @langversion 3.0 | ||
* @playerversion Flash 11.6 | ||
* @playerversion AIR 11.6 | ||
* | ||
* @throws RangeError Range check failures will result in an <code>InvalidRangeError</code> exception. | ||
*/ | ||
public native function li32(addr:int):int; | ||
} |
34 changes: 34 additions & 0 deletions
34
distribution/src/assembly/intrinsics/avm2/intrinsics/memory/li8.as
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,34 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
package avm2.intrinsics.memory | ||
{ | ||
/** | ||
* Load 8 bit <code>integer</code>. | ||
* | ||
* <p> | ||
* Load a 8 bit, little-endian, unsigned integer from global memory. | ||
* </p> | ||
* | ||
* <p> | ||
* The MOPS opcodes all access the backing store of the ByteArray represented | ||
* by the current app domain's <code>ApplicationDomain.domainMemory</code> property. | ||
* </p> | ||
* | ||
* <p> | ||
* Address ranges for accesses will be range checked using standard comparisons. | ||
* No address alignment is necessary. | ||
* </p> | ||
* | ||
* <p> | ||
* opcode <b>li8</b> = <code>53</code> (<code>0x35</code>). | ||
* </p> | ||
* | ||
* @langversion 3.0 | ||
* @playerversion Flash 11.6 | ||
* @playerversion AIR 11.6 | ||
* | ||
* @throws RangeError Range check failures will result in an <code>InvalidRangeError</code> exception. | ||
*/ | ||
public native function li8(addr:int):int; | ||
} |
38 changes: 38 additions & 0 deletions
38
distribution/src/assembly/intrinsics/avm2/intrinsics/memory/sf32.as
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,38 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
package avm2.intrinsics.memory | ||
{ | ||
/** | ||
* Store 32 bit <code>float</code>. | ||
* | ||
* <p> | ||
* Store a 32 bit (IEEE 754) float to global memory. | ||
* </p> | ||
* | ||
* <p> | ||
* The input value is converted to Number using the equivalent of <code>convert_d</code>, | ||
* truncated to 32-bit float, then stored as four bytes in little-endian order. | ||
* </p> | ||
* | ||
* <p> | ||
* The MOPS opcodes all access the backing store of the ByteArray represented | ||
* by the current app domain's <code>ApplicationDomain.domainMemory</code> property. | ||
* </p> | ||
* | ||
* <p> | ||
* Address ranges for accesses will be range checked using standard comparisons. | ||
* </p> | ||
* | ||
* <p> | ||
* opcode <b>sf32</b> = <code>61</code> (<code>0x3D</code>). | ||
* </p> | ||
* | ||
* @langversion 3.0 | ||
* @playerversion Flash 11.6 | ||
* @playerversion AIR 11.6 | ||
* | ||
* @throws RangeError Range check failures will result in an <code>InvalidRangeError</code> exception. | ||
*/ | ||
public native function sf32(value:Number, addr:int):void; | ||
} |
38 changes: 38 additions & 0 deletions
38
distribution/src/assembly/intrinsics/avm2/intrinsics/memory/sf64.as
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,38 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
package avm2.intrinsics.memory | ||
{ | ||
/** | ||
* Store 64 bit <code>float</code>. | ||
* | ||
* <p> | ||
* Store a 64 bit (IEEE 754) float to global memory. | ||
* </p> | ||
* | ||
* <p> | ||
* The input value is converted to Number using the equivalent of <code>convert_d</code>, | ||
* then stored as eight bytes in little endian order. | ||
* </p> | ||
* | ||
* <p> | ||
* The MOPS opcodes all access the backing store of the ByteArray represented | ||
* by the current app domain's <code>ApplicationDomain.domainMemory</code> property. | ||
* </p> | ||
* | ||
* <p> | ||
* Address ranges for accesses will be range checked using standard comparisons. | ||
* </p> | ||
* | ||
* <p> | ||
* opcode <b>sf64</b> = <code>62</code> (<code>0x3E</code>). | ||
* </p> | ||
* | ||
* @langversion 3.0 | ||
* @playerversion Flash 11.6 | ||
* @playerversion AIR 11.6 | ||
* | ||
* @throws RangeError Range check failures will result in an <code>InvalidRangeError</code> exception. | ||
*/ | ||
public native function sf64(value:Number, addr:int):void; | ||
} |
38 changes: 38 additions & 0 deletions
38
distribution/src/assembly/intrinsics/avm2/intrinsics/memory/si16.as
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,38 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
package avm2.intrinsics.memory | ||
{ | ||
/** | ||
* Store 16 bit <code>integer</code>. | ||
* | ||
* <p> | ||
* Store a 16 bit integer to global memory. | ||
* </p> | ||
* | ||
* <p> | ||
* The value is converted to integer using the equivalent of <code>convert_i</code>, | ||
* then the least significant 16 bits are stored as two bytes in little-endian order. | ||
* </p> | ||
* | ||
* <p> | ||
* The MOPS opcodes all access the backing store of the ByteArray represented | ||
* by the current app domain's <code>ApplicationDomain.domainMemory</code> property. | ||
* </p> | ||
* | ||
* <p> | ||
* Address ranges for accesses will be range checked using standard comparisons. | ||
* </p> | ||
* | ||
* <p> | ||
* opcode <b>si16</b> = <code>59</code> (<code>0x3B</code>). | ||
* </p> | ||
* | ||
* @langversion 3.0 | ||
* @playerversion Flash 11.6 | ||
* @playerversion AIR 11.6 | ||
* | ||
* @throws RangeError Range check failures will result in an <code>InvalidRangeError</code> exception. | ||
*/ | ||
public native function si16(value:int, addr:int):void; | ||
} |
38 changes: 38 additions & 0 deletions
38
distribution/src/assembly/intrinsics/avm2/intrinsics/memory/si32.as
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,38 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
package avm2.intrinsics.memory | ||
{ | ||
/** | ||
* Store 32 bit <code>integer</code>. | ||
* | ||
* <p> | ||
* Store a 32 bit integer to global memory. | ||
* </p> | ||
* | ||
* <p> | ||
* The value is converted to integer using the equivalent of <code>convert_i</code>, | ||
* then the 32 bits are stored as four bytes in little-endian order. | ||
* </p> | ||
* | ||
* <p> | ||
* The MOPS opcodes all access the backing store of the ByteArray represented | ||
* by the current app domain's <code>ApplicationDomain.domainMemory</code> property. | ||
* </p> | ||
* | ||
* <p> | ||
* Address ranges for accesses will be range checked using standard comparisons. | ||
* </p> | ||
* | ||
* <p> | ||
* opcode <b>si32</b> = <code>60</code> (<code>0x3C</code>). | ||
* </p> | ||
* | ||
* @langversion 3.0 | ||
* @playerversion Flash 11.6 | ||
* @playerversion AIR 11.6 | ||
* | ||
* @throws RangeError Range check failures will result in an <code>InvalidRangeError</code> exception. | ||
*/ | ||
public native function si32(value:int, addr:int):void; | ||
} |
38 changes: 38 additions & 0 deletions
38
distribution/src/assembly/intrinsics/avm2/intrinsics/memory/si8.as
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,38 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
package avm2.intrinsics.memory | ||
{ | ||
/** | ||
* Store 8 bit <code>integer</code>. | ||
* | ||
* <p> | ||
* Store a 8 bit integer to global memory. | ||
* </p> | ||
* | ||
* <p> | ||
* The value is converted to integer using the equivalent of <code>convert_i</code>, | ||
* then the least significant 8 bits are stored. | ||
* </p> | ||
* | ||
* <p> | ||
* The MOPS opcodes all access the backing store of the ByteArray represented | ||
* by the current app domain's <code>ApplicationDomain.domainMemory</code> property. | ||
* </p> | ||
* | ||
* <p> | ||
* Address ranges for accesses will be range checked using standard comparisons. | ||
* </p> | ||
* | ||
* <p> | ||
* opcode <b>si8</b> = <code>58</code> (<code>0x3A</code>). | ||
* </p> | ||
* | ||
* @langversion 3.0 | ||
* @playerversion Flash 11.6 | ||
* @playerversion AIR 11.6 | ||
* | ||
* @throws RangeError Range check failures will result in an <code>InvalidRangeError</code> exception. | ||
*/ | ||
public native function si8(value:int, addr:int):void; | ||
} |
Oops, something went wrong.