Make 'hidden' the default visibility for gcc. Add build option,

visibility=[hidden|default], that controls visibility and make
'hidden' the default.  Export a few variables that had been forgotten.

Review URL: http://codereview.chromium.org/206011


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2884 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent f2f69625
...@@ -115,6 +115,10 @@ LIBRARY_FLAGS = { ...@@ -115,6 +115,10 @@ LIBRARY_FLAGS = {
'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'],
'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions'], 'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions'],
}, },
'visibility:hidden': {
# Use visibility=default to disable this.
'CXXFLAGS': ['-fvisibility=hidden']
},
'mode:debug': { 'mode:debug': {
'CCFLAGS': ['-g', '-O0'], 'CCFLAGS': ['-g', '-O0'],
'CPPDEFINES': ['ENABLE_DISASSEMBLER', 'DEBUG'], 'CPPDEFINES': ['ENABLE_DISASSEMBLER', 'DEBUG'],
...@@ -233,7 +237,6 @@ LIBRARY_FLAGS = { ...@@ -233,7 +237,6 @@ LIBRARY_FLAGS = {
V8_EXTRA_FLAGS = { V8_EXTRA_FLAGS = {
'gcc': { 'gcc': {
'all': { 'all': {
'CXXFLAGS': [], #['-fvisibility=hidden'],
'WARNINGFLAGS': ['-Wall', 'WARNINGFLAGS': ['-Wall',
'-Werror', '-Werror',
'-W', '-W',
...@@ -629,6 +632,11 @@ SIMPLE_OPTIONS = { ...@@ -629,6 +632,11 @@ SIMPLE_OPTIONS = {
'values': ['on', 'off'], 'values': ['on', 'off'],
'default': 'off', 'default': 'off',
'help': 'more output from compiler and linker' 'help': 'more output from compiler and linker'
},
'visibility': {
'values': ['default', 'hidden'],
'default': 'hidden',
'help': 'shared library symbol visibility'
} }
} }
......
...@@ -2725,9 +2725,9 @@ class Internals { ...@@ -2725,9 +2725,9 @@ class Internals {
// These constants are compiler dependent so their values must be // These constants are compiler dependent so their values must be
// defined within the implementation. // defined within the implementation.
static int kJSObjectType; V8EXPORT static int kJSObjectType;
static int kFirstNonstringType; V8EXPORT static int kFirstNonstringType;
static int kProxyType; V8EXPORT static int kProxyType;
static inline bool HasHeapObjectTag(internal::Object* value) { static inline bool HasHeapObjectTag(internal::Object* value) {
return ((reinterpret_cast<intptr_t>(value) & kHeapObjectTagMask) == return ((reinterpret_cast<intptr_t>(value) & kHeapObjectTagMask) ==
......
...@@ -91,13 +91,15 @@ TEST(NonStrDecimalLiteral) { ...@@ -91,13 +91,15 @@ TEST(NonStrDecimalLiteral) {
CHECK_EQ(0.0, StringToDouble(" ", NO_FLAGS)); CHECK_EQ(0.0, StringToDouble(" ", NO_FLAGS));
} }
class OneBit1: public BitField<uint32_t, 0, 1> {};
class OneBit2: public BitField<uint32_t, 7, 1> {};
class EightBit1: public BitField<uint32_t, 0, 8> {};
class EightBit2: public BitField<uint32_t, 13, 8> {};
TEST(BitField) { TEST(BitField) {
uint32_t x; uint32_t x;
// One bit bit field can hold values 0 and 1. // One bit bit field can hold values 0 and 1.
class OneBit1: public BitField<uint32_t, 0, 1> {};
class OneBit2: public BitField<uint32_t, 7, 1> {};
CHECK(!OneBit1::is_valid(static_cast<uint32_t>(-1))); CHECK(!OneBit1::is_valid(static_cast<uint32_t>(-1)));
CHECK(!OneBit2::is_valid(static_cast<uint32_t>(-1))); CHECK(!OneBit2::is_valid(static_cast<uint32_t>(-1)));
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
...@@ -113,8 +115,6 @@ TEST(BitField) { ...@@ -113,8 +115,6 @@ TEST(BitField) {
CHECK(!OneBit2::is_valid(2)); CHECK(!OneBit2::is_valid(2));
// Eight bit bit field can hold values from 0 tp 255. // Eight bit bit field can hold values from 0 tp 255.
class EightBit1: public BitField<uint32_t, 0, 8> {};
class EightBit2: public BitField<uint32_t, 13, 8> {};
CHECK(!EightBit1::is_valid(static_cast<uint32_t>(-1))); CHECK(!EightBit1::is_valid(static_cast<uint32_t>(-1)));
CHECK(!EightBit2::is_valid(static_cast<uint32_t>(-1))); CHECK(!EightBit2::is_valid(static_cast<uint32_t>(-1)));
for (int i = 0; i < 256; i++) { for (int i = 0; i < 256; i++) {
......
...@@ -48,6 +48,21 @@ static const int DEEP_DEPTH = 8 * 1024; ...@@ -48,6 +48,21 @@ static const int DEEP_DEPTH = 8 * 1024;
static const int SUPER_DEEP_DEPTH = 80 * 1024; static const int SUPER_DEEP_DEPTH = 80 * 1024;
class Resource: public v8::String::ExternalStringResource,
public ZoneObject {
public:
explicit Resource(Vector<const uc16> string): data_(string.start()) {
length_ = string.length();
}
virtual const uint16_t* data() const { return data_; }
virtual size_t length() const { return length_; }
private:
const uc16* data_;
size_t length_;
};
static void InitializeBuildingBlocks( static void InitializeBuildingBlocks(
Handle<String> building_blocks[NUMBER_OF_BUILDING_BLOCKS]) { Handle<String> building_blocks[NUMBER_OF_BUILDING_BLOCKS]) {
// A list of pointers that we don't have any interest in cleaning up. // A list of pointers that we don't have any interest in cleaning up.
...@@ -83,19 +98,6 @@ static void InitializeBuildingBlocks( ...@@ -83,19 +98,6 @@ static void InitializeBuildingBlocks(
break; break;
} }
case 2: { case 2: {
class Resource: public v8::String::ExternalStringResource,
public ZoneObject {
public:
explicit Resource(Vector<const uc16> string): data_(string.start()) {
length_ = string.length();
}
virtual const uint16_t* data() const { return data_; }
virtual size_t length() const { return length_; }
private:
const uc16* data_;
size_t length_;
};
uc16* buf = Zone::NewArray<uc16>(len); uc16* buf = Zone::NewArray<uc16>(len);
for (int j = 0; j < len; j++) { for (int j = 0; j < len; j++) {
buf[j] = gen() % 65536; buf[j] = gen() % 65536;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment