Cleanup after inobject slack tracking improvement.
authorishell@chromium.org <ishell@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 23 May 2014 12:55:57 +0000 (12:55 +0000)
committerishell@chromium.org <ishell@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 23 May 2014 12:55:57 +0000 (12:55 +0000)
1) %SetExpectedNumberOfProperties() function removed.
2) Obsolete SharedFunctionInfo::BeforeVisitingPointers() removed.

R=mstarzinger@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21464 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/bootstrapper.cc
src/incremental-marking.cc
src/mark-compact.cc
src/objects-inl.h
src/objects-visiting-inl.h
src/objects.h
src/runtime.cc
src/runtime.h
src/v8natives.js
test/mjsunit/runtime-gen/setexpectednumberofproperties.js [deleted file]
tools/generate-runtime-tests.py

index 0803522..0243a3a 100644 (file)
@@ -472,6 +472,8 @@ Handle<JSFunction> Genesis::CreateEmptyFunction(Isolate* isolate) {
         factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
     object_fun->set_initial_map(*object_function_map);
     object_function_map->set_constructor(*object_fun);
+    object_function_map->set_unused_property_fields(
+        JSObject::kInitialGlobalObjectUnusedPropertiesCount);
 
     native_context()->set_object_function(*object_fun);
 
index 7bce832..aec0c37 100644 (file)
@@ -240,8 +240,6 @@ class IncrementalMarkingMarkingVisitor
                   HeapObject::RawField(object, JSWeakCollection::kSize));
   }
 
-  static void BeforeVisitingSharedFunctionInfo(HeapObject* object) {}
-
   INLINE(static void VisitPointer(Heap* heap, Object** p)) {
     Object* obj = *p;
     if (obj->IsHeapObject()) {
index ce4d6ac..6b3b3db 100644 (file)
@@ -1472,11 +1472,6 @@ class MarkCompactMarkingVisitor
     return true;
   }
 
-  INLINE(static void BeforeVisitingSharedFunctionInfo(HeapObject* object)) {
-    SharedFunctionInfo* shared = SharedFunctionInfo::cast(object);
-    shared->BeforeVisitingPointers();
-  }
-
   static void VisitWeakCollection(Map* map, HeapObject* object) {
     MarkCompactCollector* collector = map->GetHeap()->mark_compact_collector();
     JSWeakCollection* weak_collection =
index 8a35d69..ae3cd0c 100644 (file)
@@ -5231,10 +5231,6 @@ BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_cache, kDontCache)
 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, dont_flush, kDontFlush)
 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_generator, kIsGenerator)
 
-void SharedFunctionInfo::BeforeVisitingPointers() {
-}
-
-
 ACCESSORS(CodeCache, default_cache, FixedArray, kDefaultCacheOffset)
 ACCESSORS(CodeCache, normal_type_cache, Object, kNormalTypeCacheOffset)
 
index 9234a9e..7ed0e4a 100644 (file)
@@ -794,7 +794,6 @@ bool StaticMarkingVisitor<StaticVisitor>::IsFlushable(
 template<typename StaticVisitor>
 void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfoStrongCode(
     Heap* heap, HeapObject* object) {
-  StaticVisitor::BeforeVisitingSharedFunctionInfo(object);
   Object** start_slot =
       HeapObject::RawField(object,
                            SharedFunctionInfo::BodyDescriptor::kStartOffset);
@@ -808,7 +807,6 @@ void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfoStrongCode(
 template<typename StaticVisitor>
 void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfoWeakCode(
     Heap* heap, HeapObject* object) {
-  StaticVisitor::BeforeVisitingSharedFunctionInfo(object);
   Object** name_slot =
       HeapObject::RawField(object, SharedFunctionInfo::kNameOffset);
   StaticVisitor::VisitPointer(heap, name_slot);
index f82b9af..7a3e07a 100644 (file)
@@ -2635,6 +2635,10 @@ class JSObject: public JSReceiver {
   // permissible values (see the ASSERT in heap.cc).
   static const int kInitialMaxFastElementArray = 100000;
 
+  // This constant applies only to the initial map of "$Object" aka
+  // "global.Object" and not to arbitrary other JSObject maps.
+  static const int kInitialGlobalObjectUnusedPropertiesCount = 4;
+
   static const int kFastPropertiesSoftLimit = 12;
   static const int kMaxFastProperties = 128;
   static const int kMaxInstanceSize = 255 * kPointerSize;
@@ -6966,10 +6970,6 @@ class SharedFunctionInfo: public HeapObject {
   // TypeFeedbackInfo::feedback_vector, but the allocation is done here.
   DECL_ACCESSORS(feedback_vector, FixedArray)
 
-  // Invoked before pointers in SharedFunctionInfo are being marked.
-  // Also clears the optimized code map.
-  inline void BeforeVisitingPointers();
-
   // [instance class name]: class name for instances.
   DECL_ACCESSORS(instance_class_name, Object)
 
index 78bf25a..1aaa3cd 100644 (file)
@@ -3118,23 +3118,6 @@ RUNTIME_FUNCTION(Runtime_SetCode) {
 }
 
 
-RUNTIME_FUNCTION(Runtime_SetExpectedNumberOfProperties) {
-  HandleScope scope(isolate);
-  ASSERT(args.length() == 2);
-  CONVERT_ARG_HANDLE_CHECKED(JSFunction, func, 0);
-  CONVERT_SMI_ARG_CHECKED(num, 1);
-  RUNTIME_ASSERT(num >= 0);
-
-  func->shared()->set_expected_nof_properties(num);
-  if (func->has_initial_map()) {
-    Handle<Map> new_initial_map = Map::Copy(handle(func->initial_map()));
-    new_initial_map->set_unused_property_fields(num);
-    func->set_initial_map(*new_initial_map);
-  }
-  return isolate->heap()->undefined_value();
-}
-
-
 RUNTIME_FUNCTION(RuntimeHidden_CreateJSGeneratorObject) {
   HandleScope scope(isolate);
   ASSERT(args.length() == 0);
index 1332bae..566a5eb 100644 (file)
@@ -200,7 +200,6 @@ namespace internal {
   F(GetV8Version, 0, 1) \
   \
   F(SetCode, 2, 1) \
-  F(SetExpectedNumberOfProperties, 2, 1) \
   \
   F(CreateApiFunction, 2, 1) \
   F(IsTemplate, 1, 1) \
index 4bbbac5..602d75b 100644 (file)
@@ -1396,7 +1396,6 @@ function SetUpObject() {
 
   %SetNativeFlag($Object);
   %SetCode($Object, ObjectConstructor);
-  %SetExpectedNumberOfProperties($Object, 4);
 
   %SetProperty($Object.prototype, "constructor", $Object, DONT_ENUM);
 
diff --git a/test/mjsunit/runtime-gen/setexpectednumberofproperties.js b/test/mjsunit/runtime-gen/setexpectednumberofproperties.js
deleted file mode 100644 (file)
index 0a0e6ed..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-// Copyright 2014 the V8 project authors. All rights reserved.
-// AUTO-GENERATED BY tools/generate-runtime-tests.py, DO NOT MODIFY
-// Flags: --allow-natives-syntax --harmony
-var _func = function() {};
-var _num = 1;
-%SetExpectedNumberOfProperties(_func, _num);
index d91986b..0bbac02 100755 (executable)
@@ -47,8 +47,8 @@ EXPAND_MACROS = [
 # that the parser doesn't bit-rot. Change the values as needed when you add,
 # remove or change runtime functions, but make sure we don't lose our ability
 # to parse them!
-EXPECTED_FUNCTION_COUNT = 359
-EXPECTED_FUZZABLE_COUNT = 326
+EXPECTED_FUNCTION_COUNT = 358
+EXPECTED_FUZZABLE_COUNT = 325
 EXPECTED_CCTEST_COUNT = 6
 EXPECTED_UNKNOWN_COUNT = 5
 EXPECTED_BUILTINS_COUNT = 781