Author: [email protected]
Date: Thu Jul 16 22:37:09 2009
New Revision: 2492
Added:
branches/bleeding_edge/src/frame-element.cc (contents, props changed)
Modified:
branches/bleeding_edge/src/SConscript
branches/bleeding_edge/src/frame-element.h
branches/bleeding_edge/src/ia32/register-allocator-ia32-inl.h
branches/bleeding_edge/src/parser.cc
branches/bleeding_edge/src/register-allocator.cc
branches/bleeding_edge/src/register-allocator.h
branches/bleeding_edge/tools/gyp/v8.gyp
branches/bleeding_edge/tools/visual_studio/v8_base.vcproj
branches/bleeding_edge/tools/visual_studio/v8_base_arm.vcproj
Log:
Patch by Mark Mentovai. Don't put static variables inline.
Original review: http://codereview.chromium.org/149768
[email protected]
Review URL: http://codereview.chromium.org/155679
Modified: branches/bleeding_edge/src/SConscript
==============================================================================
--- branches/bleeding_edge/src/SConscript (original)
+++ branches/bleeding_edge/src/SConscript Thu Jul 16 22:37:09 2009
@@ -40,7 +40,7 @@
'codegen.cc', 'compilation-cache.cc', 'compiler.cc', 'contexts.cc',
'conversions.cc', 'counters.cc', 'dateparser.cc', 'debug.cc',
'debug-agent.cc', 'disassembler.cc', 'execution.cc', 'factory.cc',
- 'flags.cc', 'frames.cc', 'func-name-inferrer.cc',
+ 'flags.cc', 'frame-element.cc', 'frames.cc', 'func-name-inferrer.cc',
'global-handles.cc', 'handles.cc', 'hashmap.cc',
'heap.cc', 'ic.cc', 'interpreter-irregexp.cc', 'jsregexp.cc',
'jump-target.cc', 'log.cc', 'log-utils.cc', 'mark-compact.cc',
'messages.cc',
Added: branches/bleeding_edge/src/frame-element.cc
==============================================================================
--- (empty file)
+++ branches/bleeding_edge/src/frame-element.cc Thu Jul 16 22:37:09 2009
@@ -0,0 +1,45 @@
+// Copyright 2009 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "v8.h"
+
+#include "frame-element.h"
+
+namespace v8 {
+namespace internal {
+
+//
-------------------------------------------------------------------------
+// FrameElement implementation.
+
+
+FrameElement::ZoneObjectList* FrameElement::ConstantList() {
+ static ZoneObjectList list(10);
+ return &list;
+}
+
+
+} } // namespace v8::internal
Modified: branches/bleeding_edge/src/frame-element.h
==============================================================================
--- branches/bleeding_edge/src/frame-element.h (original)
+++ branches/bleeding_edge/src/frame-element.h Thu Jul 16 22:37:09 2009
@@ -91,10 +91,7 @@
// this table of handles to the actual constants.
typedef ZoneList<Handle<Object> > ZoneObjectList;
- static ZoneObjectList* ConstantList() {
- static ZoneObjectList list(10);
- return &list;
- }
+ static ZoneObjectList* ConstantList();
// Clear the constants indirection table.
static void ClearConstantList() {
Modified: branches/bleeding_edge/src/ia32/register-allocator-ia32-inl.h
==============================================================================
--- branches/bleeding_edge/src/ia32/register-allocator-ia32-inl.h
(original)
+++ branches/bleeding_edge/src/ia32/register-allocator-ia32-inl.h Thu Jul
16 22:37:09 2009
@@ -65,7 +65,7 @@
Register RegisterAllocator::ToRegister(int num) {
ASSERT(num >= 0 && num < kNumRegisters);
- static Register registers[] = { eax, ebx, ecx, edx, edi };
+ const Register registers[] = { eax, ebx, ecx, edx, edi };
return registers[num];
}
Modified: branches/bleeding_edge/src/parser.cc
==============================================================================
--- branches/bleeding_edge/src/parser.cc (original)
+++ branches/bleeding_edge/src/parser.cc Thu Jul 16 22:37:09 2009
@@ -834,12 +834,7 @@
return new CallEval(expression, arguments, pos);
}
- virtual Statement* EmptyStatement() {
- // Use a statically allocated empty statement singleton to avoid
- // allocating lots and lots of empty statements.
- static v8::internal::EmptyStatement empty;
- return ∅
- }
+ virtual Statement* EmptyStatement();
};
@@ -1029,6 +1024,14 @@
Scope* result = new Scope(parent, type);
result->Initialize(inside_with);
return result;
+}
+
+
+Statement* AstBuildingParserFactory::EmptyStatement() {
+ // Use a statically allocated empty statement singleton to avoid
+ // allocating lots and lots of empty statements.
+ static v8::internal::EmptyStatement empty;
+ return ∅
}
Modified: branches/bleeding_edge/src/register-allocator.cc
==============================================================================
--- branches/bleeding_edge/src/register-allocator.cc (original)
+++ branches/bleeding_edge/src/register-allocator.cc Thu Jul 16 22:37:09
2009
@@ -44,6 +44,12 @@
}
+Result::ZoneObjectList* Result::ConstantList() {
+ static ZoneObjectList list(10);
+ return &list;
+}
+
+
//
-------------------------------------------------------------------------
// RegisterAllocator implementation.
Modified: branches/bleeding_edge/src/register-allocator.h
==============================================================================
--- branches/bleeding_edge/src/register-allocator.h (original)
+++ branches/bleeding_edge/src/register-allocator.h Thu Jul 16 22:37:09 2009
@@ -92,10 +92,7 @@
// of handles to the actual constants.
typedef ZoneList<Handle<Object> > ZoneObjectList;
- static ZoneObjectList* ConstantList() {
- static ZoneObjectList list(10);
- return &list;
- }
+ static ZoneObjectList* ConstantList();
// Clear the constants indirection table.
static void ClearConstantList() {
Modified: branches/bleeding_edge/tools/gyp/v8.gyp
==============================================================================
--- branches/bleeding_edge/tools/gyp/v8.gyp (original)
+++ branches/bleeding_edge/tools/gyp/v8.gyp Thu Jul 16 22:37:09 2009
@@ -254,6 +254,7 @@
'../../src/frames-inl.h',
'../../src/frames.cc',
'../../src/frames.h',
+ '../../src/frame-element.cc',
'../../src/frame-element.h',
'../../src/func-name-inferrer.cc',
'../../src/func-name-inferrer.h',
Modified: branches/bleeding_edge/tools/visual_studio/v8_base.vcproj
==============================================================================
--- branches/bleeding_edge/tools/visual_studio/v8_base.vcproj (original)
+++ branches/bleeding_edge/tools/visual_studio/v8_base.vcproj Thu Jul 16
22:37:09 2009
@@ -397,19 +397,23 @@
>
</File>
<File
- RelativePath="..\..\src\ia32\frames-ia32.cc"
+ RelativePath="..\..\src\frame-element.cc"
>
</File>
<File
- RelativePath="..\..\src\ia32\frames-ia32.h"
+ RelativePath="..\..\src\frame-element.h"
>
</File>
<File
- RelativePath="..\..\src\frames-inl.h"
+ RelativePath="..\..\src\ia32\frames-ia32.cc"
>
</File>
<File
- RelativePath="..\..\src\frame-element.h"
+ RelativePath="..\..\src\ia32\frames-ia32.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\frames-inl.h"
>
</File>
<File
Modified: branches/bleeding_edge/tools/visual_studio/v8_base_arm.vcproj
==============================================================================
--- branches/bleeding_edge/tools/visual_studio/v8_base_arm.vcproj
(original)
+++ branches/bleeding_edge/tools/visual_studio/v8_base_arm.vcproj Thu Jul
16 22:37:09 2009
@@ -401,6 +401,14 @@
>
</File>
<File
+ RelativePath="..\..\src\frame-element.cc"
+ >
+ </File>
+ <File
+ RelativePath="..\..\src\frame-element.h"
+ >
+ </File>
+ <File
RelativePath="..\..\src\arm\frames-arm.cc"
>
</File>
--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---