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

Side by Side Diff: src/objects.h

Issue 22601003: Out-of-line constant pool on Arm: Stage 2 - Introduce ConstantPoolArray object. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 V(ALLOCATION_SITE_TYPE) \ 391 V(ALLOCATION_SITE_TYPE) \
392 V(SCRIPT_TYPE) \ 392 V(SCRIPT_TYPE) \
393 V(CODE_CACHE_TYPE) \ 393 V(CODE_CACHE_TYPE) \
394 V(POLYMORPHIC_CODE_CACHE_TYPE) \ 394 V(POLYMORPHIC_CODE_CACHE_TYPE) \
395 V(TYPE_FEEDBACK_INFO_TYPE) \ 395 V(TYPE_FEEDBACK_INFO_TYPE) \
396 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ 396 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \
397 V(BOX_TYPE) \ 397 V(BOX_TYPE) \
398 \ 398 \
399 V(FIXED_ARRAY_TYPE) \ 399 V(FIXED_ARRAY_TYPE) \
400 V(FIXED_DOUBLE_ARRAY_TYPE) \ 400 V(FIXED_DOUBLE_ARRAY_TYPE) \
401 V(CONSTANT_POOL_ARRAY_TYPE) \
401 V(SHARED_FUNCTION_INFO_TYPE) \ 402 V(SHARED_FUNCTION_INFO_TYPE) \
402 \ 403 \
403 V(JS_MESSAGE_OBJECT_TYPE) \ 404 V(JS_MESSAGE_OBJECT_TYPE) \
404 \ 405 \
405 V(JS_VALUE_TYPE) \ 406 V(JS_VALUE_TYPE) \
406 V(JS_DATE_TYPE) \ 407 V(JS_DATE_TYPE) \
407 V(JS_OBJECT_TYPE) \ 408 V(JS_OBJECT_TYPE) \
408 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \ 409 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \
409 V(JS_GENERATOR_OBJECT_TYPE) \ 410 V(JS_GENERATOR_OBJECT_TYPE) \
410 V(JS_MODULE_TYPE) \ 411 V(JS_MODULE_TYPE) \
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 EXTERNAL_BYTE_ARRAY_TYPE, // FIRST_EXTERNAL_ARRAY_TYPE 710 EXTERNAL_BYTE_ARRAY_TYPE, // FIRST_EXTERNAL_ARRAY_TYPE
710 EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE, 711 EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE,
711 EXTERNAL_SHORT_ARRAY_TYPE, 712 EXTERNAL_SHORT_ARRAY_TYPE,
712 EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE, 713 EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE,
713 EXTERNAL_INT_ARRAY_TYPE, 714 EXTERNAL_INT_ARRAY_TYPE,
714 EXTERNAL_UNSIGNED_INT_ARRAY_TYPE, 715 EXTERNAL_UNSIGNED_INT_ARRAY_TYPE,
715 EXTERNAL_FLOAT_ARRAY_TYPE, 716 EXTERNAL_FLOAT_ARRAY_TYPE,
716 EXTERNAL_DOUBLE_ARRAY_TYPE, 717 EXTERNAL_DOUBLE_ARRAY_TYPE,
717 EXTERNAL_PIXEL_ARRAY_TYPE, // LAST_EXTERNAL_ARRAY_TYPE 718 EXTERNAL_PIXEL_ARRAY_TYPE, // LAST_EXTERNAL_ARRAY_TYPE
718 FIXED_DOUBLE_ARRAY_TYPE, 719 FIXED_DOUBLE_ARRAY_TYPE,
720 CONSTANT_POOL_ARRAY_TYPE,
719 FILLER_TYPE, // LAST_DATA_TYPE 721 FILLER_TYPE, // LAST_DATA_TYPE
720 722
721 // Structs. 723 // Structs.
722 DECLARED_ACCESSOR_DESCRIPTOR_TYPE, 724 DECLARED_ACCESSOR_DESCRIPTOR_TYPE,
723 DECLARED_ACCESSOR_INFO_TYPE, 725 DECLARED_ACCESSOR_INFO_TYPE,
724 EXECUTABLE_ACCESSOR_INFO_TYPE, 726 EXECUTABLE_ACCESSOR_INFO_TYPE,
725 ACCESSOR_PAIR_TYPE, 727 ACCESSOR_PAIR_TYPE,
726 ACCESS_CHECK_INFO_TYPE, 728 ACCESS_CHECK_INFO_TYPE,
727 INTERCEPTOR_INFO_TYPE, 729 INTERCEPTOR_INFO_TYPE,
728 CALL_HANDLER_INFO_TYPE, 730 CALL_HANDLER_INFO_TYPE,
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 V(JSModule) \ 997 V(JSModule) \
996 V(Map) \ 998 V(Map) \
997 V(DescriptorArray) \ 999 V(DescriptorArray) \
998 V(TransitionArray) \ 1000 V(TransitionArray) \
999 V(DeoptimizationInputData) \ 1001 V(DeoptimizationInputData) \
1000 V(DeoptimizationOutputData) \ 1002 V(DeoptimizationOutputData) \
1001 V(DependentCode) \ 1003 V(DependentCode) \
1002 V(TypeFeedbackCells) \ 1004 V(TypeFeedbackCells) \
1003 V(FixedArray) \ 1005 V(FixedArray) \
1004 V(FixedDoubleArray) \ 1006 V(FixedDoubleArray) \
1007 V(ConstantPoolArray) \
1005 V(Context) \ 1008 V(Context) \
1006 V(NativeContext) \ 1009 V(NativeContext) \
1007 V(ScopeInfo) \ 1010 V(ScopeInfo) \
1008 V(JSFunction) \ 1011 V(JSFunction) \
1009 V(Code) \ 1012 V(Code) \
1010 V(Oddball) \ 1013 V(Oddball) \
1011 V(SharedFunctionInfo) \ 1014 V(SharedFunctionInfo) \
1012 V(JSValue) \ 1015 V(JSValue) \
1013 V(JSDate) \ 1016 V(JSDate) \
1014 V(JSMessageObject) \ 1017 V(JSMessageObject) \
(...skipping 2028 matching lines...) Expand 10 before | Expand all | Expand 10 after
3043 3046
3044 // Dispatched behavior. 3047 // Dispatched behavior.
3045 DECLARE_PRINTER(FixedDoubleArray) 3048 DECLARE_PRINTER(FixedDoubleArray)
3046 DECLARE_VERIFIER(FixedDoubleArray) 3049 DECLARE_VERIFIER(FixedDoubleArray)
3047 3050
3048 private: 3051 private:
3049 DISALLOW_IMPLICIT_CONSTRUCTORS(FixedDoubleArray); 3052 DISALLOW_IMPLICIT_CONSTRUCTORS(FixedDoubleArray);
3050 }; 3053 };
3051 3054
3052 3055
3056 // ConstantPoolArray describes fixed-sized arrays constant pool entires.
3057 // The format of the pool is:
3058 // [0]: The first index which is a int32 entry
3059 // [1] ... [first int32 entry index - 1]: 64 bit entries
3060 // [first int32 entry index] ... [length]: 32 bit entries
3061 class ConstantPoolArray: public FixedArrayBase {
3062 public:
3063 // Setter and getter for the field storing the first int32 entries index.
3064 inline int first_int32_index();
3065 inline void set_first_int32_index(int index);
3066
3067 // Setter and getter for pool elements.
3068 inline int64_t get_int64_entry(int index);
3069 inline int32_t get_int32_entry(int index);
3070 inline double get_int64_entry_as_double(int index);
3071
3072 MUST_USE_RESULT inline MaybeObject* get(int index);
3073 inline void set(int index, int64_t value);
3074 inline void set(int index, double value);
3075 inline void set(int index, int32_t value);
3076
3077 // Copy operations
3078 MUST_USE_RESULT inline MaybeObject* Copy();
3079
3080 // Garbage collection support.
3081 inline static int SizeFor(int length, int first_int32_index) {
3082 return kFirstOffset + first_int32_index * kInt64Size
3083 + (length - first_int32_index) * kInt32Size;
3084 }
3085
3086 // Code Generation support.
3087 inline int OffsetOfElementAt(int index) {
3088 return SizeFor(index,
3089 index < first_int32_index() ? index : first_int32_index());
3090 }
3091
3092 // Casting.
3093 static inline ConstantPoolArray* cast(Object* obj);
3094
3095 // Layout description.
3096 static const int kFirstInt32IndexOffset = FixedArray::kHeaderSize;
3097 static const int kFirstOffset = kFirstInt32IndexOffset + kPointerSize;
3098
3099 // Dispatched behavior.
3100 DECLARE_PRINTER(ConstantPoolArray)
3101 DECLARE_VERIFIER(ConstantPoolArray)
3102
3103 private:
3104 DISALLOW_IMPLICIT_CONSTRUCTORS(ConstantPoolArray);
3105 };
3106
3107
3053 // DescriptorArrays are fixed arrays used to hold instance descriptors. 3108 // DescriptorArrays are fixed arrays used to hold instance descriptors.
3054 // The format of the these objects is: 3109 // The format of the these objects is:
3055 // [0]: Number of descriptors 3110 // [0]: Number of descriptors
3056 // [1]: Either Smi(0) if uninitialized, or a pointer to small fixed array: 3111 // [1]: Either Smi(0) if uninitialized, or a pointer to small fixed array:
3057 // [0]: pointer to fixed array with enum cache 3112 // [0]: pointer to fixed array with enum cache
3058 // [1]: either Smi(0) or pointer to fixed array with indices 3113 // [1]: either Smi(0) or pointer to fixed array with indices
3059 // [2]: first key 3114 // [2]: first key
3060 // [2 + number of descriptors * kDescriptorSize]: start of slack 3115 // [2 + number of descriptors * kDescriptorSize]: start of slack
3061 class DescriptorArray: public FixedArray { 3116 class DescriptorArray: public FixedArray {
3062 public: 3117 public:
(...skipping 7119 matching lines...) Expand 10 before | Expand all | Expand 10 after
10182 } else { 10237 } else {
10183 value &= ~(1 << bit_position); 10238 value &= ~(1 << bit_position);
10184 } 10239 }
10185 return value; 10240 return value;
10186 } 10241 }
10187 }; 10242 };
10188 10243
10189 } } // namespace v8::internal 10244 } } // namespace v8::internal
10190 10245
10191 #endif // V8_OBJECTS_H_ 10246 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698