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

Issue 99355: Introduce processor detection in globals.h, instead of from the build system. (Closed)

Created:
11 years, 7 months ago by Dean McNamee
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Introduce two separate classes of processor detection: - TARGET, the architecture we will generate code for. This is brought it from the build system. - HOST, the architecture our C++ compiler is building for. This is detected automatically based on compiler defines. This adds macros for 32 or 64 bit, and cleans up some include conditionals, etc.

Patch Set 1 #

Total comments: 15

Patch Set 2 : New snapshot. #

Total comments: 4

Patch Set 3 : Guard 64-bit literals around 64-bit. Switch to long. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+82 lines, -97 lines) Patch
M SConstruct View 5 chunks +7 lines, -7 lines 0 comments Download
M src/codegen.h View 1 1 chunk +5 lines, -9 lines 0 comments Download
M src/execution.cc View 1 1 chunk +5 lines, -9 lines 0 comments Download
M src/frames-inl.h View 1 1 chunk +5 lines, -9 lines 0 comments Download
M src/globals.h View 1 2 5 chunks +26 lines, -9 lines 0 comments Download
M src/jsregexp.h View 1 1 chunk +3 lines, -7 lines 0 comments Download
M src/jsregexp.cc View 1 5 chunks +13 lines, -21 lines 0 comments Download
M src/macro-assembler.h View 1 1 chunk +10 lines, -14 lines 0 comments Download
M src/objects.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M src/utils.h View 1 chunk +1 line, -1 line 0 comments Download
M src/virtual-frame.h View 1 1 chunk +5 lines, -9 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Dean McNamee
Hey Ivan, I didn't have the chance to finish this today, so I just check ...
11 years, 7 months ago (2009-05-04 17:56:19 UTC) #1
iposva
Dean, Thanks for the very informative writeup on how to best determine the host architecture. ...
11 years, 7 months ago (2009-05-05 04:44:27 UTC) #2
Lasse Reichstein
http://codereview.chromium.org/99355/diff/1/2 File src/codegen.h (right): http://codereview.chromium.org/99355/diff/1/2#newcode79 Line 79: #if ARCH_CPU_X86 Should it be #if defined(ARCH_CPU_X86) ? ...
11 years, 7 months ago (2009-05-05 08:57:59 UTC) #3
Dean McNamee
http://codereview.chromium.org/99355/diff/1/2 File src/codegen.h (right): http://codereview.chromium.org/99355/diff/1/2#newcode79 Line 79: #if ARCH_CPU_X86 On 2009/05/05 08:57:59, Lasse Reichstein wrote: ...
11 years, 7 months ago (2009-05-05 11:16:23 UTC) #4
Dean McNamee
Please take a look
11 years, 7 months ago (2009-05-05 11:28:34 UTC) #5
Lasse Reichstein
LGTM, with comments. http://codereview.chromium.org/99355/diff/2006/2011 File src/globals.h (right): http://codereview.chromium.org/99355/diff/2006/2011#newcode50 Line 50: #endif Much better. I would ...
11 years, 7 months ago (2009-05-05 11:44:31 UTC) #6
Dean McNamee
11 years, 7 months ago (2009-05-05 11:56:12 UTC) #7
http://codereview.chromium.org/99355/diff/2006/2011
File src/globals.h (right):

http://codereview.chromium.org/99355/diff/2006/2011#newcode50
Line 50: #endif
On 2009/05/05 11:44:31, Lasse Reichstein wrote:
> Much better.
> I would prefer a non-host wordsize selector, e.g.,
> V8_ARCH_32BIT or V8_HEAP_32BIT, although the V8_HOST_ARCH_32_BIT might also be
> useful.
> 
> Perhaps a define the heap bit-ness depending on host bits and target
> architecture (with errors if they don't match).
> 
> This is only because I don't want to say that it's the host wordsize alone
that
> determines our memory model. It really is the combination of target
architecture
> and runtime system architecture (which is why a 64-bit ARM simulator should
> cause an error).

I think right now this is an un-needed and confusing level of abstraction.  We
can't have a 64-bit heap on a 32-bit host.  They are not really independent
concepts.

We aren't going to be able to run the 32-bit arm simulator on 64-bit, because
the runtime will be using 64-bit pointers.  I think really for now it is
simplest to just go off of the host bit-ness.

If we decide we need this in the future, we could definitely add it, but right
now I think we're thinking too far ahead of ourselves and making things
confusing.  Let's keep them simple for now.

http://codereview.chromium.org/99355/diff/2006/2011#newcode79
Line 79: #define V8_UINT64_C(x)  (x ## ULL)
On 2009/05/05 11:44:31, Lasse Reichstein wrote:
> Change to #UL and only enable it in 64-bit mode.
> Our way of compiling (probably -pedantic) does not allow long long literals.

Fixed.

Powered by Google App Engine
This is Rietveld 408576698