Skip to content

Commit

Permalink
#26 Refactoring POSIX AS3 classes
Browse files Browse the repository at this point in the history
  • Loading branch information
vpmedia committed Jun 27, 2014
1 parent 21d4438 commit 6de9175
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 7 deletions.
22 changes: 19 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,7 @@ diagnostics:
# Development target
all_dev:
@$(SDK_MAKE) abclibs_compile
@rm -rf $(BUILD)/test_pthreads_c_swf
@mkdir -p $(BUILD)/test_pthreads_c_swf
cd $(BUILD)/test_pthreads_c_swf && $(SDK_CC) -O0 -pthread -emit-swf -save-temps $(SRCROOT)/test/pthread_test.c -o pthread_test.swf
cd samples/09_Pthreads && $(SDK_MAKE) T09_3 T09_4 T09_5

# Clean build outputs
clean:
Expand Down Expand Up @@ -538,6 +536,24 @@ builtinabcs:
cd $(SRCROOT)/$(DEPENDENCY_AVMPLUS)/shell && $(PYTHON) ./shell_toplevel.py -abcfuture -config CONFIG::VMCFG_FLOAT=false -config CONFIG::VMCFG_ALCHEMY_SDK_BUILD=true -config CONFIG::VMCFG_ALCHEMY_POSIX=true
cp -f $(DEPENDENCY_AVMPLUS)/generated/*.abc $(SDK)/usr/lib/

# Assemble builtin SysCalls
builtinsyscalls:
$(SDK)/usr/bin/gcc -c print_stat_info.c
$(SDK)/usr/bin/llvm-ld -internalize-public-api-file=$(SDK)/public-api.txt \
print_stat_info.o $(SDK)/usr/lib/crt1_c.o $(SDK)/usr/lib/libgcc.a \
$(SDK)/usr/lib/libc.a $(SDK)/usr/lib/libm.a -o print_stat_info-linked
perl $(SRCROOT)/llvm-2.9/lib/Target/AVM2/build.pl $(SDK)/usr print_stat_info-linked.bc \
$(SRCROOT)/avmplus/utils/asc.jar $(SRCROOT)/llvm-2.9/lib/Target/AVM2 print_stat_info
$(AVMSHELL) $(BUILD)/swfmake.abc -- -o print_stat_info.swf \
$(SDK)/usr/lib/C_Run.abc \
$(SDK)/usr/lib/Exit.abc $(SDK)/usr/lib/LongJmp.abc \
$(SDK)/usr/lib/CModule.abc print_stat_info.abc $(SDK)/usr/lib/startHack.abc
$(AVMSHELL) $(BUILD)/projectormake.abc -- -o print_stat_info $(AVMSHELL) \
print_stat_info.swf -- -Djitordie
chmod u+x print_stat_info
rm print_stat_info-linked print_stat_info-linked.bc* print_stat_info.abc print_stat_info.cpp \
print_stat_info.h print_stat_info.o print_stat_info.swf

# Assemble ABC library binaries and documentation
abclibs:
$(MAKE) abclibs_compile
Expand Down
2 changes: 1 addition & 1 deletion posix/C_Run.as
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ package C_Run
[GlobalMethod]
public function newThread(tid:int, esp_init:int, entryFun:int, args:Vector.<int>):*
{
CONFIG::debug { trace("CRun::newThread: " + tid + " => " + args.length); }
CONFIG::debug { trace("CRun::newThread: " + arguments); }

var w:* = createflasccWorker();

Expand Down
8 changes: 7 additions & 1 deletion posix/Console.as
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ package com.adobe.flascc
* act as a child of some other DisplayObjectContainer.
*/
public function Console(container:DisplayObjectContainer = null)
{
{
CONFIG::debug { trace("Console::created"); }

CModule.rootSprite = container ? container.root : this;

if(CModule.runningAsWorker()) {
Expand All @@ -69,6 +71,8 @@ package com.adobe.flascc
*/
protected function init(e:Event):void
{
CONFIG::debug { trace("Console::init"); }

inputContainer = new Sprite()
addChild(inputContainer)

Expand Down Expand Up @@ -124,6 +128,8 @@ package com.adobe.flascc
*/
public function exit(code:int):Boolean
{
CONFIG::debug { trace("Console::exit: " + code); }

// default to unhandled
if (exitHook != null)
return exitHook(code)
Expand Down
1 change: 1 addition & 0 deletions posix/Exit.as
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ package C_Run
*/
public function Exit(code:int)
{
CONFIG::debug { trace("Exit::exit: " + code); }
this.code = code;
}
}
Expand Down
3 changes: 2 additions & 1 deletion posix/PlayerCreateWorker.as
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ package C_Run

public function run():void
{
//trace("run");
CONFIG::debug { trace("AlcWorkerSprite::run"); }

//TODO most code shared w/ startHack.as ... unify?
try
{
Expand Down
2 changes: 1 addition & 1 deletion samples/09_Pthreads/pthread_swc.as
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ package
{
// change to false to prevent running main in the background
// when Workers are supported
const runMainBg:Boolean = false
const runMainBg:Boolean = true

// PlayerKernel will delegate read/write requests to the "/dev/tty"
// file to the object specified with this API.
Expand Down

0 comments on commit 6de9175

Please sign in to comment.