OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 4322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4333 // shared function info. If a function is repeatedly optimized or if | 4333 // shared function info. If a function is repeatedly optimized or if |
4334 // we cannot optimize the function we disable optimization to avoid | 4334 // we cannot optimize the function we disable optimization to avoid |
4335 // spending time attempting to optimize it again. | 4335 // spending time attempting to optimize it again. |
4336 inline bool optimization_disabled(); | 4336 inline bool optimization_disabled(); |
4337 inline void set_optimization_disabled(bool value); | 4337 inline void set_optimization_disabled(bool value); |
4338 | 4338 |
4339 // Indicates whether the function is a strict mode function. | 4339 // Indicates whether the function is a strict mode function. |
4340 inline bool strict_mode(); | 4340 inline bool strict_mode(); |
4341 inline void set_strict_mode(bool value); | 4341 inline void set_strict_mode(bool value); |
4342 | 4342 |
| 4343 // Indicates whether the function is a native ES5 function. |
| 4344 // These needs special threatment in .call and .apply since |
| 4345 // null passed as the receiver should not be translated to the |
| 4346 // global object. |
| 4347 inline bool es5_native(); |
| 4348 inline void set_es5_native(bool value); |
| 4349 |
4343 // Indicates whether or not the code in the shared function support | 4350 // Indicates whether or not the code in the shared function support |
4344 // deoptimization. | 4351 // deoptimization. |
4345 inline bool has_deoptimization_support(); | 4352 inline bool has_deoptimization_support(); |
4346 | 4353 |
4347 // Enable deoptimization support through recompiled code. | 4354 // Enable deoptimization support through recompiled code. |
4348 void EnableDeoptimizationSupport(Code* recompiled); | 4355 void EnableDeoptimizationSupport(Code* recompiled); |
4349 | 4356 |
4350 // Lookup the bailout ID and ASSERT that it exists in the non-optimized | 4357 // Lookup the bailout ID and ASSERT that it exists in the non-optimized |
4351 // code, returns whether it asserted (i.e., always true if assertions are | 4358 // code, returns whether it asserted (i.e., always true if assertions are |
4352 // disabled). | 4359 // disabled). |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4513 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); | 4520 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); |
4514 | 4521 |
4515 // Bit positions in compiler_hints. | 4522 // Bit positions in compiler_hints. |
4516 static const int kHasOnlySimpleThisPropertyAssignments = 0; | 4523 static const int kHasOnlySimpleThisPropertyAssignments = 0; |
4517 static const int kAllowLazyCompilation = 1; | 4524 static const int kAllowLazyCompilation = 1; |
4518 static const int kLiveObjectsMayExist = 2; | 4525 static const int kLiveObjectsMayExist = 2; |
4519 static const int kCodeAgeShift = 3; | 4526 static const int kCodeAgeShift = 3; |
4520 static const int kCodeAgeMask = 0x7; | 4527 static const int kCodeAgeMask = 0x7; |
4521 static const int kOptimizationDisabled = 6; | 4528 static const int kOptimizationDisabled = 6; |
4522 static const int kStrictModeFunction = 7; | 4529 static const int kStrictModeFunction = 7; |
| 4530 static const int kES5Native = 8; |
4523 | 4531 |
4524 private: | 4532 private: |
4525 #if V8_HOST_ARCH_32_BIT | 4533 #if V8_HOST_ARCH_32_BIT |
4526 // On 32 bit platforms, compiler hints is a smi. | 4534 // On 32 bit platforms, compiler hints is a smi. |
4527 static const int kCompilerHintsSmiTagSize = kSmiTagSize; | 4535 static const int kCompilerHintsSmiTagSize = kSmiTagSize; |
4528 static const int kCompilerHintsSize = kPointerSize; | 4536 static const int kCompilerHintsSize = kPointerSize; |
4529 #else | 4537 #else |
4530 // On 64 bit platforms, compiler hints is not a smi, see comment above. | 4538 // On 64 bit platforms, compiler hints is not a smi, see comment above. |
4531 static const int kCompilerHintsSmiTagSize = 0; | 4539 static const int kCompilerHintsSmiTagSize = 0; |
4532 static const int kCompilerHintsSize = kIntSize; | 4540 static const int kCompilerHintsSize = kIntSize; |
4533 #endif | 4541 #endif |
4534 | 4542 |
4535 public: | 4543 public: |
4536 // Constants for optimizing codegen for strict mode function tests. | 4544 // Constants for optimizing codegen for strict mode function and |
| 4545 // es5 native tests. |
4537 // Allows to use byte-widgh instructions. | 4546 // Allows to use byte-widgh instructions. |
4538 static const int kStrictModeBitWithinByte = | 4547 static const int kStrictModeBitWithinByte = |
4539 (kStrictModeFunction + kCompilerHintsSmiTagSize) % kBitsPerByte; | 4548 (kStrictModeFunction + kCompilerHintsSmiTagSize) % kBitsPerByte; |
4540 | 4549 |
| 4550 static const int kES5NativeBitWithinByte = |
| 4551 (kES5Native + kCompilerHintsSmiTagSize) % kBitsPerByte; |
| 4552 |
4541 #if __BYTE_ORDER == __LITTLE_ENDIAN | 4553 #if __BYTE_ORDER == __LITTLE_ENDIAN |
4542 static const int kStrictModeByteOffset = kCompilerHintsOffset + | 4554 static const int kStrictModeByteOffset = kCompilerHintsOffset + |
4543 (kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte; | 4555 (kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte; |
| 4556 static const int kES5NativeByteOffset = kCompilerHintsOffset + |
| 4557 (kES5Native + kCompilerHintsSmiTagSize) / kBitsPerByte; |
4544 #elif __BYTE_ORDER == __BIG_ENDIAN | 4558 #elif __BYTE_ORDER == __BIG_ENDIAN |
4545 static const int kStrictModeByteOffset = kCompilerHintsOffset + | 4559 static const int kStrictModeByteOffset = kCompilerHintsOffset + |
4546 (kCompilerHintsSize - 1) - | 4560 (kCompilerHintsSize - 1) - |
4547 ((kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte); | 4561 ((kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte); |
| 4562 static const int kES5NativeByteOffset = kCompilerHintsOffset + |
| 4563 (kCompilerHintsSize - 1) - |
| 4564 ((kES5Native + kCompilerHintsSmiTagSize) / kBitsPerByte); |
4548 #else | 4565 #else |
4549 #error Unknown byte ordering | 4566 #error Unknown byte ordering |
4550 #endif | 4567 #endif |
4551 | 4568 |
4552 private: | 4569 private: |
4553 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); | 4570 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); |
4554 }; | 4571 }; |
4555 | 4572 |
4556 | 4573 |
4557 // JSFunction describes JavaScript functions. | 4574 // JSFunction describes JavaScript functions. |
(...skipping 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6712 } else { | 6729 } else { |
6713 value &= ~(1 << bit_position); | 6730 value &= ~(1 << bit_position); |
6714 } | 6731 } |
6715 return value; | 6732 return value; |
6716 } | 6733 } |
6717 }; | 6734 }; |
6718 | 6735 |
6719 } } // namespace v8::internal | 6736 } } // namespace v8::internal |
6720 | 6737 |
6721 #endif // V8_OBJECTS_H_ | 6738 #endif // V8_OBJECTS_H_ |
OLD | NEW |