blob: 374a07f923abc6518e9552b610fccf79cd0de4b6 [file] [log] [blame]
Jason Sams326e0dd2009-05-22 14:03:28 -07001/*
2 * Copyright (C) 2009 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "rsContext.h"
18#include "rsScriptC.h"
19#include "rsMatrix.h"
Jason Samsbe36bf32010-05-11 14:03:58 -070020#include "../../../external/llvm/libbcc/include/bcc/bcc.h"
Joe Onorato9c4e4ca2009-08-09 11:39:02 -070021#include "utils/Timers.h"
Jack Palevich1ef8b802009-05-28 15:53:04 -070022
Jason Sams1aa5a4e2009-06-22 17:15:15 -070023#include <GLES/gl.h>
24#include <GLES/glext.h>
25
Jason Sams326e0dd2009-05-22 14:03:28 -070026using namespace android;
27using namespace android::renderscript;
28
Jason Samse5769102009-06-19 16:03:18 -070029#define GET_TLS() Context::ScriptTLSStruct * tls = \
30 (Context::ScriptTLSStruct *)pthread_getspecific(Context::gThreadTLSKey); \
31 Context * rsc = tls->mContext; \
32 ScriptC * sc = (ScriptC *) tls->mScript
33
Jason Sams326e0dd2009-05-22 14:03:28 -070034
Jason Samse514b452009-09-25 14:51:22 -070035ScriptC::ScriptC(Context *rsc) : Script(rsc)
Jason Sams326e0dd2009-05-22 14:03:28 -070036{
Jason Samsf2649a92009-09-25 16:37:33 -070037 mAllocFile = __FILE__;
38 mAllocLine = __LINE__;
Jason Samsbe36bf32010-05-11 14:03:58 -070039 mBccScript = NULL;
Jason Samsefb8de12009-06-08 15:20:31 -070040 memset(&mProgram, 0, sizeof(mProgram));
Jason Sams326e0dd2009-05-22 14:03:28 -070041}
42
43ScriptC::~ScriptC()
44{
Jason Samsbe36bf32010-05-11 14:03:58 -070045 if (mBccScript) {
46 bccDeleteScript(mBccScript);
Jack Palevich1ef8b802009-05-28 15:53:04 -070047 }
Jason Samse402ed32009-11-03 11:25:42 -080048 free(mEnviroment.mScriptText);
49 mEnviroment.mScriptText = NULL;
Jason Sams326e0dd2009-05-22 14:03:28 -070050}
51
Jason Samsc61346b2010-05-28 18:23:22 -070052void ScriptC::setupScript(Context *rsc)
Jason Samsada7f272009-09-24 14:55:38 -070053{
Jason Samsc61346b2010-05-28 18:23:22 -070054 setupGLState(rsc);
55 mEnviroment.mStartTimeMillis
56 = nanoseconds_to_milliseconds(systemTime(SYSTEM_TIME_MONOTONIC));
57
Jason Samsbe36bf32010-05-11 14:03:58 -070058 for (uint32_t ct=0; ct < mEnviroment.mFieldCount; ct++) {
59 if (!mSlots[ct].get())
60 continue;
61 void *ptr = mSlots[ct]->getPtr();
62 void **dest = ((void ***)mEnviroment.mFieldAddress)[ct];
63 //LOGE("setupScript %i %p = %p %p %i", ct, dest, ptr, mSlots[ct]->getType(), mSlots[ct]->getType()->getDimX());
64
65 //const uint32_t *p32 = (const uint32_t *)ptr;
66 //for (uint32_t ct2=0; ct2 < mSlots[ct]->getType()->getDimX(); ct2++) {
67 //LOGE(" %i = 0x%08x ", ct2, p32[ct2]);
68 //}
69
70 if (dest) {
71 *dest = ptr;
72 } else {
73 LOGE("ScriptC::setupScript, NULL var binding address.");
Jason Samsada7f272009-09-24 14:55:38 -070074 }
75 }
76}
77
Jason Samsce92d4b2010-05-17 14:55:34 -070078const Allocation *ScriptC::ptrToAllocation(const void *ptr) const
79{
80 if (!ptr) {
81 return NULL;
82 }
83 for (uint32_t ct=0; ct < mEnviroment.mFieldCount; ct++) {
84 if (!mSlots[ct].get())
85 continue;
86 if (mSlots[ct]->getPtr() == ptr) {
87 return mSlots[ct].get();
88 }
89 }
90 LOGE("ScriptC::ptrToAllocation, failed to find %p", ptr);
91 return NULL;
92}
93
Jason Samsc61346b2010-05-28 18:23:22 -070094Script * ScriptC::setTLS(Script *sc)
Jason Sams22fa3712010-05-19 17:22:57 -070095{
96 Context::ScriptTLSStruct * tls = (Context::ScriptTLSStruct *)
97 pthread_getspecific(Context::gThreadTLSKey);
98 rsAssert(tls);
Jason Samsc61346b2010-05-28 18:23:22 -070099 Script *old = tls->mScript;
100 tls->mScript = sc;
101 return old;
Jason Sams22fa3712010-05-19 17:22:57 -0700102}
103
Jason Sams326e0dd2009-05-22 14:03:28 -0700104
Jason Samsc61346b2010-05-28 18:23:22 -0700105void ScriptC::setupGLState(Context *rsc)
Jason Sams326e0dd2009-05-22 14:03:28 -0700106{
Jason Samsa0a1b6f2009-06-10 15:04:38 -0700107 if (mEnviroment.mFragmentStore.get()) {
108 rsc->setFragmentStore(mEnviroment.mFragmentStore.get());
109 }
110 if (mEnviroment.mFragment.get()) {
111 rsc->setFragment(mEnviroment.mFragment.get());
112 }
Jason Sams8ce125b2009-06-17 16:52:59 -0700113 if (mEnviroment.mVertex.get()) {
114 rsc->setVertex(mEnviroment.mVertex.get());
115 }
Jason Samsb681c8a2009-09-28 18:12:56 -0700116 if (mEnviroment.mRaster.get()) {
117 rsc->setRaster(mEnviroment.mRaster.get());
118 }
Jason Samsc61346b2010-05-28 18:23:22 -0700119}
Jason Samsa0a1b6f2009-06-10 15:04:38 -0700120
Jason Samsc61346b2010-05-28 18:23:22 -0700121uint32_t ScriptC::run(Context *rsc)
122{
123 if (mProgram.mRoot == NULL) {
124 rsc->setError(RS_ERROR_BAD_SCRIPT, "Attempted to run bad script");
125 return 0;
Joe Onorato9c4e4ca2009-08-09 11:39:02 -0700126 }
Jason Samsc61346b2010-05-28 18:23:22 -0700127
128 setupScript(rsc);
Jason Sams1d54f102009-09-03 15:43:13 -0700129
Jason Sams2dca84d2009-12-09 11:05:45 -0800130 uint32_t ret = 0;
Jason Samsc61346b2010-05-28 18:23:22 -0700131 Script * oldTLS = setTLS(this);
Jason Samsbe36bf32010-05-11 14:03:58 -0700132 //LOGE("ScriptC::run %p", mProgram.mRoot);
133 ret = mProgram.mRoot();
Jason Samsc61346b2010-05-28 18:23:22 -0700134 setTLS(oldTLS);
Jason Samsbe36bf32010-05-11 14:03:58 -0700135 //LOGE("ScriptC::run ret %i", ret);
Jason Samse45ac6e2009-07-20 14:31:06 -0700136 return ret;
Jason Sams326e0dd2009-05-22 14:03:28 -0700137}
138
Jason Samsc61346b2010-05-28 18:23:22 -0700139void ScriptC::runForEach(Context *rsc, const Allocation *ain, Allocation *aout,
140 uint32_t xStart, uint32_t yStart, uint32_t xEnd, uint32_t yEnd)
141{
142 LOGE("ScriptC::runForEach not implemented");
143}
144
145void ScriptC::runForEach(Context *rsc, const Allocation *ain, Allocation *aout, uint32_t xStart, uint32_t xEnd)
146{
147 uint32_t dimX = ain->getType()->getDimX();
148 rsAssert(xStart < dimX);
149 rsAssert(xEnd <= dimX);
150 rsAssert(ain->getType()->getDimY() == 0);
151 rsAssert(ain->getType()->getDimZ() == 0);
152
153 if (xStart >= dimX) xStart = dimX - 1;
154 if (xEnd >= dimX) xEnd = dimX - 1;
155 if (xStart > xEnd) return;
156
157 setupScript(rsc);
158 Script * oldTLS = setTLS(this);
159
160 typedef int (*rs_t)(const void *, void *, uint32_t);
161 const uint8_t *ptrIn = (const uint8_t *)ain->getPtr();
162 uint32_t strideIn = ain->getType()->getElementSizeBytes();
163
164 uint8_t *ptrOut = NULL;
165 uint32_t strideOut = 0;
166 if (aout) {
167 ptrOut = (uint8_t *)aout->getPtr();
168 strideOut = aout->getType()->getElementSizeBytes();
169 }
170
171 for (uint32_t ct=xStart; ct < xEnd; ct++) {
172 ((rs_t)mProgram.mRoot) (ptrIn + (strideIn * ct), ptrOut + (strideOut * ct), ct);
173 }
174
175 setTLS(oldTLS);
176}
177
178void ScriptC::runForEach(Context *rsc, const Allocation *ain, Allocation *aout)
179{
180 if (ain->getType()->getDimY()) {
181 runForEach(rsc, ain, aout, 0, 0, 0xffffffff, 0xffffffff);
182 } else {
183 runForEach(rsc, ain, aout, 0, 0xffffffff);
184 }
185}
186
187
Jason Sams22fa3712010-05-19 17:22:57 -0700188void ScriptC::Invoke(Context *rsc, uint32_t slot, const void *data, uint32_t len)
189{
190 //LOGE("rsi_ScriptInvoke %i", slot);
191 if ((slot >= mEnviroment.mInvokeFunctionCount) ||
192 (mEnviroment.mInvokeFunctions[slot] == NULL)) {
193 rsc->setError(RS_ERROR_BAD_SCRIPT, "Calling invoke on bad script");
194 return;
195 }
Jason Samsc61346b2010-05-28 18:23:22 -0700196 setupScript(rsc);
197 Script * oldTLS = setTLS(this);
Jason Sams22fa3712010-05-19 17:22:57 -0700198
199 const uint32_t * dPtr = (const uint32_t *)data;
200 switch(len) {
201 case 0:
202 mEnviroment.mInvokeFunctions[slot]();
203 break;
204 case 4:
205 ((void (*)(uint32_t))
206 mEnviroment.mInvokeFunctions[slot])(dPtr[0]);
207 break;
208 case 8:
209 ((void (*)(uint32_t, uint32_t))
210 mEnviroment.mInvokeFunctions[slot])(dPtr[0], dPtr[1]);
211 break;
212 case 12:
213 ((void (*)(uint32_t, uint32_t, uint32_t))
214 mEnviroment.mInvokeFunctions[slot])(dPtr[0], dPtr[1], dPtr[2]);
215 break;
216 case 16:
217 ((void (*)(uint32_t, uint32_t, uint32_t, uint32_t))
218 mEnviroment.mInvokeFunctions[slot])(dPtr[0], dPtr[1], dPtr[2], dPtr[3]);
219 break;
220 case 20:
221 ((void (*)(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t))
222 mEnviroment.mInvokeFunctions[slot])(dPtr[0], dPtr[1], dPtr[2], dPtr[3], dPtr[4]);
223 break;
224 }
Jason Samsc61346b2010-05-28 18:23:22 -0700225 setTLS(oldTLS);
Jason Sams22fa3712010-05-19 17:22:57 -0700226}
227
Jason Sams326e0dd2009-05-22 14:03:28 -0700228ScriptCState::ScriptCState()
229{
Jason Sams8c6bc692009-09-16 15:04:38 -0700230 mScript = NULL;
Jason Sams326e0dd2009-05-22 14:03:28 -0700231 clear();
232}
233
234ScriptCState::~ScriptCState()
235{
Jason Sams8c6bc692009-09-16 15:04:38 -0700236 delete mScript;
237 mScript = NULL;
Jason Sams326e0dd2009-05-22 14:03:28 -0700238}
239
240void ScriptCState::clear()
241{
Jason Sams8b2c0652009-08-12 17:54:11 -0700242 for (uint32_t ct=0; ct < MAX_SCRIPT_BANKS; ct++) {
243 mConstantBufferTypes[ct].clear();
Jason Sams90b36a82009-08-17 13:56:09 -0700244 mSlotWritable[ct] = false;
Jason Sams8b2c0652009-08-12 17:54:11 -0700245 }
Jason Samsefb8de12009-06-08 15:20:31 -0700246
Jason Sams8c6bc692009-09-16 15:04:38 -0700247 delete mScript;
Jason Samse514b452009-09-25 14:51:22 -0700248 mScript = new ScriptC(NULL);
Jason Sams1f526332009-06-05 17:35:09 -0700249}
250
Jason Samsbe36bf32010-05-11 14:03:58 -0700251static BCCvoid* symbolLookup(BCCvoid* pContext, const BCCchar* name)
Jason Sams29df66f2009-07-16 15:08:06 -0700252{
Jason Samsaeb094b2010-05-18 13:35:45 -0700253 const ScriptCState::SymbolTable_t *sym;
254 sym = ScriptCState::lookupSymbol(name);
255 if (sym) {
256 return sym->mPtr;
257 }
258 sym = ScriptCState::lookupSymbolCL(name);
259 if (sym) {
260 return sym->mPtr;
261 }
262 sym = ScriptCState::lookupSymbolGL(name);
Jason Sams29df66f2009-07-16 15:08:06 -0700263 if (sym) {
264 return sym->mPtr;
265 }
Jason Sams29df66f2009-07-16 15:08:06 -0700266 LOGE("ScriptC sym lookup failed for %s", name);
Jason Sams29df66f2009-07-16 15:08:06 -0700267 return NULL;
268}
Jason Samsa4a54e42009-06-10 18:39:40 -0700269
Jason Sams8c6bc692009-09-16 15:04:38 -0700270void ScriptCState::runCompiler(Context *rsc, ScriptC *s)
Jason Sams1f526332009-06-05 17:35:09 -0700271{
Jason Samsbe36bf32010-05-11 14:03:58 -0700272 LOGE("ScriptCState::runCompiler ");
Jason Sams1f526332009-06-05 17:35:09 -0700273
Jason Samsbe36bf32010-05-11 14:03:58 -0700274 s->mBccScript = bccCreateScript();
275 bccScriptBitcode(s->mBccScript, s->mEnviroment.mScriptText, s->mEnviroment.mScriptTextLength);
276 bccRegisterSymbolCallback(s->mBccScript, symbolLookup, NULL);
Jason Samsbe36bf32010-05-11 14:03:58 -0700277 bccCompileScript(s->mBccScript);
Jason Samsbe36bf32010-05-11 14:03:58 -0700278 bccGetScriptLabel(s->mBccScript, "root", (BCCvoid**) &s->mProgram.mRoot);
279 bccGetScriptLabel(s->mBccScript, "init", (BCCvoid**) &s->mProgram.mInit);
280 LOGE("root %p, init %p", s->mProgram.mRoot, s->mProgram.mInit);
Jason Samsf1685042009-07-16 17:47:40 -0700281
Jason Sams8c6bc692009-09-16 15:04:38 -0700282 if (s->mProgram.mInit) {
283 s->mProgram.mInit();
Jason Sams1d54f102009-09-03 15:43:13 -0700284 }
285
Jason Samsbe36bf32010-05-11 14:03:58 -0700286 s->mEnviroment.mInvokeFunctions = (Script::InvokeFunc_t *)calloc(100, sizeof(void *));
287 BCCchar **labels = new char*[100];
288 bccGetFunctions(s->mBccScript, (BCCsizei *)&s->mEnviroment.mInvokeFunctionCount,
289 100, (BCCchar **)labels);
290 //LOGE("func count %i", s->mEnviroment.mInvokeFunctionCount);
291 for (uint32_t i=0; i < s->mEnviroment.mInvokeFunctionCount; i++) {
292 BCCsizei length;
293 bccGetFunctionBinary(s->mBccScript, labels[i], (BCCvoid **)&(s->mEnviroment.mInvokeFunctions[i]), &length);
294 //LOGE("func %i %p", i, s->mEnviroment.mInvokeFunctions[i]);
Jason Sams1d54f102009-09-03 15:43:13 -0700295 }
296
Jason Samsbe36bf32010-05-11 14:03:58 -0700297 s->mEnviroment.mFieldAddress = (void **)calloc(100, sizeof(void *));
298 bccGetExportVars(s->mBccScript, (BCCsizei *)&s->mEnviroment.mFieldCount,
299 100, s->mEnviroment.mFieldAddress);
300 //LOGE("var count %i", s->mEnviroment.mFieldCount);
301 for (uint32_t i=0; i < s->mEnviroment.mFieldCount; i++) {
302 //LOGE("var %i %p", i, s->mEnviroment.mFieldAddress[i]);
Jason Sams8c6bc692009-09-16 15:04:38 -0700303 }
Jason Samsa4a54e42009-06-10 18:39:40 -0700304
Jason Sams8c6bc692009-09-16 15:04:38 -0700305 s->mEnviroment.mFragment.set(rsc->getDefaultProgramFragment());
306 s->mEnviroment.mVertex.set(rsc->getDefaultProgramVertex());
Jason Samsccc010b2010-05-13 18:30:11 -0700307 s->mEnviroment.mFragmentStore.set(rsc->getDefaultProgramStore());
Jason Samsb681c8a2009-09-28 18:12:56 -0700308 s->mEnviroment.mRaster.set(rsc->getDefaultProgramRaster());
Jason Sams8c6bc692009-09-16 15:04:38 -0700309
Jason Samsbe36bf32010-05-11 14:03:58 -0700310 if (s->mProgram.mRoot) {
Jason Sams10308932009-06-09 12:15:30 -0700311 const static int pragmaMax = 16;
Jason Samsbe36bf32010-05-11 14:03:58 -0700312 BCCsizei pragmaCount;
313 BCCchar * str[pragmaMax];
314 bccGetPragmas(s->mBccScript, &pragmaCount, pragmaMax, &str[0]);
Jason Sams10308932009-06-09 12:15:30 -0700315
Jason Sams10308932009-06-09 12:15:30 -0700316 for (int ct=0; ct < pragmaCount; ct+=2) {
Jason Samsaeb094b2010-05-18 13:35:45 -0700317 //LOGE("pragme %s %s", str[ct], str[ct+1]);
Jason Sams10308932009-06-09 12:15:30 -0700318 if (!strcmp(str[ct], "version")) {
319 continue;
Jason Sams10308932009-06-09 12:15:30 -0700320 }
321
Jason Sams10308932009-06-09 12:15:30 -0700322 if (!strcmp(str[ct], "stateVertex")) {
Jason Sams8ce125b2009-06-17 16:52:59 -0700323 if (!strcmp(str[ct+1], "default")) {
324 continue;
325 }
326 if (!strcmp(str[ct+1], "parent")) {
Jason Sams8c6bc692009-09-16 15:04:38 -0700327 s->mEnviroment.mVertex.clear();
Jason Sams8ce125b2009-06-17 16:52:59 -0700328 continue;
329 }
Jason Sams10308932009-06-09 12:15:30 -0700330 LOGE("Unreconized value %s passed to stateVertex", str[ct+1]);
331 }
332
333 if (!strcmp(str[ct], "stateRaster")) {
Jason Samsb681c8a2009-09-28 18:12:56 -0700334 if (!strcmp(str[ct+1], "default")) {
335 continue;
336 }
337 if (!strcmp(str[ct+1], "parent")) {
338 s->mEnviroment.mRaster.clear();
339 continue;
340 }
Jason Sams10308932009-06-09 12:15:30 -0700341 LOGE("Unreconized value %s passed to stateRaster", str[ct+1]);
342 }
343
344 if (!strcmp(str[ct], "stateFragment")) {
Jason Sams8ce125b2009-06-17 16:52:59 -0700345 if (!strcmp(str[ct+1], "default")) {
346 continue;
347 }
348 if (!strcmp(str[ct+1], "parent")) {
Jason Sams8c6bc692009-09-16 15:04:38 -0700349 s->mEnviroment.mFragment.clear();
Jason Sams8ce125b2009-06-17 16:52:59 -0700350 continue;
351 }
Jason Sams10308932009-06-09 12:15:30 -0700352 LOGE("Unreconized value %s passed to stateFragment", str[ct+1]);
353 }
354
Jason Samsb681c8a2009-09-28 18:12:56 -0700355 if (!strcmp(str[ct], "stateStore")) {
Jason Sams8ce125b2009-06-17 16:52:59 -0700356 if (!strcmp(str[ct+1], "default")) {
357 continue;
358 }
359 if (!strcmp(str[ct+1], "parent")) {
Jason Sams8c6bc692009-09-16 15:04:38 -0700360 s->mEnviroment.mFragmentStore.clear();
Jason Sams8ce125b2009-06-17 16:52:59 -0700361 continue;
362 }
Jason Samsb681c8a2009-09-28 18:12:56 -0700363 LOGE("Unreconized value %s passed to stateStore", str[ct+1]);
Jason Sams10308932009-06-09 12:15:30 -0700364 }
365
366 }
367
Jason Samsd34b7252009-08-04 16:58:20 -0700368
Jason Sams10308932009-06-09 12:15:30 -0700369 } else {
370 // Deal with an error.
371 }
Jason Sams326e0dd2009-05-22 14:03:28 -0700372}
373
Jason Sams8b2c0652009-08-12 17:54:11 -0700374
Joe Onorato57b79ce2009-08-09 22:57:44 -0700375
Jason Sams326e0dd2009-05-22 14:03:28 -0700376namespace android {
377namespace renderscript {
378
379void rsi_ScriptCBegin(Context * rsc)
380{
381 ScriptCState *ss = &rsc->mScriptC;
382 ss->clear();
383}
384
Jason Samsefb8de12009-06-08 15:20:31 -0700385void rsi_ScriptCSetScript(Context * rsc, void *vp)
Jason Sams326e0dd2009-05-22 14:03:28 -0700386{
Jason Sams8c6bc692009-09-16 15:04:38 -0700387 rsAssert(0);
388 //ScriptCState *ss = &rsc->mScriptC;
389 //ss->mProgram.mScript = reinterpret_cast<ScriptC::RunScript_t>(vp);
Jason Sams326e0dd2009-05-22 14:03:28 -0700390}
391
Jason Sams1f526332009-06-05 17:35:09 -0700392void rsi_ScriptCSetText(Context *rsc, const char *text, uint32_t len)
393{
394 ScriptCState *ss = &rsc->mScriptC;
Jason Samse402ed32009-11-03 11:25:42 -0800395
396 char *t = (char *)malloc(len + 1);
397 memcpy(t, text, len);
398 t[len] = 0;
399 ss->mScript->mEnviroment.mScriptText = t;
Jason Sams8c6bc692009-09-16 15:04:38 -0700400 ss->mScript->mEnviroment.mScriptTextLength = len;
Jason Sams1f526332009-06-05 17:35:09 -0700401}
402
403
Jason Sams326e0dd2009-05-22 14:03:28 -0700404RsScript rsi_ScriptCCreate(Context * rsc)
405{
406 ScriptCState *ss = &rsc->mScriptC;
407
Jason Sams8c6bc692009-09-16 15:04:38 -0700408 ScriptC *s = ss->mScript;
409 ss->mScript = NULL;
Jason Sams1f526332009-06-05 17:35:09 -0700410
Jason Sams8c6bc692009-09-16 15:04:38 -0700411 ss->runCompiler(rsc, s);
Jason Sams9397e302009-08-27 20:23:34 -0700412 s->incUserRef();
Jason Samse514b452009-09-25 14:51:22 -0700413 s->setContext(rsc);
Jason Samsfa517192009-08-13 12:59:04 -0700414 for (int ct=0; ct < MAX_SCRIPT_BANKS; ct++) {
415 s->mTypes[ct].set(ss->mConstantBufferTypes[ct].get());
Jason Sams90b36a82009-08-17 13:56:09 -0700416 s->mSlotWritable[ct] = ss->mSlotWritable[ct];
Jason Samsfa517192009-08-13 12:59:04 -0700417 }
Jason Sams10308932009-06-09 12:15:30 -0700418
Jason Samsfa517192009-08-13 12:59:04 -0700419 ss->clear();
Jason Sams326e0dd2009-05-22 14:03:28 -0700420 return s;
421}
422
Jason Sams326e0dd2009-05-22 14:03:28 -0700423}
424}
425
426