OLD | NEW |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 #include "runtime.h" | 5 #include "runtime.h" |
6 #include "arch_GOARCH.h" | 6 #include "arch_GOARCH.h" |
7 | 7 |
8 enum { | 8 enum { |
9 maxround = sizeof(uintptr), | 9 maxround = sizeof(uintptr), |
10 }; | 10 }; |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 *(uint32*)&i1 = ~1UL; | 283 *(uint32*)&i1 = ~1UL; |
284 if(i == i1) | 284 if(i == i1) |
285 runtime·throw("float32nan2"); | 285 runtime·throw("float32nan2"); |
286 if(!(i != i1)) | 286 if(!(i != i1)) |
287 runtime·throw("float32nan3"); | 287 runtime·throw("float32nan3"); |
288 | 288 |
289 TestAtomic64(); | 289 TestAtomic64(); |
290 } | 290 } |
291 | 291 |
292 void | 292 void |
293 runtime·Caller(int32 skip, uintptr retpc, String retfile, int32 retline, bool re
tbool) | 293 runtime·Caller(intgo skip, uintptr retpc, String retfile, intgo retline, bool re
tbool) |
294 { | 294 { |
295 Func *f, *g; | 295 Func *f, *g; |
296 uintptr pc; | 296 uintptr pc; |
297 uintptr rpc[2]; | 297 uintptr rpc[2]; |
298 | 298 |
299 /* | 299 /* |
300 * Ask for two PCs: the one we were asked for | 300 * Ask for two PCs: the one we were asked for |
301 * and what it called, so that we can see if it | 301 * and what it called, so that we can see if it |
302 * "called" sigpanic. | 302 * "called" sigpanic. |
303 */ | 303 */ |
(...skipping 16 matching lines...) Expand all Loading... |
320 retline = runtime·funcline(f, pc); | 320 retline = runtime·funcline(f, pc); |
321 retbool = true; | 321 retbool = true; |
322 } | 322 } |
323 FLUSH(&retpc); | 323 FLUSH(&retpc); |
324 FLUSH(&retfile); | 324 FLUSH(&retfile); |
325 FLUSH(&retline); | 325 FLUSH(&retline); |
326 FLUSH(&retbool); | 326 FLUSH(&retbool); |
327 } | 327 } |
328 | 328 |
329 void | 329 void |
330 runtime·Callers(int32 skip, Slice pc, int32 retn) | 330 runtime·Callers(intgo skip, Slice pc, intgo retn) |
331 { | 331 { |
332 // runtime.callers uses pc.array==nil as a signal | 332 // runtime.callers uses pc.array==nil as a signal |
333 // to print a stack trace. Pick off 0-length pc here | 333 // to print a stack trace. Pick off 0-length pc here |
334 // so that we don't let a nil pc slice get to it. | 334 // so that we don't let a nil pc slice get to it. |
335 if(pc.len == 0) | 335 if(pc.len == 0) |
336 retn = 0; | 336 retn = 0; |
337 else | 337 else |
338 retn = runtime·callers(skip, (uintptr*)pc.array, pc.len); | 338 retn = runtime·callers(skip, (uintptr*)pc.array, pc.len); |
339 FLUSH(&retn); | 339 FLUSH(&retn); |
340 } | 340 } |
(...skipping 10 matching lines...) Expand all Loading... |
351 { | 351 { |
352 uint32 x; | 352 uint32 x; |
353 | 353 |
354 x = m->fastrand; | 354 x = m->fastrand; |
355 x += x; | 355 x += x; |
356 if(x & 0x80000000L) | 356 if(x & 0x80000000L) |
357 x ^= 0x88888eefUL; | 357 x ^= 0x88888eefUL; |
358 m->fastrand = x; | 358 m->fastrand = x; |
359 return x; | 359 return x; |
360 } | 360 } |
OLD | NEW |