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);
HeapObject::RawField(object, JSWeakCollection::kSize));
}
- static void BeforeVisitingSharedFunctionInfo(HeapObject* object) {}
-
INLINE(static void VisitPointer(Heap* heap, Object** p)) {
Object* obj = *p;
if (obj->IsHeapObject()) {
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 =
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)
template<typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfoStrongCode(
Heap* heap, HeapObject* object) {
- StaticVisitor::BeforeVisitingSharedFunctionInfo(object);
Object** start_slot =
HeapObject::RawField(object,
SharedFunctionInfo::BodyDescriptor::kStartOffset);
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);
// 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;
// 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)
}
-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);
F(GetV8Version, 0, 1) \
\
F(SetCode, 2, 1) \
- F(SetExpectedNumberOfProperties, 2, 1) \
\
F(CreateApiFunction, 2, 1) \
F(IsTemplate, 1, 1) \
%SetNativeFlag($Object);
%SetCode($Object, ObjectConstructor);
- %SetExpectedNumberOfProperties($Object, 4);
%SetProperty($Object.prototype, "constructor", $Object, DONT_ENUM);
+++ /dev/null
-// 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);
# 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