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

Side by Side Diff: src/objects.h

Issue 7572019: Fix a bug in scope analysis. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix a bug. Created 9 years, 4 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 | « no previous file | src/objects-inl.h » ('j') | src/parser.h » ('J')
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 4714 matching lines...) Expand 10 before | Expand all | Expand 10 after
4725 // True if the function has any duplicated parameter names. 4725 // True if the function has any duplicated parameter names.
4726 DECL_BOOLEAN_ACCESSORS(has_duplicate_parameters) 4726 DECL_BOOLEAN_ACCESSORS(has_duplicate_parameters)
4727 4727
4728 // Indicates whether the function is a native function. 4728 // Indicates whether the function is a native function.
4729 // These needs special threatment in .call and .apply since 4729 // These needs special threatment in .call and .apply since
4730 // null passed as the receiver should not be translated to the 4730 // null passed as the receiver should not be translated to the
4731 // global object. 4731 // global object.
4732 inline bool native(); 4732 inline bool native();
4733 inline void set_native(bool value); 4733 inline void set_native(bool value);
4734 4734
4735 // Indicates that the function was created by the Function function.
4736 // Though it's anonymous, toString should treat it as if it had the name
4737 // "anonymous". We don't set the name itself so that the system does not
4738 // see a binding for it.
4739 inline bool name_should_print_as_anonymous();
4740 inline void set_name_should_print_as_anonymous(bool flag);
4741
4735 // Indicates whether the function is a bound function created using 4742 // Indicates whether the function is a bound function created using
4736 // the bind function. 4743 // the bind function.
4737 inline bool bound(); 4744 inline bool bound();
4738 inline void set_bound(bool value); 4745 inline void set_bound(bool value);
4739 4746
4740 // Indicates whether or not the code in the shared function support 4747 // Indicates whether or not the code in the shared function support
4741 // deoptimization. 4748 // deoptimization.
4742 inline bool has_deoptimization_support(); 4749 inline bool has_deoptimization_support();
4743 4750
4744 // Enable deoptimization support through recompiled code. 4751 // Enable deoptimization support through recompiled code.
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
4910 // The source code start position is in the 30 most significant bits of 4917 // The source code start position is in the 30 most significant bits of
4911 // the start_position_and_type field. 4918 // the start_position_and_type field.
4912 static const int kIsExpressionBit = 0; 4919 static const int kIsExpressionBit = 0;
4913 static const int kIsTopLevelBit = 1; 4920 static const int kIsTopLevelBit = 1;
4914 static const int kStartPositionShift = 2; 4921 static const int kStartPositionShift = 2;
4915 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); 4922 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1);
4916 4923
4917 // Bit positions in compiler_hints. 4924 // Bit positions in compiler_hints.
4918 static const int kCodeAgeSize = 3; 4925 static const int kCodeAgeSize = 3;
4919 static const int kCodeAgeMask = (1 << kCodeAgeSize) - 1; 4926 static const int kCodeAgeMask = (1 << kCodeAgeSize) - 1;
4920 static const int kBoundFunction = 9;
Kevin Millikin (Chromium) 2011/08/04 16:32:09 Strange that this worked. I guess we don't really
4921 4927
4922 enum CompilerHints { 4928 enum CompilerHints {
4923 kHasOnlySimpleThisPropertyAssignments, 4929 kHasOnlySimpleThisPropertyAssignments,
4924 kAllowLazyCompilation, 4930 kAllowLazyCompilation,
4925 kLiveObjectsMayExist, 4931 kLiveObjectsMayExist,
4926 kCodeAgeShift, 4932 kCodeAgeShift,
4927 kOptimizationDisabled = kCodeAgeShift + kCodeAgeSize, 4933 kOptimizationDisabled = kCodeAgeShift + kCodeAgeSize,
4928 kStrictModeFunction, 4934 kStrictModeFunction,
4929 kUsesArguments, 4935 kUsesArguments,
4930 kHasDuplicateParameters, 4936 kHasDuplicateParameters,
4931 kNative 4937 kNative,
4938 kBoundFunction,
4939 kNameShouldPrintAsAnonymous,
4940 kCompilerHintsCount // Pseudo entry
4932 }; 4941 };
4933 4942
4934 private: 4943 private:
4935 #if V8_HOST_ARCH_32_BIT 4944 #if V8_HOST_ARCH_32_BIT
4936 // On 32 bit platforms, compiler hints is a smi. 4945 // On 32 bit platforms, compiler hints is a smi.
4937 static const int kCompilerHintsSmiTagSize = kSmiTagSize; 4946 static const int kCompilerHintsSmiTagSize = kSmiTagSize;
4938 static const int kCompilerHintsSize = kPointerSize; 4947 static const int kCompilerHintsSize = kPointerSize;
4939 #else 4948 #else
4940 // On 64 bit platforms, compiler hints is not a smi, see comment above. 4949 // On 64 bit platforms, compiler hints is not a smi, see comment above.
4941 static const int kCompilerHintsSmiTagSize = 0; 4950 static const int kCompilerHintsSmiTagSize = 0;
4942 static const int kCompilerHintsSize = kIntSize; 4951 static const int kCompilerHintsSize = kIntSize;
4943 #endif 4952 #endif
4944 4953
4954 STATIC_ASSERT(SharedFunctionInfo::kCompilerHintsCount <=
4955 SharedFunctionInfo::kCompilerHintsSize * kBitsPerByte);
4956
4945 public: 4957 public:
4946 // Constants for optimizing codegen for strict mode function and 4958 // Constants for optimizing codegen for strict mode function and
4947 // native tests. 4959 // native tests.
4948 // Allows to use byte-widgh instructions. 4960 // Allows to use byte-widgh instructions.
4949 static const int kStrictModeBitWithinByte = 4961 static const int kStrictModeBitWithinByte =
4950 (kStrictModeFunction + kCompilerHintsSmiTagSize) % kBitsPerByte; 4962 (kStrictModeFunction + kCompilerHintsSmiTagSize) % kBitsPerByte;
4951 4963
4952 static const int kNativeBitWithinByte = 4964 static const int kNativeBitWithinByte =
4953 (kNative + kCompilerHintsSmiTagSize) % kBitsPerByte; 4965 (kNative + kCompilerHintsSmiTagSize) % kBitsPerByte;
4954 4966
(...skipping 2359 matching lines...) Expand 10 before | Expand all | Expand 10 after
7314 } else { 7326 } else {
7315 value &= ~(1 << bit_position); 7327 value &= ~(1 << bit_position);
7316 } 7328 }
7317 return value; 7329 return value;
7318 } 7330 }
7319 }; 7331 };
7320 7332
7321 } } // namespace v8::internal 7333 } } // namespace v8::internal
7322 7334
7323 #endif // V8_OBJECTS_H_ 7335 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « no previous file | src/objects-inl.h » ('j') | src/parser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698