Index: src/objects.h |
diff --git a/src/objects.h b/src/objects.h |
index d22df81e860b595cbaa05bf7fe0ec276a54e1c61..22cc08b93ee872946ed306c273d651b2156b6815 100644 |
--- a/src/objects.h |
+++ b/src/objects.h |
@@ -359,7 +359,6 @@ const int kStubMinorKeyBits = kBitsPerInt - kSmiTagSize - kStubMajorKeyBits; |
V(ODDBALL_TYPE) \ |
V(CELL_TYPE) \ |
V(PROPERTY_CELL_TYPE) \ |
- V(BOX_TYPE) \ |
\ |
V(HEAP_NUMBER_TYPE) \ |
V(FOREIGN_TYPE) \ |
@@ -397,6 +396,7 @@ const int kStubMinorKeyBits = kBitsPerInt - kSmiTagSize - kStubMajorKeyBits; |
V(POLYMORPHIC_CODE_CACHE_TYPE) \ |
V(TYPE_FEEDBACK_INFO_TYPE) \ |
V(ALIASED_ARGUMENTS_ENTRY_TYPE) \ |
+ V(BOX_TYPE) \ |
\ |
V(FIXED_ARRAY_TYPE) \ |
V(FIXED_DOUBLE_ARRAY_TYPE) \ |
@@ -701,7 +701,6 @@ enum InstanceType { |
ODDBALL_TYPE, |
CELL_TYPE, |
PROPERTY_CELL_TYPE, |
- BOX_TYPE, |
// "Data", objects that cannot contain non-map-word pointers to heap |
// objects. |
@@ -740,6 +739,7 @@ enum InstanceType { |
POLYMORPHIC_CODE_CACHE_TYPE, |
TYPE_FEEDBACK_INFO_TYPE, |
ALIASED_ARGUMENTS_ENTRY_TYPE, |
+ BOX_TYPE, |
// The following two instance types are only used when ENABLE_DEBUGGER_SUPPORT |
// is defined. However as include/v8.h contain some of the instance type |
// constants always having them avoids them getting different numbers |
@@ -1646,6 +1646,12 @@ class JSReceiver: public HeapObject { |
CERTAINLY_NOT_STORE_FROM_KEYED |
}; |
+ // Indicates whether a value can be loaded as a constant. |
+ enum StoreMode { |
+ ALLOW_AS_CONSTANT, |
+ FORCE_FIELD |
+ }; |
+ |
// Internal properties (e.g. the hidden properties dictionary) might |
// be added even though the receiver is non-extensible. |
enum ExtensibilityCheck { |
@@ -1873,14 +1879,16 @@ class JSObject: public JSReceiver { |
Object* value, |
PropertyAttributes attributes, |
StrictModeFlag strict_mode, |
- ExtensibilityCheck extensibility_check); |
+ ExtensibilityCheck extensibility_check, |
+ StoreMode mode = ALLOW_AS_CONSTANT); |
static Handle<Object> SetLocalPropertyIgnoreAttributes( |
Handle<JSObject> object, |
Handle<Name> key, |
Handle<Object> value, |
PropertyAttributes attributes, |
- ValueType value_type = OPTIMAL_REPRESENTATION); |
+ ValueType value_type = OPTIMAL_REPRESENTATION, |
+ StoreMode mode = ALLOW_AS_CONSTANT); |
static inline Handle<String> ExpectedTransitionKey(Handle<Map> map); |
static inline Handle<Map> ExpectedTransitionTarget(Handle<Map> map); |
@@ -1908,7 +1916,8 @@ class JSObject: public JSReceiver { |
Name* key, |
Object* value, |
PropertyAttributes attributes, |
- ValueType value_type = OPTIMAL_REPRESENTATION); |
+ ValueType value_type = OPTIMAL_REPRESENTATION, |
+ StoreMode mode = ALLOW_AS_CONSTANT); |
// Retrieve a value in a normalized object given a lookup result. |
// Handles the special representation of JS global objects. |
@@ -2207,9 +2216,9 @@ class JSObject: public JSReceiver { |
// normal property is added instead, with a map transition. |
// This avoids the creation of many maps with the same constant |
// function, all orphaned. |
- MUST_USE_RESULT MaybeObject* AddConstantFunctionProperty( |
+ MUST_USE_RESULT MaybeObject* AddConstantProperty( |
Name* name, |
- JSFunction* function, |
+ Object* constant, |
PropertyAttributes attributes); |
MUST_USE_RESULT MaybeObject* ReplaceSlowProperty( |
@@ -2274,7 +2283,8 @@ class JSObject: public JSReceiver { |
StrictModeFlag strict_mode, |
StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED, |
ExtensibilityCheck extensibility_check = PERFORM_EXTENSIBILITY_CHECK, |
- ValueType value_type = OPTIMAL_REPRESENTATION); |
+ ValueType value_type = OPTIMAL_REPRESENTATION, |
+ StoreMode mode = ALLOW_AS_CONSTANT); |
// Convert the object to use the canonical dictionary |
// representation. If the object is expected to have additional properties |
@@ -2865,7 +2875,7 @@ class DescriptorArray: public FixedArray { |
inline PropertyDetails GetDetails(int descriptor_number); |
inline PropertyType GetType(int descriptor_number); |
inline int GetFieldIndex(int descriptor_number); |
- inline JSFunction* GetConstantFunction(int descriptor_number); |
+ inline Object* GetConstant(int descriptor_number); |
inline Object* GetCallbacksObject(int descriptor_number); |
inline AccessorDescriptor* GetCallbacks(int descriptor_number); |
@@ -4520,7 +4530,7 @@ class Code: public HeapObject { |
enum StubType { |
NORMAL, |
FIELD, |
- CONSTANT_FUNCTION, |
+ CONSTANT, |
CALLBACKS, |
INTERCEPTOR, |
MAP_TRANSITION, |
@@ -4563,7 +4573,7 @@ class Code: public HeapObject { |
// [type_feedback_info]: Struct containing type feedback information for |
// unoptimized code. Optimized code can temporarily store the head of |
- // the list of the dependent optimized functions during deoptimization. |
+ // the list of code to be deoptimized during mark-compact GC. |
// STUBs can use this slot to store arbitrary information as a Smi. |
// Will contain either a TypeFeedbackInfo object, or JSFunction object, |
// or undefined, or a Smi. |
@@ -4571,8 +4581,11 @@ class Code: public HeapObject { |
inline void InitializeTypeFeedbackInfoNoWriteBarrier(Object* value); |
inline int stub_info(); |
inline void set_stub_info(int info); |
- inline Object* deoptimizing_functions(); |
- inline void set_deoptimizing_functions(Object* value); |
+ |
+ // Used during GC to code a list of code objects to deoptimize. |
+ inline Object* code_to_deoptimize_link(); |
+ inline void set_code_to_deoptimize_link(Object* value); |
+ inline Object** code_to_deoptimize_link_slot(); |
// [gc_metadata]: Field used to hold GC related metadata. The contents of this |
// field does not have to be traced during garbage collection since |
@@ -5628,6 +5641,7 @@ class Map: public HeapObject { |
inline void NotifyLeafMapLayoutChange(); |
inline bool CanOmitPrototypeChecks(); |
+ inline bool CanOmitMapChecks(); |
void AddDependentCompilationInfo(DependentCode::DependencyGroup group, |
CompilationInfo* info); |
@@ -6763,18 +6777,6 @@ class JSFunction: public JSObject { |
// Retrieve the native context from a function's literal array. |
static Context* NativeContextFromLiterals(FixedArray* literals); |
-#ifdef DEBUG |
- bool FunctionsInFunctionListShareSameCode() { |
- Object* current = this; |
- while (!current->IsUndefined()) { |
- JSFunction* function = JSFunction::cast(current); |
- current = function->next_function_link(); |
- if (function->code() != this->code()) return false; |
- } |
- return true; |
- } |
-#endif |
- |
bool PassesHydrogenFilter(); |
// Layout descriptors. The last property (from kNonWeakFieldsEndOffset to |