Reviewers: Michael Starzinger,

Message:
PTAL

Description:
Cleanup after inobject slack tracking improvement.

1) %SetExpectedNumberOfProperties() function removed.
2) Obsolete SharedFunctionInfo::BeforeVisitingPointers() removed.

Please review this at https://codereview.chromium.org/289283018/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+5, -44 lines):
  M src/bootstrapper.cc
  M src/incremental-marking.cc
  M src/mark-compact.cc
  M src/objects.h
  M src/objects-inl.h
  M src/objects-visiting-inl.h
  M src/runtime.h
  M src/runtime.cc
  M src/v8natives.js
  D test/mjsunit/runtime-gen/setexpectednumberofproperties.js
  M tools/generate-runtime-tests.py


Index: test/mjsunit/runtime-gen/setexpectednumberofproperties.js
diff --git a/test/mjsunit/runtime-gen/setexpectednumberofproperties.js b/test/mjsunit/runtime-gen/setexpectednumberofproperties.js
deleted file mode 100644
index 0a0e6ed90eae1beb54bc92878b61b292c9452ab9..0000000000000000000000000000000000000000
--- a/test/mjsunit/runtime-gen/setexpectednumberofproperties.js
+++ /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: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index d783d244129d58a8ce2eb1675764b114dd2adb4b..b665daaa567a2e763934bce2bfacd52535e183b1 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -469,6 +469,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::kInitialUnusedPropertiesCount);

     native_context()->set_object_function(*object_fun);

Index: src/incremental-marking.cc
diff --git a/src/incremental-marking.cc b/src/incremental-marking.cc
index 0cf6a9e1dc68fa55bbcdebcd420b1dda0725a442..2af7509721993d56cf27122afda411416a3eb60c 100644
--- a/src/incremental-marking.cc
+++ b/src/incremental-marking.cc
@@ -236,8 +236,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: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index b3fe634a0fa1804c153997b860c4a651d250a65a..fffa32313912ba912f9404ce60714f7ce8fa4cfa 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -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: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 8b4807152ebaad1c6763187cf37914e532c138af..9ed3a94ec7a2a725c4b097aa931f0223650d321f 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -5228,10 +5228,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: src/objects-visiting-inl.h
diff --git a/src/objects-visiting-inl.h b/src/objects-visiting-inl.h
index bb2e99243a1d72bf318e246a14e34b1665f2b3cc..189b5024e5d36494f516dc83d5c2522508c64b34 100644
--- a/src/objects-visiting-inl.h
+++ b/src/objects-visiting-inl.h
@@ -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: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 805b7f894f0ddf454686cb62a376c36608118891..229eb5a6e8a026c4a64e4c79d83f1d3ed52271c3 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -2629,6 +2629,7 @@ class JSObject: public JSReceiver {
   // permissible values (see the ASSERT in heap.cc).
   static const int kInitialMaxFastElementArray = 100000;

+  static const int kInitialUnusedPropertiesCount = 4;
   static const int kFastPropertiesSoftLimit = 12;
   static const int kMaxFastProperties = 128;
   static const int kMaxInstanceSize = 255 * kPointerSize;
@@ -6926,10 +6927,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: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 1f3dbb1e852e86fcc635bdb58066b2aa76df7af0..1820d3db091441ad7fea5748f7cae163ee58582d 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -3133,23 +3133,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: src/runtime.h
diff --git a/src/runtime.h b/src/runtime.h
index 6c498dee0d582b4766469936775cc4e263a0ab3c..327384904c6a3362ced358da542e3f77f413d09b 100644
--- a/src/runtime.h
+++ b/src/runtime.h
@@ -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: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index cd60cb40d81f26b4ccca24d568af6855205948fb..368243f81f3bef4d60697c6f20a4f6a85a6882de 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -1396,7 +1396,6 @@ function SetUpObject() {

   %SetNativeFlag($Object);
   %SetCode($Object, ObjectConstructor);
-  %SetExpectedNumberOfProperties($Object, 4);

   %SetProperty($Object.prototype, "constructor", $Object, DONT_ENUM);

Index: tools/generate-runtime-tests.py
diff --git a/tools/generate-runtime-tests.py b/tools/generate-runtime-tests.py index 63f417e0ee48aab599f37a70cf20e0c49ecfa174..aadaefe3fb07b4b78afc66d0bb3ec452df2d48d0 100755
--- a/tools/generate-runtime-tests.py
+++ b/tools/generate-runtime-tests.py
@@ -24,8 +24,8 @@ THIS_SCRIPT = os.path.relpath(sys.argv[0])
# 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 = 338
-EXPECTED_FUZZABLE_COUNT = 305
+EXPECTED_FUNCTION_COUNT = 337
+EXPECTED_FUZZABLE_COUNT = 304
 EXPECTED_CCTEST_COUNT = 6
 EXPECTED_UNKNOWN_COUNT = 5



--
--
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/d/optout.

Reply via email to