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

Side by Side Diff: src/objects.h

Issue 1909903003: [Interpreter] Use FastNewSloppyArguments when possible. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/assert-scope.h" 10 #include "src/assert-scope.h"
(...skipping 7252 matching lines...) Expand 10 before | Expand all | Expand 10 after
7263 7263
7264 STATIC_ASSERT(SharedFunctionInfo::kCompilerHintsCount <= 7264 STATIC_ASSERT(SharedFunctionInfo::kCompilerHintsCount <=
7265 SharedFunctionInfo::kCompilerHintsSize * kBitsPerByte); 7265 SharedFunctionInfo::kCompilerHintsSize * kBitsPerByte);
7266 7266
7267 public: 7267 public:
7268 // Constants for optimizing codegen for strict mode function and 7268 // Constants for optimizing codegen for strict mode function and
7269 // native tests when using integer-width instructions. 7269 // native tests when using integer-width instructions.
7270 static const int kStrictModeBit = 7270 static const int kStrictModeBit =
7271 kStrictModeFunction + kCompilerHintsSmiTagSize; 7271 kStrictModeFunction + kCompilerHintsSmiTagSize;
7272 static const int kNativeBit = kNative + kCompilerHintsSmiTagSize; 7272 static const int kNativeBit = kNative + kCompilerHintsSmiTagSize;
7273 static const int kHasDuplicateParametersBit =
7274 kHasDuplicateParametersBit + kCompilerHintsSmiTagSize;
7273 7275
7274 static const int kClassConstructorBits = 7276 static const int kClassConstructorBits =
7275 FunctionKind::kClassConstructor 7277 FunctionKind::kClassConstructor
7276 << (kFunctionKind + kCompilerHintsSmiTagSize); 7278 << (kFunctionKind + kCompilerHintsSmiTagSize);
7277 7279
7278 // Constants for optimizing codegen for strict mode function and 7280 // Constants for optimizing codegen for strict mode function and
7279 // native tests. 7281 // native tests.
7280 // Allows to use byte-width instructions. 7282 // Allows to use byte-width instructions.
7281 static const int kStrictModeBitWithinByte = kStrictModeBit % kBitsPerByte; 7283 static const int kStrictModeBitWithinByte = kStrictModeBit % kBitsPerByte;
7282 static const int kNativeBitWithinByte = kNativeBit % kBitsPerByte; 7284 static const int kNativeBitWithinByte = kNativeBit % kBitsPerByte;
7285 static const int kHasDuplicateParametersBitWithinByte =
7286 kHasDuplicateParametersBit % kBitsPerByte;
7283 7287
7284 static const int kClassConstructorBitsWithinByte = 7288 static const int kClassConstructorBitsWithinByte =
7285 FunctionKind::kClassConstructor << kCompilerHintsSmiTagSize; 7289 FunctionKind::kClassConstructor << kCompilerHintsSmiTagSize;
7286 STATIC_ASSERT(kClassConstructorBitsWithinByte < (1 << kBitsPerByte)); 7290 STATIC_ASSERT(kClassConstructorBitsWithinByte < (1 << kBitsPerByte));
7287 7291
7288 #if defined(V8_TARGET_LITTLE_ENDIAN) 7292 #if defined(V8_TARGET_LITTLE_ENDIAN)
7289 #define BYTE_OFFSET(compiler_hint) \ 7293 #define BYTE_OFFSET(compiler_hint) \
7290 kCompilerHintsOffset + \ 7294 kCompilerHintsOffset + \
7291 (compiler_hint + kCompilerHintsSmiTagSize) / kBitsPerByte 7295 (compiler_hint + kCompilerHintsSmiTagSize) / kBitsPerByte
7292 #elif defined(V8_TARGET_BIG_ENDIAN) 7296 #elif defined(V8_TARGET_BIG_ENDIAN)
7293 #define BYTE_OFFSET(compiler_hint) \ 7297 #define BYTE_OFFSET(compiler_hint) \
7294 kCompilerHintsOffset + (kCompilerHintsSize - 1) - \ 7298 kCompilerHintsOffset + (kCompilerHintsSize - 1) - \
7295 ((compiler_hint + kCompilerHintsSmiTagSize) / kBitsPerByte) 7299 ((compiler_hint + kCompilerHintsSmiTagSize) / kBitsPerByte)
7296 #else 7300 #else
7297 #error Unknown byte ordering 7301 #error Unknown byte ordering
7298 #endif 7302 #endif
7299 static const int kStrictModeByteOffset = BYTE_OFFSET(kStrictModeFunction); 7303 static const int kStrictModeByteOffset = BYTE_OFFSET(kStrictModeFunction);
7300 static const int kNativeByteOffset = BYTE_OFFSET(kNative); 7304 static const int kNativeByteOffset = BYTE_OFFSET(kNative);
7301 static const int kFunctionKindByteOffset = BYTE_OFFSET(kFunctionKind); 7305 static const int kFunctionKindByteOffset = BYTE_OFFSET(kFunctionKind);
7306 static const int kHasDuplicateParametersByteOffset =
7307 BYTE_OFFSET(kHasDuplicateParameters);
7302 #undef BYTE_OFFSET 7308 #undef BYTE_OFFSET
7303 7309
7304 private: 7310 private:
7305 // Returns entry from optimized code map for specified context and OSR entry. 7311 // Returns entry from optimized code map for specified context and OSR entry.
7306 // The result is either kNotFound, kSharedCodeIndex for context-independent 7312 // The result is either kNotFound, kSharedCodeIndex for context-independent
7307 // entry or a start index of the context-dependent entry. 7313 // entry or a start index of the context-dependent entry.
7308 int SearchOptimizedCodeMapEntry(Context* native_context, 7314 int SearchOptimizedCodeMapEntry(Context* native_context,
7309 BailoutId osr_ast_id); 7315 BailoutId osr_ast_id);
7310 7316
7311 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); 7317 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo);
(...skipping 3484 matching lines...) Expand 10 before | Expand all | Expand 10 after
10796 } 10802 }
10797 return value; 10803 return value;
10798 } 10804 }
10799 }; 10805 };
10800 10806
10801 10807
10802 } // NOLINT, false-positive due to second-order macros. 10808 } // NOLINT, false-positive due to second-order macros.
10803 } // NOLINT, false-positive due to second-order macros. 10809 } // NOLINT, false-positive due to second-order macros.
10804 10810
10805 #endif // V8_OBJECTS_H_ 10811 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698