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

Side by Side Diff: src/objects.h

Issue 7012012: Only send null or undefined as receiver for es5 natives, not generally (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4331 matching lines...) Expand 10 before | Expand all | Expand 10 after
4342 // shared function info. If a function is repeatedly optimized or if 4342 // shared function info. If a function is repeatedly optimized or if
4343 // we cannot optimize the function we disable optimization to avoid 4343 // we cannot optimize the function we disable optimization to avoid
4344 // spending time attempting to optimize it again. 4344 // spending time attempting to optimize it again.
4345 inline bool optimization_disabled(); 4345 inline bool optimization_disabled();
4346 inline void set_optimization_disabled(bool value); 4346 inline void set_optimization_disabled(bool value);
4347 4347
4348 // Indicates whether the function is a strict mode function. 4348 // Indicates whether the function is a strict mode function.
4349 inline bool strict_mode(); 4349 inline bool strict_mode();
4350 inline void set_strict_mode(bool value); 4350 inline void set_strict_mode(bool value);
4351 4351
4352 // Indicates whether the function is a native ES5 function.
4353 // These needs special threatment in .call and .apply since
4354 // null passed as the receiver should not be translated to the
4355 // global object.
4356 inline bool es5_native();
4357 inline void set_es5_native(bool value);
4358
4352 // Indicates whether or not the code in the shared function support 4359 // Indicates whether or not the code in the shared function support
4353 // deoptimization. 4360 // deoptimization.
4354 inline bool has_deoptimization_support(); 4361 inline bool has_deoptimization_support();
4355 4362
4356 // Enable deoptimization support through recompiled code. 4363 // Enable deoptimization support through recompiled code.
4357 void EnableDeoptimizationSupport(Code* recompiled); 4364 void EnableDeoptimizationSupport(Code* recompiled);
4358 4365
4359 // Lookup the bailout ID and ASSERT that it exists in the non-optimized 4366 // Lookup the bailout ID and ASSERT that it exists in the non-optimized
4360 // code, returns whether it asserted (i.e., always true if assertions are 4367 // code, returns whether it asserted (i.e., always true if assertions are
4361 // disabled). 4368 // disabled).
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
4522 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); 4529 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1);
4523 4530
4524 // Bit positions in compiler_hints. 4531 // Bit positions in compiler_hints.
4525 static const int kHasOnlySimpleThisPropertyAssignments = 0; 4532 static const int kHasOnlySimpleThisPropertyAssignments = 0;
4526 static const int kAllowLazyCompilation = 1; 4533 static const int kAllowLazyCompilation = 1;
4527 static const int kLiveObjectsMayExist = 2; 4534 static const int kLiveObjectsMayExist = 2;
4528 static const int kCodeAgeShift = 3; 4535 static const int kCodeAgeShift = 3;
4529 static const int kCodeAgeMask = 0x7; 4536 static const int kCodeAgeMask = 0x7;
4530 static const int kOptimizationDisabled = 6; 4537 static const int kOptimizationDisabled = 6;
4531 static const int kStrictModeFunction = 7; 4538 static const int kStrictModeFunction = 7;
4539 static const int kES5Native = 8;
4532 4540
4533 private: 4541 private:
4534 #if V8_HOST_ARCH_32_BIT 4542 #if V8_HOST_ARCH_32_BIT
4535 // On 32 bit platforms, compiler hints is a smi. 4543 // On 32 bit platforms, compiler hints is a smi.
4536 static const int kCompilerHintsSmiTagSize = kSmiTagSize; 4544 static const int kCompilerHintsSmiTagSize = kSmiTagSize;
4537 static const int kCompilerHintsSize = kPointerSize; 4545 static const int kCompilerHintsSize = kPointerSize;
4538 #else 4546 #else
4539 // On 64 bit platforms, compiler hints is not a smi, see comment above. 4547 // On 64 bit platforms, compiler hints is not a smi, see comment above.
4540 static const int kCompilerHintsSmiTagSize = 0; 4548 static const int kCompilerHintsSmiTagSize = 0;
4541 static const int kCompilerHintsSize = kIntSize; 4549 static const int kCompilerHintsSize = kIntSize;
4542 #endif 4550 #endif
4543 4551
4544 public: 4552 public:
4545 // Constants for optimizing codegen for strict mode function tests. 4553 // Constants for optimizing codegen for strict mode function and
4554 // es5 native tests.
4546 // Allows to use byte-widgh instructions. 4555 // Allows to use byte-widgh instructions.
4547 static const int kStrictModeBitWithinByte = 4556 static const int kStrictModeBitWithinByte =
4548 (kStrictModeFunction + kCompilerHintsSmiTagSize) % kBitsPerByte; 4557 (kStrictModeFunction + kCompilerHintsSmiTagSize) % kBitsPerByte;
4549 4558
4559 static const int kES5NativeBitWithinByte =
4560 (kES5Native + kCompilerHintsSmiTagSize) % kBitsPerByte;
4561
4550 #if __BYTE_ORDER == __LITTLE_ENDIAN 4562 #if __BYTE_ORDER == __LITTLE_ENDIAN
4551 static const int kStrictModeByteOffset = kCompilerHintsOffset + 4563 static const int kStrictModeByteOffset = kCompilerHintsOffset +
4552 (kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte; 4564 (kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte;
4565 static const int kES5NativeByteOffset = kCompilerHintsOffset +
4566 (kES5Native + kCompilerHintsSmiTagSize) / kBitsPerByte;
4553 #elif __BYTE_ORDER == __BIG_ENDIAN 4567 #elif __BYTE_ORDER == __BIG_ENDIAN
4554 static const int kStrictModeByteOffset = kCompilerHintsOffset + 4568 static const int kStrictModeByteOffset = kCompilerHintsOffset +
4555 (kCompilerHintsSize - 1) - 4569 (kCompilerHintsSize - 1) -
4556 ((kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte); 4570 ((kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte);
4571 static const int kES5NativeByteOffset = kCompilerHintsOffset +
4572 (kCompilerHintsSize - 1) -
4573 ((kES5Native + kCompilerHintsSmiTagSize) / kBitsPerByte);
4557 #else 4574 #else
4558 #error Unknown byte ordering 4575 #error Unknown byte ordering
4559 #endif 4576 #endif
4560 4577
4561 private: 4578 private:
4562 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); 4579 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo);
4563 }; 4580 };
4564 4581
4565 4582
4566 // JSFunction describes JavaScript functions. 4583 // JSFunction describes JavaScript functions.
(...skipping 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after
6721 } else { 6738 } else {
6722 value &= ~(1 << bit_position); 6739 value &= ~(1 << bit_position);
6723 } 6740 }
6724 return value; 6741 return value;
6725 } 6742 }
6726 }; 6743 };
6727 6744
6728 } } // namespace v8::internal 6745 } } // namespace v8::internal
6729 6746
6730 #endif // V8_OBJECTS_H_ 6747 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698