Revision: 16944
Author: [email protected]
Date: Wed Sep 25 15:11:48 2013 UTC
Log: Internalize names before using them in slow-mode objects.
[email protected]
Review URL: https://chromiumcodereview.appspot.com/24566005
http://code.google.com/p/v8/source/detail?r=16944
Modified:
/branches/bleeding_edge/src/bootstrapper.cc
/branches/bleeding_edge/src/objects-inl.h
/branches/bleeding_edge/src/objects.cc
=======================================
--- /branches/bleeding_edge/src/bootstrapper.cc Thu Sep 12 13:50:38 2013 UTC
+++ /branches/bleeding_edge/src/bootstrapper.cc Wed Sep 25 15:11:48 2013 UTC
@@ -1043,7 +1043,7 @@
}
{ // -- J S O N
- Handle<String> name = factory->NewStringFromAscii(CStrVector("JSON"));
+ Handle<String> name = factory->InternalizeUtf8String("JSON");
Handle<JSFunction> cons = factory->NewFunction(name,
factory->the_hole_value());
JSFunction::SetInstancePrototype(cons,
=======================================
--- /branches/bleeding_edge/src/objects-inl.h Tue Sep 24 10:30:41 2013 UTC
+++ /branches/bleeding_edge/src/objects-inl.h Wed Sep 25 15:11:48 2013 UTC
@@ -5921,6 +5921,7 @@
MaybeObject* NameDictionaryShape::AsObject(Heap* heap, Name* key) {
+ ASSERT(key->IsUniqueName());
return key;
}
=======================================
--- /branches/bleeding_edge/src/objects.cc Wed Sep 25 09:31:10 2013 UTC
+++ /branches/bleeding_edge/src/objects.cc Wed Sep 25 15:11:48 2013 UTC
@@ -672,12 +672,19 @@
PropertyDetails details) {
ASSERT(!object->HasFastProperties());
Handle<NameDictionary>
property_dictionary(object->property_dictionary());
+
+ if (!name->IsUniqueName()) {
+ name = object->GetIsolate()->factory()->InternalizedStringFromString(
+ Handle<String>::cast(name));
+ }
+
int entry = property_dictionary->FindEntry(*name);
if (entry == NameDictionary::kNotFound) {
Handle<Object> store_value = value;
if (object->IsGlobalObject()) {
store_value =
object->GetIsolate()->factory()->NewPropertyCell(value);
}
+
property_dictionary =
NameDictionaryAdd(property_dictionary, name, store_value, details);
object->set_properties(*property_dictionary);
@@ -2044,6 +2051,12 @@
TransitionFlag transition_flag) {
ASSERT(!object->IsJSGlobalProxy());
Isolate* isolate = object->GetIsolate();
+
+ if (!name->IsUniqueName()) {
+ name = isolate->factory()->InternalizedStringFromString(
+ Handle<String>::cast(name));
+ }
+
if (extensibility_check == PERFORM_EXTENSIBILITY_CHECK &&
!object->map()->is_extensible()) {
if (strict_mode == kNonStrictMode) {
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.