Skip to content

Commit a28d3bc

Browse files
committed
1、优化Function和Object的内存使用,提升执行效率。
2、允许Object的实例对象可以动态添加属性或者方法。
1 parent 2fed30e commit a28d3bc

File tree

27 files changed

+663
-353
lines changed

27 files changed

+663
-353
lines changed

Sample/Android/app/src/main/java/cn/vimfung/luascriptcore/sample/Person.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import android.util.Log;
44

55
import cn.vimfung.luascriptcore.LuaContext;
6+
import cn.vimfung.luascriptcore.LuaFunction;
67
import cn.vimfung.luascriptcore.modules.oo.LuaObjectClass;
78

89
/**
@@ -23,9 +24,4 @@ public void walk()
2324
Log.v("luascriptcore", String.format("%s walk", name));
2425
}
2526

26-
public static Person test()
27-
{
28-
return new Person();
29-
}
30-
3127
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-50 Bytes
Binary file not shown.

Sample/iOS_OSX/Sample.xcodeproj/project.pbxproj

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/* Begin PBXBuildFile section */
1010
7C210E041DCB5FD3000838F9 /* test.lua in Resources */ = {isa = PBXBuildFile; fileRef = 7C210E031DCB5FD3000838F9 /* test.lua */; };
1111
7C210E051DCB5FD3000838F9 /* test.lua in Resources */ = {isa = PBXBuildFile; fileRef = 7C210E031DCB5FD3000838F9 /* test.lua */; };
12-
7C2539271DD1857200071394 /* libLuaScriptCore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7C2539261DD1857200071394 /* libLuaScriptCore.a */; };
12+
7C2144BC1DD322B600782ED6 /* libLuaScriptCore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7C2144BB1DD322B600782ED6 /* libLuaScriptCore.a */; };
1313
7C5A61811D6AE2A3007D4308 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7C5A61801D6AE2A3007D4308 /* AppDelegate.m */; };
1414
7C5A61841D6AE2A3007D4308 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 7C5A61831D6AE2A3007D4308 /* main.m */; };
1515
7C5A61871D6AE2A3007D4308 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7C5A61861D6AE2A3007D4308 /* ViewController.m */; };
@@ -36,15 +36,15 @@
3636

3737
/* Begin PBXFileReference section */
3838
7C210E031DCB5FD3000838F9 /* test.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test.lua; sourceTree = "<group>"; };
39-
7C25391E1DD1857200071394 /* LSCContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LSCContext.h; sourceTree = "<group>"; };
40-
7C25391F1DD1857200071394 /* LSCFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LSCFunction.h; sourceTree = "<group>"; };
41-
7C2539201DD1857200071394 /* LSCModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LSCModule.h; sourceTree = "<group>"; };
42-
7C2539211DD1857200071394 /* LSCObjectClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LSCObjectClass.h; sourceTree = "<group>"; };
43-
7C2539221DD1857200071394 /* LSCPointer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LSCPointer.h; sourceTree = "<group>"; };
44-
7C2539231DD1857200071394 /* LSCTypeDefinied.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LSCTypeDefinied.h; sourceTree = "<group>"; };
45-
7C2539241DD1857200071394 /* LSCValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LSCValue.h; sourceTree = "<group>"; };
46-
7C2539251DD1857200071394 /* LuaScriptCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LuaScriptCore.h; sourceTree = "<group>"; };
47-
7C2539261DD1857200071394 /* libLuaScriptCore.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libLuaScriptCore.a; sourceTree = "<group>"; };
39+
7C2144B31DD322B600782ED6 /* LSCContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LSCContext.h; sourceTree = "<group>"; };
40+
7C2144B41DD322B600782ED6 /* LSCFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LSCFunction.h; sourceTree = "<group>"; };
41+
7C2144B51DD322B600782ED6 /* LSCModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LSCModule.h; sourceTree = "<group>"; };
42+
7C2144B61DD322B600782ED6 /* LSCObjectClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LSCObjectClass.h; sourceTree = "<group>"; };
43+
7C2144B71DD322B600782ED6 /* LSCPointer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LSCPointer.h; sourceTree = "<group>"; };
44+
7C2144B81DD322B600782ED6 /* LSCTypeDefinied.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LSCTypeDefinied.h; sourceTree = "<group>"; };
45+
7C2144B91DD322B600782ED6 /* LSCValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LSCValue.h; sourceTree = "<group>"; };
46+
7C2144BA1DD322B600782ED6 /* LuaScriptCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LuaScriptCore.h; sourceTree = "<group>"; };
47+
7C2144BB1DD322B600782ED6 /* libLuaScriptCore.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libLuaScriptCore.a; sourceTree = "<group>"; };
4848
7C5A617D1D6AE2A3007D4308 /* Sample-OSX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Sample-OSX.app"; sourceTree = BUILT_PRODUCTS_DIR; };
4949
7C5A617F1D6AE2A3007D4308 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
5050
7C5A61801D6AE2A3007D4308 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
@@ -95,34 +95,34 @@
9595
isa = PBXFrameworksBuildPhase;
9696
buildActionMask = 2147483647;
9797
files = (
98-
7C2539271DD1857200071394 /* libLuaScriptCore.a in Frameworks */,
98+
7C2144BC1DD322B600782ED6 /* libLuaScriptCore.a in Frameworks */,
9999
);
100100
runOnlyForDeploymentPostprocessing = 0;
101101
};
102102
/* End PBXFrameworksBuildPhase section */
103103

104104
/* Begin PBXGroup section */
105-
7C25391C1DD1857200071394 /* iOS */ = {
105+
7C2144B11DD322B600782ED6 /* LuaScriptCore */ = {
106106
isa = PBXGroup;
107107
children = (
108-
7C25391D1DD1857200071394 /* include */,
109-
7C2539261DD1857200071394 /* libLuaScriptCore.a */,
108+
7C2144B21DD322B600782ED6 /* include */,
109+
7C2144BB1DD322B600782ED6 /* libLuaScriptCore.a */,
110110
);
111-
name = iOS;
111+
name = LuaScriptCore;
112112
path = ../../../Release/iOS;
113113
sourceTree = "<group>";
114114
};
115-
7C25391D1DD1857200071394 /* include */ = {
115+
7C2144B21DD322B600782ED6 /* include */ = {
116116
isa = PBXGroup;
117117
children = (
118-
7C25391E1DD1857200071394 /* LSCContext.h */,
119-
7C25391F1DD1857200071394 /* LSCFunction.h */,
120-
7C2539201DD1857200071394 /* LSCModule.h */,
121-
7C2539211DD1857200071394 /* LSCObjectClass.h */,
122-
7C2539221DD1857200071394 /* LSCPointer.h */,
123-
7C2539231DD1857200071394 /* LSCTypeDefinied.h */,
124-
7C2539241DD1857200071394 /* LSCValue.h */,
125-
7C2539251DD1857200071394 /* LuaScriptCore.h */,
118+
7C2144B31DD322B600782ED6 /* LSCContext.h */,
119+
7C2144B41DD322B600782ED6 /* LSCFunction.h */,
120+
7C2144B51DD322B600782ED6 /* LSCModule.h */,
121+
7C2144B61DD322B600782ED6 /* LSCObjectClass.h */,
122+
7C2144B71DD322B600782ED6 /* LSCPointer.h */,
123+
7C2144B81DD322B600782ED6 /* LSCTypeDefinied.h */,
124+
7C2144B91DD322B600782ED6 /* LSCValue.h */,
125+
7C2144BA1DD322B600782ED6 /* LuaScriptCore.h */,
126126
);
127127
path = include;
128128
sourceTree = "<group>";
@@ -154,7 +154,7 @@
154154
7C6B12721D6AFD1400489D9E /* Sample-iOS */ = {
155155
isa = PBXGroup;
156156
children = (
157-
7C25391C1DD1857200071394 /* iOS */,
157+
7C2144B11DD322B600782ED6 /* LuaScriptCore */,
158158
7C6B12731D6AFD1400489D9E /* AppDelegate.h */,
159159
7C6B12741D6AFD1400489D9E /* AppDelegate.m */,
160160
7C6B12751D6AFD1400489D9E /* Assets.xcassets */,

0 commit comments

Comments
 (0)