Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' of git://github.com/D-Programming-Language/drun…
Browse files Browse the repository at this point in the history
…time into fix4793

Conflicts:
	src/rt/dmain2.d
  • Loading branch information
shoo committed Jul 16, 2012
2 parents dc9de63 + 74f85b7 commit 3b2d967
Show file tree
Hide file tree
Showing 45 changed files with 634 additions and 331 deletions.
18 changes: 17 additions & 1 deletion import/core/thread.di
Expand Up @@ -3,7 +3,7 @@
*
* Copyright: Copyright Sean Kelly 2005 - 2009.
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Authors: Sean Kelly, Walter Bright
* Authors: Sean Kelly, Walter Bright, Alex Rønne Petersen
* Source: $(DRUNTIMESRC core/_thread.d)
*/

Expand Down Expand Up @@ -668,10 +668,26 @@ alias IsMarked delegate( void* addr ) IsMarkedDg;
extern(C) void thread_processGCMarks( scope IsMarkedDg isMarked );


/**
* Returns the stack top of the currently active stack within the calling
* thread.
*
* In:
* The calling thread must be attached to the runtime.
*
* Returns:
* The address of the stack top.
*/
extern (C) void* thread_stackTop();


/**
* Returns the stack bottom of the currently active stack within the calling
* thread.
*
* In:
* The calling thread must be attached to the runtime.
*
* Returns:
* The address of the stack bottom.
*/
Expand Down
20 changes: 10 additions & 10 deletions import/object.di
Expand Up @@ -224,16 +224,16 @@ class TypeInfo_Pointer : TypeInfo

class TypeInfo_Array : TypeInfo
{
override string toString();
override equals_t opEquals(const Object o);
override hash_t getHash(in void* p) @trusted;
override equals_t equals(in void* p1, in void* p2);
override int compare(in void* p1, in void* p2);
override @property size_t tsize() nothrow pure;
override void swap(void* p1, void* p2);
override string toString() const;
override equals_t opEquals(const Object o) const;
override hash_t getHash(in void* p) @trusted const;
override equals_t equals(in void* p1, in void* p2) const;
override int compare(in void* p1, in void* p2) const;
override @property size_t tsize() nothrow pure const;
override void swap(void* p1, void* p2) const;
override @property const(TypeInfo) next() nothrow pure const;
override @property uint flags() nothrow pure;
override @property size_t talign() nothrow pure;
override @property uint flags() nothrow pure const;
override @property size_t talign() nothrow pure const;
version (X86_64) override int argTypes(out TypeInfo arg1, out TypeInfo arg2);

TypeInfo value;
Expand Down Expand Up @@ -451,7 +451,7 @@ class Throwable : Object

this(string msg, Throwable next = null);
this(string msg, string file, size_t line, Throwable next = null);
override string toString();
override string toString() const;
}


Expand Down
6 changes: 4 additions & 2 deletions src/core/atomic.d
Expand Up @@ -4,7 +4,7 @@
*
* Copyright: Copyright Sean Kelly 2005 - 2010.
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Authors: Sean Kelly
* Authors: Sean Kelly, Alex Rønne Petersen
* Source: $(DRUNTIMESRC core/_atomic.d)
*/

Expand Down Expand Up @@ -613,7 +613,7 @@ else version( AsmX86_32 )

Lend:

;
ret;
}
}
}
Expand Down Expand Up @@ -1060,7 +1060,9 @@ else version( AsmX86_64 )
asm
{
naked;

mfence;
ret;
}
}
}
Expand Down
73 changes: 38 additions & 35 deletions src/core/bitop.d
Expand Up @@ -3,7 +3,7 @@
*
* Copyright: Copyright Don Clugston 2005 - 2009.
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Authors: Don Clugston, Sean Kelly, Walter Bright
* Authors: Don Clugston, Sean Kelly, Walter Bright, Alex Rønne Petersen
* Source: $(DRUNTIMESRC core/_bitop.d)
*/

Expand All @@ -15,6 +15,7 @@
module core.bitop;

nothrow:
@safe:

version( D_InlineAsm_X86_64 )
version = AsmX86;
Expand All @@ -38,7 +39,7 @@ else version( D_InlineAsm_X86 )
* }
* ---
*/
pure int bsf(size_t v);
int bsf(size_t v) pure;

unittest
{
Expand All @@ -63,7 +64,7 @@ unittest
* }
* ---
*/
pure int bsr(size_t v);
int bsr(size_t v) pure;

unittest
{
Expand All @@ -73,19 +74,19 @@ unittest
/**
* Tests the bit.
*/
pure int bt(in size_t* p, size_t bitnum);
int bt(in size_t* p, size_t bitnum) pure;


/**
* Tests and complements the bit.
*/
int btc(size_t* p, size_t bitnum);
int btc(size_t* p, size_t bitnum) pure;


/**
* Tests and resets (sets to 0) the bit.
*/
int btr(size_t* p, size_t bitnum);
int btr(size_t* p, size_t bitnum) pure;


/**
Expand Down Expand Up @@ -137,7 +138,7 @@ int main()
}
* ---
*/
int bts(size_t* p, size_t bitnum);
int bts(size_t* p, size_t bitnum) pure;

unittest
{
Expand Down Expand Up @@ -188,49 +189,51 @@ unittest
* byte 3, byte 1 becomes byte 2, byte 2 becomes byte 1, byte 3
* becomes byte 0.
*/
pure uint bswap(uint v);
uint bswap(uint v) pure;

@system // not pure
{
/**
* Reads I/O port at port_address.
*/
ubyte inp(uint port_address);

/**
* Reads I/O port at port_address.
*/
ubyte inp(uint port_address);

/**
* ditto
*/
ushort inpw(uint port_address);

/**
* ditto
*/
ushort inpw(uint port_address);

/**
* ditto
*/
uint inpl(uint port_address);

/**
* ditto
*/
uint inpl(uint port_address);


/**
* Writes and returns value to I/O port at port_address.
*/
ubyte outp(uint port_address, ubyte value);
/**
* Writes and returns value to I/O port at port_address.
*/
ubyte outp(uint port_address, ubyte value);


/**
* ditto
*/
ushort outpw(uint port_address, ushort value);
/**
* ditto
*/
ushort outpw(uint port_address, ushort value);


/**
* ditto
*/
uint outpl(uint port_address, uint value);
/**
* ditto
*/
uint outpl(uint port_address, uint value);
}


/**
* Calculates the number of set bits in a 32-bit integer.
*/
pure int popcnt( uint x )
int popcnt( uint x ) pure
{
// Avoid branches, and the potential for cache misses which
// could be incurred with a table lookup.
Expand Down Expand Up @@ -277,7 +280,7 @@ unittest
/**
* Reverses the order of bits in a 32-bit integer.
*/
pure uint bitswap( uint x )
@trusted uint bitswap( uint x ) pure
{
version (AsmX86)
{
Expand Down
8 changes: 4 additions & 4 deletions src/core/memory.d
Expand Up @@ -4,7 +4,7 @@
*
* Copyright: Copyright Sean Kelly 2005 - 2009.
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
* Authors: Sean Kelly
* Authors: Sean Kelly, Alex Rønne Petersen
* Source: $(DRUNTIMESRC core/_memory.d)
*/

Expand Down Expand Up @@ -410,7 +410,7 @@ struct GC
*/
static inout(void)* addrOf( inout(void)* p ) nothrow /* FIXME pure */
{
return cast(inout(void)*)addrOf(cast()p);
return cast(inout(void)*)gc_addrOf(cast(void*)p);
}


Expand All @@ -436,7 +436,7 @@ struct GC
*/
static size_t sizeOf( in void* p ) nothrow
{
return sizeOf(cast(const)p);
return gc_sizeOf(cast(void*)p);
}


Expand Down Expand Up @@ -464,7 +464,7 @@ struct GC
*/
static BlkInfo query( in void* p ) nothrow
{
return query(cast(const)p);
return gc_query(cast(void*)p);
}


Expand Down
2 changes: 1 addition & 1 deletion src/core/runtime.d
Expand Up @@ -462,7 +462,7 @@ Throwable.TraceInfo defaultTraceHandler( void* ptr = null )
return ret;
}

override string toString()
override string toString() const
{
string buf;
foreach( i, line; this )
Expand Down
1 change: 1 addition & 0 deletions src/core/stdc/complex.d
Expand Up @@ -15,6 +15,7 @@
module core.stdc.complex;

extern (C):
@trusted: // All of these operate on floating point values only.
nothrow:

alias creal complex;
Expand Down
2 changes: 2 additions & 0 deletions src/core/stdc/config.d
Expand Up @@ -15,6 +15,8 @@
module core.stdc.config;

extern (C):
@trusted: // Types only.
nothrow:

version( Windows )
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/stdc/ctype.d
Expand Up @@ -15,8 +15,8 @@
module core.stdc.ctype;

extern (C):
@trusted: // All of these operate on integers only.
nothrow:
@safe:

int isalnum(int c);
int isalpha(int c);
Expand Down
8 changes: 5 additions & 3 deletions src/core/stdc/errno.d
Expand Up @@ -14,14 +14,16 @@
*/
module core.stdc.errno;

extern (C) int getErrno(); // for internal use
extern (C) int setErrno(int); // for internal use
@trusted: // Only manipulates errno.
nothrow:

@property int errno() { return getErrno(); }
@property int errno(int n) { return setErrno(n); }

extern (C):
nothrow:

private extern (C) int getErrno(); // for internal use
private extern (C) int setErrno(int); // for internal use

version( Windows )
{
Expand Down
2 changes: 2 additions & 0 deletions src/core/stdc/fenv.d
Expand Up @@ -15,6 +15,8 @@
module core.stdc.fenv;

extern (C):
@system:
nothrow:

version( Windows )
{
Expand Down
2 changes: 2 additions & 0 deletions src/core/stdc/float_.d
Expand Up @@ -15,6 +15,8 @@
module core.stdc.float_;

extern (C):
@trusted: // Constants only.
nothrow:

enum FLT_ROUNDS = 1;
enum FLT_EVAL_METHOD = 2;
Expand Down
2 changes: 2 additions & 0 deletions src/core/stdc/inttypes.d
Expand Up @@ -18,6 +18,8 @@ public import core.stdc.stddef; // for wchar_t
public import core.stdc.stdint; // required by spec

extern (C):
@trusted: // Types and constants only.
nothrow:

struct imaxdiv_t
{
Expand Down
2 changes: 2 additions & 0 deletions src/core/stdc/limits.d
Expand Up @@ -17,6 +17,8 @@ module core.stdc.limits;
private import core.stdc.config;

extern (C):
@trusted: // Constants only.
nothrow:

enum CHAR_BIT = 8;
enum SCHAR_MIN = byte.min;
Expand Down
4 changes: 2 additions & 2 deletions src/core/stdc/locale.d
Expand Up @@ -15,7 +15,7 @@
module core.stdc.locale;

extern (C):

@trusted: // Only setlocale operates on C strings.
nothrow:

struct lconv
Expand Down Expand Up @@ -59,5 +59,5 @@ enum LC_TELEPHONE = 10; // non-standard
enum LC_MEASUREMENT = 11; // non-standard
enum LC_IDENTIFICATION = 12; // non-standard

char* setlocale(int category, in char* locale);
@system char* setlocale(int category, in char* locale);
lconv* localeconv();

0 comments on commit 3b2d967

Please sign in to comment.