| OLD | NEW |
| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 #define USE_SIMULATOR 1 | 68 #define USE_SIMULATOR 1 |
| 69 #endif | 69 #endif |
| 70 #if (V8_TARGET_ARCH_MIPS64 && !V8_HOST_ARCH_MIPS64) | 70 #if (V8_TARGET_ARCH_MIPS64 && !V8_HOST_ARCH_MIPS64) |
| 71 #define USE_SIMULATOR 1 | 71 #define USE_SIMULATOR 1 |
| 72 #endif | 72 #endif |
| 73 #endif | 73 #endif |
| 74 | 74 |
| 75 // Determine whether the architecture uses an out-of-line constant pool. | 75 // Determine whether the architecture uses an out-of-line constant pool. |
| 76 #define V8_OOL_CONSTANT_POOL 0 | 76 #define V8_OOL_CONSTANT_POOL 0 |
| 77 | 77 |
| 78 // Determine whether the architecture uses an embedded constant pool |
| 79 // (contiguous constant pool embedded in code object). |
| 80 #if V8_TARGET_ARCH_PPC |
| 81 #define V8_EMBEDDED_CONSTANT_POOL 1 |
| 82 #else |
| 83 #define V8_EMBEDDED_CONSTANT_POOL 0 |
| 84 #endif |
| 85 |
| 78 #ifdef V8_TARGET_ARCH_ARM | 86 #ifdef V8_TARGET_ARCH_ARM |
| 79 // Set stack limit lower for ARM than for other architectures because | 87 // Set stack limit lower for ARM than for other architectures because |
| 80 // stack allocating MacroAssembler takes 120K bytes. | 88 // stack allocating MacroAssembler takes 120K bytes. |
| 81 // See issue crbug.com/405338 | 89 // See issue crbug.com/405338 |
| 82 #define V8_DEFAULT_STACK_SIZE_KB 864 | 90 #define V8_DEFAULT_STACK_SIZE_KB 864 |
| 83 #else | 91 #else |
| 84 // Slightly less than 1MB, since Windows' default stack size for | 92 // Slightly less than 1MB, since Windows' default stack size for |
| 85 // the main execution thread is 1MB for both 32 and 64-bit. | 93 // the main execution thread is 1MB for both 32 and 64-bit. |
| 86 #define V8_DEFAULT_STACK_SIZE_KB 984 | 94 #define V8_DEFAULT_STACK_SIZE_KB 984 |
| 87 #endif | 95 #endif |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 // ParseRestriction is used to restrict the set of valid statements in a | 462 // ParseRestriction is used to restrict the set of valid statements in a |
| 455 // unit of compilation. Restriction violations cause a syntax error. | 463 // unit of compilation. Restriction violations cause a syntax error. |
| 456 enum ParseRestriction { | 464 enum ParseRestriction { |
| 457 NO_PARSE_RESTRICTION, // All expressions are allowed. | 465 NO_PARSE_RESTRICTION, // All expressions are allowed. |
| 458 ONLY_SINGLE_FUNCTION_LITERAL // Only a single FunctionLiteral expression. | 466 ONLY_SINGLE_FUNCTION_LITERAL // Only a single FunctionLiteral expression. |
| 459 }; | 467 }; |
| 460 | 468 |
| 461 // A CodeDesc describes a buffer holding instructions and relocation | 469 // A CodeDesc describes a buffer holding instructions and relocation |
| 462 // information. The instructions start at the beginning of the buffer | 470 // information. The instructions start at the beginning of the buffer |
| 463 // and grow forward, the relocation information starts at the end of | 471 // and grow forward, the relocation information starts at the end of |
| 464 // the buffer and grows backward. | 472 // the buffer and grows backward. A constant pool may exist at the |
| 473 // end of the instructions. |
| 465 // | 474 // |
| 466 // |<--------------- buffer_size ---------------->| | 475 // |<--------------- buffer_size ----------------------------------->| |
| 467 // |<-- instr_size -->| |<-- reloc_size -->| | 476 // |<------------- instr_size ---------->| |<-- reloc_size -->| |
| 468 // +==================+========+==================+ | 477 // | |<- const_pool_size ->| | |
| 469 // | instructions | free | reloc info | | 478 // +=====================================+========+==================+ |
| 470 // +==================+========+==================+ | 479 // | instructions | data | free | reloc info | |
| 480 // +=====================================+========+==================+ |
| 471 // ^ | 481 // ^ |
| 472 // | | 482 // | |
| 473 // buffer | 483 // buffer |
| 474 | 484 |
| 475 struct CodeDesc { | 485 struct CodeDesc { |
| 476 byte* buffer; | 486 byte* buffer; |
| 477 int buffer_size; | 487 int buffer_size; |
| 478 int instr_size; | 488 int instr_size; |
| 479 int reloc_size; | 489 int reloc_size; |
| 490 int constant_pool_size; |
| 480 Assembler* origin; | 491 Assembler* origin; |
| 481 }; | 492 }; |
| 482 | 493 |
| 483 | 494 |
| 484 // Callback function used for iterating objects in heap spaces, | 495 // Callback function used for iterating objects in heap spaces, |
| 485 // for example, scanning heap objects. | 496 // for example, scanning heap objects. |
| 486 typedef int (*HeapObjectCallback)(HeapObject* obj); | 497 typedef int (*HeapObjectCallback)(HeapObject* obj); |
| 487 | 498 |
| 488 | 499 |
| 489 // Callback function used for checking constraints when copying/relocating | 500 // Callback function used for checking constraints when copying/relocating |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 925 inline FunctionKind WithObjectLiteralBit(FunctionKind kind) { | 936 inline FunctionKind WithObjectLiteralBit(FunctionKind kind) { |
| 926 kind = static_cast<FunctionKind>(kind | FunctionKind::kInObjectLiteral); | 937 kind = static_cast<FunctionKind>(kind | FunctionKind::kInObjectLiteral); |
| 927 DCHECK(IsValidFunctionKind(kind)); | 938 DCHECK(IsValidFunctionKind(kind)); |
| 928 return kind; | 939 return kind; |
| 929 } | 940 } |
| 930 } } // namespace v8::internal | 941 } } // namespace v8::internal |
| 931 | 942 |
| 932 namespace i = v8::internal; | 943 namespace i = v8::internal; |
| 933 | 944 |
| 934 #endif // V8_GLOBALS_H_ | 945 #endif // V8_GLOBALS_H_ |
| OLD | NEW |