Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Unified Diff: src/objects.cc

Issue 8565005: Fix static const weirdness in both gcc and msvs compatible way. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 88efc3c181d34eea15eed03fb9b964f8211a0585..0a3508dcccabf243d24dd5789a784cf73abeb544 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -205,13 +205,6 @@ MaybeObject* Object::GetPropertyWithReceiver(Object* receiver,
}
-// This may seem strange but the standard requires inline static const
-// definition, and w/o these the code doesn't link when being built in debug
-// mode using gcc.
-const int JSObject::kGetterIndex;
-const int JSObject::kSetterIndex;
-
-
MaybeObject* JSObject::GetPropertyWithCallback(Object* receiver,
Object* structure,
String* name) {
@@ -4638,7 +4631,11 @@ Object* JSObject::LookupAccessor(String* name, bool is_getter) {
}
// Make the lookup and include prototypes.
- int accessor_index = is_getter ? kGetterIndex : kSetterIndex;
+ // Introducing constants below makes static constants usage purely static
+ // and avoids linker errors in debug build using gcc.
+ const int getter_index = kGetterIndex;
+ const int setter_index = kSetterIndex;
+ int accessor_index = is_getter ? getter_index : setter_index;
uint32_t index = 0;
if (name->AsArrayIndex(&index)) {
for (Object* obj = this;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698