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

Unified Diff: src/runtime.cc

Issue 19485008: Replace CONSTANT_FUNCTION by CONSTANT (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/property-details.h ('k') | src/stub-cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index c36d453d03e0cb7c8b72dd36ed9aeb379a1b5698..b8f2d9072155f49bd53dfc0db6ae5144fa6fa68e 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -265,6 +265,9 @@ static Handle<Object> CreateObjectLiteralBoilerplate(
}
Handle<Object> result;
uint32_t element_index = 0;
+ JSReceiver::StoreMode mode = value->IsJSObject()
+ ? JSReceiver::FORCE_FIELD
+ : JSReceiver::ALLOW_AS_CONSTANT;
if (key->IsInternalizedString()) {
if (Handle<String>::cast(key)->AsArrayIndex(&element_index)) {
// Array index as string (uint32).
@@ -274,7 +277,8 @@ static Handle<Object> CreateObjectLiteralBoilerplate(
Handle<String> name(String::cast(*key));
ASSERT(!name->AsArrayIndex(&element_index));
result = JSObject::SetLocalPropertyIgnoreAttributes(
- boilerplate, name, value, NONE);
+ boilerplate, name, value, NONE,
+ Object::OPTIMAL_REPRESENTATION, mode);
}
} else if (key->ToArrayIndex(&element_index)) {
// Array index (uint32).
@@ -290,7 +294,8 @@ static Handle<Object> CreateObjectLiteralBoilerplate(
Handle<String> name =
isolate->factory()->NewStringFromAscii(CStrVector(str));
result = JSObject::SetLocalPropertyIgnoreAttributes(
- boilerplate, name, value, NONE);
+ boilerplate, name, value, NONE,
+ Object::OPTIMAL_REPRESENTATION, mode);
}
// If setting the property on the boilerplate throws an
// exception, the exception is converted to an empty handle in
@@ -2203,8 +2208,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_InitializeConstGlobal) {
}
} else {
// Ignore re-initialization of constants that have already been
- // assigned a function value.
- ASSERT(lookup.IsReadOnly() && lookup.IsConstantFunction());
+ // assigned a constant value.
+ ASSERT(lookup.IsReadOnly() && lookup.IsConstant());
}
// Use the set value as the result of the operation.
@@ -4969,8 +4974,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetDataProperty) {
return lookup.holder()->FastPropertyAt(
lookup.representation(),
lookup.GetFieldIndex().field_index());
- case CONSTANT_FUNCTION:
- return lookup.GetConstantFunction();
+ case CONSTANT:
+ return lookup.GetConstant();
case CALLBACKS:
case HANDLER:
case INTERCEPTOR:
@@ -10554,8 +10559,8 @@ static MaybeObject* DebugLookupResultValue(Heap* heap,
}
return value;
}
- case CONSTANT_FUNCTION:
- return result->GetConstantFunction();
+ case CONSTANT:
+ return result->GetConstant();
case CALLBACKS: {
Object* structure = result->GetCallbackObject();
if (structure->IsForeign() || structure->IsAccessorInfo()) {
« no previous file with comments | « src/property-details.h ('k') | src/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698