Chromium Code Reviews

Side by Side Diff: src/globals.h

Issue 1131783003: Embedded constant pools. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_GLOBALS_H_ 5 #ifndef V8_GLOBALS_H_
6 #define V8_GLOBALS_H_ 6 #define V8_GLOBALS_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 56 matching lines...)
67 #define USE_SIMULATOR 1 67 #define USE_SIMULATOR 1
68 #endif 68 #endif
69 #if (V8_TARGET_ARCH_MIPS && !V8_HOST_ARCH_MIPS) 69 #if (V8_TARGET_ARCH_MIPS && !V8_HOST_ARCH_MIPS)
70 #define USE_SIMULATOR 1 70 #define USE_SIMULATOR 1
71 #endif 71 #endif
72 #if (V8_TARGET_ARCH_MIPS64 && !V8_HOST_ARCH_MIPS64) 72 #if (V8_TARGET_ARCH_MIPS64 && !V8_HOST_ARCH_MIPS64)
73 #define USE_SIMULATOR 1 73 #define USE_SIMULATOR 1
74 #endif 74 #endif
75 #endif 75 #endif
76 76
77 // Determine whether the architecture uses an out-of-line constant pool. 77 // Determine whether the architecture uses an embedded constant pool
78 #define V8_OOL_CONSTANT_POOL 0 78 // (contiguous constant pool embedded in code object).
79 #if V8_TARGET_ARCH_PPC
80 #define V8_EMBEDDED_CONSTANT_POOL 1
81 #else
82 #define V8_EMBEDDED_CONSTANT_POOL 0
83 #endif
79 84
80 #ifdef V8_TARGET_ARCH_ARM 85 #ifdef V8_TARGET_ARCH_ARM
81 // Set stack limit lower for ARM than for other architectures because 86 // Set stack limit lower for ARM than for other architectures because
82 // stack allocating MacroAssembler takes 120K bytes. 87 // stack allocating MacroAssembler takes 120K bytes.
83 // See issue crbug.com/405338 88 // See issue crbug.com/405338
84 #define V8_DEFAULT_STACK_SIZE_KB 864 89 #define V8_DEFAULT_STACK_SIZE_KB 864
85 #else 90 #else
86 // Slightly less than 1MB, since Windows' default stack size for 91 // Slightly less than 1MB, since Windows' default stack size for
87 // the main execution thread is 1MB for both 32 and 64-bit. 92 // the main execution thread is 1MB for both 32 and 64-bit.
88 #define V8_DEFAULT_STACK_SIZE_KB 984 93 #define V8_DEFAULT_STACK_SIZE_KB 984
(...skipping 379 matching lines...)
468 // ParseRestriction is used to restrict the set of valid statements in a 473 // ParseRestriction is used to restrict the set of valid statements in a
469 // unit of compilation. Restriction violations cause a syntax error. 474 // unit of compilation. Restriction violations cause a syntax error.
470 enum ParseRestriction { 475 enum ParseRestriction {
471 NO_PARSE_RESTRICTION, // All expressions are allowed. 476 NO_PARSE_RESTRICTION, // All expressions are allowed.
472 ONLY_SINGLE_FUNCTION_LITERAL // Only a single FunctionLiteral expression. 477 ONLY_SINGLE_FUNCTION_LITERAL // Only a single FunctionLiteral expression.
473 }; 478 };
474 479
475 // A CodeDesc describes a buffer holding instructions and relocation 480 // A CodeDesc describes a buffer holding instructions and relocation
476 // information. The instructions start at the beginning of the buffer 481 // information. The instructions start at the beginning of the buffer
477 // and grow forward, the relocation information starts at the end of 482 // and grow forward, the relocation information starts at the end of
478 // the buffer and grows backward. 483 // the buffer and grows backward. A constant pool may exist at the
484 // end of the instructions.
479 // 485 //
480 // |<--------------- buffer_size ---------------->| 486 // |<--------------- buffer_size ----------------------------------->|
481 // |<-- instr_size -->| |<-- reloc_size -->| 487 // |<------------- instr_size ---------->| |<-- reloc_size -->|
482 // +==================+========+==================+ 488 // | |<- const_pool_size ->| |
483 // | instructions | free | reloc info | 489 // +=====================================+========+==================+
484 // +==================+========+==================+ 490 // | instructions | data | free | reloc info |
491 // +=====================================+========+==================+
485 // ^ 492 // ^
486 // | 493 // |
487 // buffer 494 // buffer
488 495
489 struct CodeDesc { 496 struct CodeDesc {
490 byte* buffer; 497 byte* buffer;
491 int buffer_size; 498 int buffer_size;
492 int instr_size; 499 int instr_size;
493 int reloc_size; 500 int reloc_size;
501 int constant_pool_size;
494 Assembler* origin; 502 Assembler* origin;
495 }; 503 };
496 504
497 505
498 // Callback function used for iterating objects in heap spaces, 506 // Callback function used for iterating objects in heap spaces,
499 // for example, scanning heap objects. 507 // for example, scanning heap objects.
500 typedef int (*HeapObjectCallback)(HeapObject* obj); 508 typedef int (*HeapObjectCallback)(HeapObject* obj);
501 509
502 510
503 // Callback function used for checking constraints when copying/relocating 511 // Callback function used for checking constraints when copying/relocating
(...skipping 443 matching lines...)
947 inline FunctionKind WithObjectLiteralBit(FunctionKind kind) { 955 inline FunctionKind WithObjectLiteralBit(FunctionKind kind) {
948 kind = static_cast<FunctionKind>(kind | FunctionKind::kInObjectLiteral); 956 kind = static_cast<FunctionKind>(kind | FunctionKind::kInObjectLiteral);
949 DCHECK(IsValidFunctionKind(kind)); 957 DCHECK(IsValidFunctionKind(kind));
950 return kind; 958 return kind;
951 } 959 }
952 } } // namespace v8::internal 960 } } // namespace v8::internal
953 961
954 namespace i = v8::internal; 962 namespace i = v8::internal;
955 963
956 #endif // V8_GLOBALS_H_ 964 #endif // V8_GLOBALS_H_
OLDNEW

Powered by Google App Engine