Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/builtins/SLDefineFunctionBuiltin.java @ 15891:09ac9ac9c4fc
Truffle: SourceManager renamed to SourceFactory
- All methods are static, no longer accessed via ExecutionContext
- Sources are indexed with weak references
- File content caching is now optional; off by default
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Sat, 24 May 2014 10:34:43 -0700 |
parents | 89ac75425681 |
children | 915ebb306fcc |
comparison
equal
deleted
inserted
replaced
15842:eb947cc7bff9 | 15891:09ac9ac9c4fc |
---|---|
24 | 24 |
25 import com.oracle.truffle.api.CompilerDirectives.SlowPath; | 25 import com.oracle.truffle.api.CompilerDirectives.SlowPath; |
26 import com.oracle.truffle.api.*; | 26 import com.oracle.truffle.api.*; |
27 import com.oracle.truffle.api.dsl.*; | 27 import com.oracle.truffle.api.dsl.*; |
28 import com.oracle.truffle.api.nodes.*; | 28 import com.oracle.truffle.api.nodes.*; |
29 import com.oracle.truffle.api.source.*; | |
29 import com.oracle.truffle.sl.parser.*; | 30 import com.oracle.truffle.sl.parser.*; |
30 import com.oracle.truffle.sl.runtime.*; | 31 import com.oracle.truffle.sl.runtime.*; |
31 | 32 |
32 /** | 33 /** |
33 * Builtin function to define (or redefine) functions. The provided source code is parsed the same | 34 * Builtin function to define (or redefine) functions. The provided source code is parsed the same |
42 return code; | 43 return code; |
43 } | 44 } |
44 | 45 |
45 @SlowPath | 46 @SlowPath |
46 private static void doDefineFunction(SLContext context, String code) { | 47 private static void doDefineFunction(SLContext context, String code) { |
47 Source source = context.getSourceManager().get("[defineFunction]", code); | 48 Source source = SourceFactory.fromText(code, "[defineFunction]"); |
48 /* The same parsing code as for parsing the initial source. */ | 49 /* The same parsing code as for parsing the initial source. */ |
49 Parser.parseSL(context, source); | 50 Parser.parseSL(context, source); |
50 } | 51 } |
51 } | 52 } |