Revert of [strong] Object literals create strong objects (patchset #4 id:60001 of...
authormachenbach <machenbach@chromium.org>
Tue, 19 May 2015 07:36:12 +0000 (00:36 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 19 May 2015 07:35:54 +0000 (07:35 +0000)
Reason for revert:
[Sheriff] Segmentation fault on arm64 with nosnap:
http://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20arm64%20-%20sim%20-%20nosnap%20-%20debug%20-%201/builds/1990

Original issue's description:
> [strong] Object literals create strong objects
>
> R=dslomov@chromium.org
> BUG=v8:3956
> LOG=N
>
> Committed: https://crrev.com/fe6598cffb82ec4180dcc2e2310e77d07a803f96
> Cr-Commit-Position: refs/heads/master@{#28444}

TBR=dslomov@chromium.org,arv@chromium.org,rossberg@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:3956

Review URL: https://codereview.chromium.org/1135493006

Cr-Commit-Position: refs/heads/master@{#28464}

14 files changed:
include/v8.h
src/ast.h
src/bootstrapper.cc
src/contexts.h
src/factory.cc
src/factory.h
src/hydrogen.cc
src/objects.cc
src/parser.cc
src/preparser.h
src/runtime/runtime-literals.cc
src/runtime/runtime.h
test/mjsunit/strong/literals.js [deleted file]
test/mjsunit/strong/objects.js [new file with mode: 0644]

index d2d0da05190eb187d1571458f9a67d04d7298793..7050b535709f06a523099eb9e97eca5671cfad3c 100644 (file)
@@ -6697,7 +6697,7 @@ class Internals {
   static const int kJSObjectHeaderSize = 3 * kApiPointerSize;
   static const int kFixedArrayHeaderSize = 2 * kApiPointerSize;
   static const int kContextHeaderSize = 2 * kApiPointerSize;
-  static const int kContextEmbedderDataIndex = 78;
+  static const int kContextEmbedderDataIndex = 77;
   static const int kFullStringRepresentationMask = 0x07;
   static const int kStringEncodingMask = 0x4;
   static const int kExternalTwoByteRepresentationTag = 0x02;
index 60f0068d37aebe855c31c352469af4d9ca058bf5..26950b4c9ae95ca003e177422e45e41130e63691 100644 (file)
--- a/src/ast.h
+++ b/src/ast.h
@@ -1295,14 +1295,11 @@ class MaterializedLiteral : public Expression {
     return depth_;
   }
 
-  bool is_strong() const { return is_strong_; }
-
  protected:
-  MaterializedLiteral(Zone* zone, int literal_index, bool is_strong, int pos)
+  MaterializedLiteral(Zone* zone, int literal_index, int pos)
       : Expression(zone, pos),
         literal_index_(literal_index),
         is_simple_(false),
-        is_strong_(is_strong),
         depth_(0) {}
 
   // A materialized literal is simple if the values consist of only
@@ -1331,7 +1328,6 @@ class MaterializedLiteral : public Expression {
  private:
   int literal_index_;
   bool is_simple_;
-  bool is_strong_;
   int depth_;
 };
 
@@ -1426,9 +1422,6 @@ class ObjectLiteral final : public MaterializedLiteral {
     if (disable_mementos) {
       flags |= kDisableMementos;
     }
-    if (is_strong()) {
-      flags |= kIsStrong;
-    }
     return flags;
   }
 
@@ -1437,8 +1430,7 @@ class ObjectLiteral final : public MaterializedLiteral {
     kFastElements = 1,
     kHasFunction = 1 << 1,
     kShallowProperties = 1 << 2,
-    kDisableMementos = 1 << 3,
-    kIsStrong = 1 << 4
+    kDisableMementos = 1 << 3
   };
 
   struct Accessors: public ZoneObject {
@@ -1458,9 +1450,8 @@ class ObjectLiteral final : public MaterializedLiteral {
 
  protected:
   ObjectLiteral(Zone* zone, ZoneList<Property*>* properties, int literal_index,
-                int boilerplate_properties, bool has_function,
-                bool is_strong, int pos)
-      : MaterializedLiteral(zone, literal_index, is_strong, pos),
+                int boilerplate_properties, bool has_function, int pos)
+      : MaterializedLiteral(zone, literal_index, pos),
         properties_(properties),
         boilerplate_properties_(boilerplate_properties),
         fast_elements_(false),
@@ -1491,9 +1482,8 @@ class RegExpLiteral final : public MaterializedLiteral {
 
  protected:
   RegExpLiteral(Zone* zone, const AstRawString* pattern,
-                const AstRawString* flags, int literal_index, bool is_strong,
-                int pos)
-      : MaterializedLiteral(zone, literal_index, is_strong, pos),
+                const AstRawString* flags, int literal_index, int pos)
+      : MaterializedLiteral(zone, literal_index, pos),
         pattern_(pattern),
         flags_(flags) {
     set_depth(1);
@@ -1538,24 +1528,19 @@ class ArrayLiteral final : public MaterializedLiteral {
     if (disable_mementos) {
       flags |= kDisableMementos;
     }
-    if (is_strong()) {
-      flags |= kIsStrong;
-    }
     return flags;
   }
 
   enum Flags {
     kNoFlags = 0,
     kShallowElements = 1,
-    kDisableMementos = 1 << 1,
-    kIsStrong = 1 << 2
+    kDisableMementos = 1 << 1
   };
 
  protected:
   ArrayLiteral(Zone* zone, ZoneList<Expression*>* values, int literal_index,
-               bool is_strong, int pos)
-      : MaterializedLiteral(zone, literal_index, is_strong, pos),
-        values_(values) {}
+               int pos)
+      : MaterializedLiteral(zone, literal_index, pos), values_(values) {}
   static int parent_num_ids() { return MaterializedLiteral::num_ids(); }
 
  private:
@@ -3320,11 +3305,9 @@ class AstNodeFactory final BASE_EMBEDDED {
       int literal_index,
       int boilerplate_properties,
       bool has_function,
-      bool is_strong,
       int pos) {
     return new (zone_) ObjectLiteral(zone_, properties, literal_index,
-                                     boilerplate_properties, has_function,
-                                     is_strong, pos);
+                                     boilerplate_properties, has_function, pos);
   }
 
   ObjectLiteral::Property* NewObjectLiteralProperty(
@@ -3345,18 +3328,14 @@ class AstNodeFactory final BASE_EMBEDDED {
   RegExpLiteral* NewRegExpLiteral(const AstRawString* pattern,
                                   const AstRawString* flags,
                                   int literal_index,
-                                  bool is_strong,
                                   int pos) {
-    return new (zone_) RegExpLiteral(zone_, pattern, flags, literal_index,
-                                     is_strong, pos);
+    return new (zone_) RegExpLiteral(zone_, pattern, flags, literal_index, pos);
   }
 
   ArrayLiteral* NewArrayLiteral(ZoneList<Expression*>* values,
                                 int literal_index,
-                                bool is_strong,
                                 int pos) {
-    return new (zone_) ArrayLiteral(zone_, values, literal_index, is_strong,
-                                    pos);
+    return new (zone_) ArrayLiteral(zone_, values, literal_index, pos);
   }
 
   VariableProxy* NewVariableProxy(Variable* var,
index 6969edea108eac8c4fbaa4f9c08ebfc4f35ea0d4..a0e7b7af629a6ea6df1187fa31a75d73937a642a 100644 (file)
@@ -1016,11 +1016,6 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> global_object,
     ArrayConstructorStub array_constructor_stub(isolate);
     Handle<Code> code = array_constructor_stub.GetCode();
     array_function->shared()->set_construct_stub(*code);
-
-    Handle<Map> initial_strong_map =
-        Map::Copy(initial_map, "SetInstancePrototype");
-    initial_strong_map->set_is_strong(true);
-    CacheInitialJSArrayMaps(native_context(), initial_strong_map);
   }
 
   {  // --- N u m b e r ---
index d06e4e81855814a571d905d429897defebd162f1..f120788609f2d748ed0015684cc0f91f0900d899 100644 (file)
@@ -85,7 +85,6 @@ enum BindingFlags {
   V(INTERNAL_ARRAY_FUNCTION_INDEX, JSFunction, internal_array_function)        \
   V(ARRAY_FUNCTION_INDEX, JSFunction, array_function)                          \
   V(JS_ARRAY_MAPS_INDEX, Object, js_array_maps)                                \
-  V(JS_ARRAY_STRONG_MAPS_INDEX, Object, js_array_strong_maps)                  \
   V(DATE_FUNCTION_INDEX, JSFunction, date_function)                            \
   V(JSON_OBJECT_INDEX, JSObject, json_object)                                  \
   V(REGEXP_FUNCTION_INDEX, JSFunction, regexp_function)                        \
@@ -342,7 +341,6 @@ class Context: public FixedArray {
     INTERNAL_ARRAY_FUNCTION_INDEX,
     ARRAY_FUNCTION_INDEX,
     JS_ARRAY_MAPS_INDEX,
-    JS_ARRAY_STRONG_MAPS_INDEX,
     DATE_FUNCTION_INDEX,
     JSON_OBJECT_INDEX,
     REGEXP_FUNCTION_INDEX,
index 06373d2d8a39f62c0f98db6fd4978270f486f350..e966e5ca949324294a70e7b4f3acc568790e0754 100644 (file)
@@ -2339,18 +2339,14 @@ Handle<JSWeakMap> Factory::NewJSWeakMap() {
 
 Handle<Map> Factory::ObjectLiteralMapFromCache(Handle<Context> context,
                                                int number_of_properties,
-                                               bool is_strong,
                                                bool* is_result_from_cache) {
   const int kMapCacheSize = 128;
 
   // We do not cache maps for too many properties or when running builtin code.
-  // TODO(rossberg): cache strong maps properly
-  if (number_of_properties > kMapCacheSize || is_strong ||
+  if (number_of_properties > kMapCacheSize ||
       isolate()->bootstrapper()->IsActive()) {
     *is_result_from_cache = false;
-    Handle<Map> map = Map::Create(isolate(), number_of_properties);
-    if (is_strong) map->set_is_strong(true);
-    return map;
+    return Map::Create(isolate(), number_of_properties);
   }
   *is_result_from_cache = true;
   if (number_of_properties == 0) {
index 8eaa216ee84646ba9f3d0d42c8c6d2188be5d69f..4aba6eeb766c689a791d1ab9271d0bd79b1f2fd2 100644 (file)
@@ -670,7 +670,6 @@ class Factory final {
   // native context.
   Handle<Map> ObjectLiteralMapFromCache(Handle<Context> context,
                                         int number_of_properties,
-                                        bool is_strong,
                                         bool* is_result_from_cache);
 
   // Creates a new FixedArray that holds the data associated with the
index 86bf7634296dcbf71b8a2debf27262464a1a1e3c..4f04580376789ec692104af8d6f914bc62b53634 100644 (file)
@@ -5790,8 +5790,7 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) {
     ASSIGN_RETURN_ON_EXCEPTION_VALUE(
         isolate(), raw_boilerplate,
         Runtime::CreateArrayLiteralBoilerplate(
-            isolate(), literals, expr->constant_elements(),
-            is_strong(function_language_mode())),
+            isolate(), literals, expr->constant_elements()),
         Bailout(kArrayBoilerplateCreationFailed));
 
     boilerplate_object = Handle<JSObject>::cast(raw_boilerplate);
index b07cc99536de534ae2399c2221d3fd781867e196..645ea57e344d2727209c68fa90b4a98843108d0e 100644 (file)
@@ -3804,9 +3804,7 @@ Handle<Map> Map::TransitionElementsTo(Handle<Map> map,
 
   Isolate* isolate = map->GetIsolate();
   Context* native_context = isolate->context()->native_context();
-  Object* maybe_array_maps = map->is_strong()
-      ? native_context->js_array_strong_maps()
-      : native_context->js_array_maps();
+  Object* maybe_array_maps = native_context->js_array_maps();
   if (maybe_array_maps->IsFixedArray()) {
     DisallowHeapAllocation no_gc;
     FixedArray* array_maps = FixedArray::cast(maybe_array_maps);
@@ -10320,10 +10318,7 @@ Handle<Object> CacheInitialJSArrayMaps(
     maps->set(next_kind, *new_map);
     current_map = new_map;
   }
-  if (initial_map->is_strong())
-    native_context->set_js_array_strong_maps(*maps);
-  else
-    native_context->set_js_array_maps(*maps);
+  native_context->set_js_array_maps(*maps);
   return initial_map;
 }
 
@@ -10358,18 +10353,13 @@ void JSFunction::SetInstancePrototype(Handle<JSFunction> function,
       JSFunction::SetInitialMap(function, new_map, value);
 
       // If the function is used as the global Array function, cache the
-      // updated initial maps (and transitioned versions) in the native context.
+      // initial map (and transitioned versions) in the native context.
       Context* native_context = function->context()->native_context();
       Object* array_function =
           native_context->get(Context::ARRAY_FUNCTION_INDEX);
       if (array_function->IsJSFunction() &&
           *function == JSFunction::cast(array_function)) {
         CacheInitialJSArrayMaps(handle(native_context, isolate), new_map);
-        Handle<Map> new_strong_map =
-            Map::Copy(initial_map, "SetInstancePrototype");
-        new_strong_map->set_is_strong(true);
-        CacheInitialJSArrayMaps(handle(native_context, isolate),
-                                new_strong_map);
       }
     }
 
index d9742222e5980c560ffc1db2f99db7995d16408e..9917ff606ce363949971981c18cc30689962d1cb 100644 (file)
@@ -5621,12 +5621,11 @@ Expression* Parser::CloseTemplateLiteral(TemplateLiteralState* state, int start,
     ZoneList<Expression*>* args = new (zone()) ZoneList<Expression*>(4, zone());
     args->Add(factory()->NewArrayLiteral(
                   const_cast<ZoneList<Expression*>*>(cooked_strings),
-                  cooked_idx, is_strong(language_mode()), pos),
+                  cooked_idx, pos),
               zone());
     args->Add(
         factory()->NewArrayLiteral(
-            const_cast<ZoneList<Expression*>*>(raw_strings), raw_idx,
-            is_strong(language_mode()), pos),
+            const_cast<ZoneList<Expression*>*>(raw_strings), raw_idx, pos),
         zone());
 
     // Ensure hash is suitable as a Smi value
@@ -5717,7 +5716,6 @@ ZoneList<v8::internal::Expression*>* Parser::PrepareSpreadArguments(
         }
         int literal_index = function_state_->NextMaterializedLiteralIndex();
         args->Add(factory()->NewArrayLiteral(unspread, literal_index,
-                                             is_strong(language_mode()),
                                              RelocInfo::kNoPosition),
                   zone());
 
index 379d41879c3b9f364a6da460964ccd17a9b4f9ce..7e4e2a83bd7a1c21c4f70573af1659e30c44d3f0 100644 (file)
@@ -1352,13 +1352,11 @@ class PreParserFactory {
   PreParserExpression NewRegExpLiteral(PreParserIdentifier js_pattern,
                                        PreParserIdentifier js_flags,
                                        int literal_index,
-                                       bool is_strong,
                                        int pos) {
     return PreParserExpression::Default();
   }
   PreParserExpression NewArrayLiteral(PreParserExpressionList values,
                                       int literal_index,
-                                      bool is_strong,
                                       int pos) {
     return PreParserExpression::Default();
   }
@@ -1379,7 +1377,6 @@ class PreParserFactory {
                                        int literal_index,
                                        int boilerplate_properties,
                                        bool has_function,
-                                       bool is_strong,
                                        int pos) {
     return PreParserExpression::Default();
   }
@@ -2233,8 +2230,7 @@ typename ParserBase<Traits>::ExpressionT ParserBase<Traits>::ParseRegExpLiteral(
   }
   IdentifierT js_flags = this->GetNextSymbol(scanner());
   Next();
-  return factory()->NewRegExpLiteral(js_pattern, js_flags, literal_index,
-                                     is_strong(language_mode()), pos);
+  return factory()->NewRegExpLiteral(js_pattern, js_flags, literal_index, pos);
 }
 
 
@@ -2499,8 +2495,7 @@ typename ParserBase<Traits>::ExpressionT ParserBase<Traits>::ParseArrayLiteral(
   // Update the scope information before the pre-parsing bailout.
   int literal_index = function_state_->NextMaterializedLiteralIndex();
 
-  return factory()->NewArrayLiteral(values, literal_index,
-                                    is_strong(language_mode()), pos);
+  return factory()->NewArrayLiteral(values, literal_index, pos);
 }
 
 
@@ -2756,7 +2751,6 @@ typename ParserBase<Traits>::ExpressionT ParserBase<Traits>::ParseObjectLiteral(
                                      literal_index,
                                      number_of_boilerplate_properties,
                                      has_function,
-                                     is_strong(language_mode()),
                                      pos);
 }
 
index 8fe6e3f2fd3922bbb40ac7d7385c6fc4eafa98aa..76226d68f596facea57862488c6a71de1d3e705b 100644 (file)
@@ -16,7 +16,7 @@ namespace internal {
 
 static Handle<Map> ComputeObjectLiteralMap(
     Handle<Context> context, Handle<FixedArray> constant_properties,
-    bool is_strong, bool* is_result_from_cache) {
+    bool* is_result_from_cache) {
   int properties_length = constant_properties->length();
   int number_of_properties = properties_length / 2;
 
@@ -30,30 +30,28 @@ static Handle<Map> ComputeObjectLiteralMap(
   }
   Isolate* isolate = context->GetIsolate();
   return isolate->factory()->ObjectLiteralMapFromCache(
-      context, number_of_properties, is_strong, is_result_from_cache);
+      context, number_of_properties, is_result_from_cache);
 }
 
 MUST_USE_RESULT static MaybeHandle<Object> CreateLiteralBoilerplate(
     Isolate* isolate, Handle<FixedArray> literals,
-    Handle<FixedArray> constant_properties, bool is_strong);
+    Handle<FixedArray> constant_properties);
 
 
 MUST_USE_RESULT static MaybeHandle<Object> CreateObjectLiteralBoilerplate(
     Isolate* isolate, Handle<FixedArray> literals,
     Handle<FixedArray> constant_properties, bool should_have_fast_elements,
-    bool has_function_literal, bool is_strong) {
+    bool has_function_literal) {
   Handle<Context> context = isolate->native_context();
 
   // In case we have function literals, we want the object to be in
   // slow properties mode for now. We don't go in the map cache because
   // maps with constant functions can't be shared if the functions are
   // not the same (which is the common case).
-  // TODO(rossberg): handle strong objects with function literals
   bool is_result_from_cache = false;
   Handle<Map> map = has_function_literal
                         ? Handle<Map>(context->object_function()->initial_map())
                         : ComputeObjectLiteralMap(context, constant_properties,
-                                                  is_strong,
                                                   &is_result_from_cache);
 
   PretenureFlag pretenure_flag =
@@ -84,8 +82,7 @@ MUST_USE_RESULT static MaybeHandle<Object> CreateObjectLiteralBoilerplate(
       // simple object or array literal.
       Handle<FixedArray> array = Handle<FixedArray>::cast(value);
       ASSIGN_RETURN_ON_EXCEPTION(
-          isolate, value,
-          CreateLiteralBoilerplate(isolate, literals, array, is_strong),
+          isolate, value, CreateLiteralBoilerplate(isolate, literals, array),
           Object);
     }
     MaybeHandle<Object> maybe_result;
@@ -140,7 +137,7 @@ MUST_USE_RESULT static MaybeHandle<Object> CreateObjectLiteralBoilerplate(
 
 MaybeHandle<Object> Runtime::CreateArrayLiteralBoilerplate(
     Isolate* isolate, Handle<FixedArray> literals,
-    Handle<FixedArray> elements, bool is_strong) {
+    Handle<FixedArray> elements) {
   // Create the JSArray.
   Handle<JSFunction> constructor = isolate->array_function();
 
@@ -159,9 +156,7 @@ MaybeHandle<Object> Runtime::CreateArrayLiteralBoilerplate(
     DisallowHeapAllocation no_gc;
     DCHECK(IsFastElementsKind(constant_elements_kind));
     Context* native_context = isolate->context()->native_context();
-    Object* maps_array = is_strong
-        ? native_context->js_array_strong_maps()
-        : native_context->js_array_maps();
+    Object* maps_array = native_context->js_array_maps();
     DCHECK(!maps_array->IsUndefined());
     Object* map = FixedArray::cast(maps_array)->get(constant_elements_kind);
     object->set_map(Map::cast(map));
@@ -197,8 +192,7 @@ MaybeHandle<Object> Runtime::CreateArrayLiteralBoilerplate(
           Handle<FixedArray> fa(FixedArray::cast(fixed_array_values->get(i)));
           Handle<Object> result;
           ASSIGN_RETURN_ON_EXCEPTION(
-              isolate, result,
-              CreateLiteralBoilerplate(isolate, literals, fa, is_strong),
+              isolate, result, CreateLiteralBoilerplate(isolate, literals, fa),
               Object);
           fixed_array_values_copy->set(i, *result);
         }
@@ -214,20 +208,19 @@ MaybeHandle<Object> Runtime::CreateArrayLiteralBoilerplate(
 
 
 MUST_USE_RESULT static MaybeHandle<Object> CreateLiteralBoilerplate(
-    Isolate* isolate, Handle<FixedArray> literals, Handle<FixedArray> array,
-    bool is_strong) {
+    Isolate* isolate, Handle<FixedArray> literals, Handle<FixedArray> array) {
   Handle<FixedArray> elements = CompileTimeValue::GetElements(array);
   const bool kHasNoFunctionLiteral = false;
   switch (CompileTimeValue::GetLiteralType(array)) {
     case CompileTimeValue::OBJECT_LITERAL_FAST_ELEMENTS:
       return CreateObjectLiteralBoilerplate(isolate, literals, elements, true,
-                                            kHasNoFunctionLiteral, is_strong);
+                                            kHasNoFunctionLiteral);
     case CompileTimeValue::OBJECT_LITERAL_SLOW_ELEMENTS:
       return CreateObjectLiteralBoilerplate(isolate, literals, elements, false,
-                                            kHasNoFunctionLiteral, is_strong);
+                                            kHasNoFunctionLiteral);
     case CompileTimeValue::ARRAY_LITERAL:
       return Runtime::CreateArrayLiteralBoilerplate(isolate, literals,
-                                                    elements, is_strong);
+                                                    elements);
     default:
       UNREACHABLE();
       return MaybeHandle<Object>();
@@ -245,7 +238,6 @@ RUNTIME_FUNCTION(Runtime_CreateObjectLiteral) {
   bool should_have_fast_elements = (flags & ObjectLiteral::kFastElements) != 0;
   bool has_function_literal = (flags & ObjectLiteral::kHasFunction) != 0;
   bool enable_mementos = (flags & ObjectLiteral::kDisableMementos) == 0;
-  bool is_strong = (flags & ObjectLiteral::kIsStrong) != 0;
 
   RUNTIME_ASSERT(literals_index >= 0 && literals_index < literals->length());
 
@@ -259,7 +251,7 @@ RUNTIME_FUNCTION(Runtime_CreateObjectLiteral) {
         isolate, raw_boilerplate,
         CreateObjectLiteralBoilerplate(isolate, literals, constant_properties,
                                        should_have_fast_elements,
-                                       has_function_literal, is_strong));
+                                       has_function_literal));
     boilerplate = Handle<JSObject>::cast(raw_boilerplate);
 
     AllocationSiteCreationContext creation_context(isolate);
@@ -289,7 +281,7 @@ RUNTIME_FUNCTION(Runtime_CreateObjectLiteral) {
 
 MUST_USE_RESULT static MaybeHandle<AllocationSite> GetLiteralAllocationSite(
     Isolate* isolate, Handle<FixedArray> literals, int literals_index,
-    Handle<FixedArray> elements, bool is_strong) {
+    Handle<FixedArray> elements) {
   // Check if boilerplate exists. If not, create it first.
   Handle<Object> literal_site(literals->get(literals_index), isolate);
   Handle<AllocationSite> site;
@@ -298,8 +290,7 @@ MUST_USE_RESULT static MaybeHandle<AllocationSite> GetLiteralAllocationSite(
     Handle<Object> boilerplate;
     ASSIGN_RETURN_ON_EXCEPTION(
         isolate, boilerplate,
-        Runtime::CreateArrayLiteralBoilerplate(isolate, literals, elements,
-                                               is_strong),
+        Runtime::CreateArrayLiteralBoilerplate(isolate, literals, elements),
         AllocationSite);
 
     AllocationSiteCreationContext creation_context(isolate);
@@ -327,11 +318,9 @@ static MaybeHandle<JSObject> CreateArrayLiteralImpl(Isolate* isolate,
   RUNTIME_ASSERT_HANDLIFIED(
       literals_index >= 0 && literals_index < literals->length(), JSObject);
   Handle<AllocationSite> site;
-  bool is_strong = (flags & ArrayLiteral::kIsStrong) != 0;
   ASSIGN_RETURN_ON_EXCEPTION(
       isolate, site,
-      GetLiteralAllocationSite(isolate, literals, literals_index, elements,
-                               is_strong),
+      GetLiteralAllocationSite(isolate, literals, literals_index, elements),
       JSObject);
 
   bool enable_mementos = (flags & ArrayLiteral::kDisableMementos) == 0;
index b4de53539e938ff0c34b0e62e0612f148356f22a..bd37a68a753aa8182469f5d8eb3f10ae6d064b7d 100644 (file)
@@ -848,7 +848,7 @@ class Runtime : public AllStatic {
   // Used in runtime.cc and hydrogen's VisitArrayLiteral.
   MUST_USE_RESULT static MaybeHandle<Object> CreateArrayLiteralBoilerplate(
       Isolate* isolate, Handle<FixedArray> literals,
-      Handle<FixedArray> elements, bool is_strong);
+      Handle<FixedArray> elements);
 
   static void WeakCollectionInitialize(
       Isolate* isolate, Handle<JSWeakCollection> weak_collection);
diff --git a/test/mjsunit/strong/literals.js b/test/mjsunit/strong/literals.js
deleted file mode 100644 (file)
index b9368e1..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2015 the V8 project authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Flags: --strong-mode --allow-natives-syntax
-// Flags: --harmony-arrow-functions --harmony-rest-parameters
-
-
-(function WeakObjectLiterals() {
-  assertTrue(!%IsStrong({}));
-  assertTrue(!%IsStrong({a: 0, b: 0}));
-  assertTrue(!%IsStrong({f: function(){}}));
-  assertTrue(!%IsStrong(Realm.eval(Realm.current(),
-                                   "({f: function(){}})")));
-})();
-
-(function StrongObjectLiterals() {
-  'use strong';
-  assertTrue(%IsStrong({}));
-  assertTrue(%IsStrong({a: 0, b: 0}));
-  assertTrue(%IsStrong({__proto__: {}, get a() {}, set b(x) {}}));
-  assertTrue(%IsStrong({[Date() + ""]: 0, [Symbol()]: 0}));
-  // TODO(rossberg): super does not work yet
-  // assertTrue(%IsStrong({m() { super.m() }}));
-  // Object literals with constant functions are treated specially,
-  // but currently only on the toplevel.
-  assertTrue(%IsStrong({f: function(){}}));
-  // TODO(rossberg): implement strong object literals with functions
-  // assertTrue(%IsStrong(Realm.eval(Realm.current(),
-  //                      "'use strong'; ({f: function(){}})")));
-})();
-
-(function WeakArrayLiterals(...args) {
-  assertTrue(!%IsStrong(args));
-  assertTrue(!%IsStrong([]));
-  assertTrue(!%IsStrong([1, 2, 3]));
-  Array.prototype = {}
-  assertTrue(!%IsStrong([]));
-  assertTrue(!%IsStrong([1, 2, 3]));
-})();
-
-(function StrongArrayLiterals(...args) {
-  'use strong';
-  // TODO(rossberg): implement strong array literals
-  // assertTrue(%IsStrong(args));
-  // assertTrue(%IsStrong([]));
-  // assertTrue(%IsStrong([1, 2, 3]));
-  // Array.prototype = {}
-  // assertTrue(%IsStrong([]));
-  // assertTrue(%IsStrong([1, 2, 3]));
-})(0);  // TODO(arv): drop dummy
-
-(function WeakFunctionLiterals() {
-  function f() {}
-  assertTrue(!%IsStrong(f));
-  assertTrue(!%IsStrong(function(){}));
-  assertTrue(!%IsStrong(() => {}));
-  assertTrue(!%IsStrong(x => x));
-})();
-
-(function StrongFunctionLiterals(g) {
-  'use strong';
-  function f() {}
-  assertTrue(%IsStrong(f));
-  assertTrue(%IsStrong(g));
-  assertTrue(%IsStrong(function(){}));
-  assertTrue(%IsStrong(() => {}));
-  assertTrue(%IsStrong(x => x));
-})(function() { 'use strong' });
-
-(function WeakRegExpLiterals() {
-  assertTrue(!%IsStrong(/abc/));
-})();
-
-(function StrongRegExpLiterals() {
-  'use strong';
-  // TODO(rossberg): implement strong regexp literals
-  // assertTrue(%IsStrong(/abc/));
-})();
diff --git a/test/mjsunit/strong/objects.js b/test/mjsunit/strong/objects.js
new file mode 100644 (file)
index 0000000..4654606
--- /dev/null
@@ -0,0 +1,10 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --strong-mode --allow-natives-syntax
+
+'use strong';
+
+function f() {}
+assertTrue(%IsStrong(f));