// freeze them in strong mode.
environment()->Pop(); // proto
environment()->Pop(); // literal
- const Operator* op = javascript()->CallRuntime(
- is_strong(language_mode()) ? Runtime::kFinalizeClassDefinitionStrong
- : Runtime::kFinalizeClassDefinition,
- 2);
+ const Operator* op =
+ javascript()->CallRuntime(Runtime::kFinalizeClassDefinition, 2);
literal = NewNode(op, literal, proto);
// Assign to class variable.
case Runtime::kAllocateInTargetSpace:
case Runtime::kDateField:
case Runtime::kFinalizeClassDefinition: // TODO(conradw): Is it safe?
- case Runtime::kFinalizeClassDefinitionStrong: // TODO(conradw): Is it safe?
case Runtime::kDefineClassMethod: // TODO(jarin): Is it safe?
case Runtime::kDefineGetterPropertyUnchecked: // TODO(jarin): Is it safe?
case Runtime::kDefineSetterPropertyUnchecked: // TODO(jarin): Is it safe?
// Set both the prototype and constructor to have fast properties, and also
// freeze them in strong mode.
- __ CallRuntime(is_strong(language_mode())
- ? Runtime::kFinalizeClassDefinitionStrong
- : Runtime::kFinalizeClassDefinition,
- 2);
+ __ CallRuntime(Runtime::kFinalizeClassDefinition, 2);
}
// Set both the prototype and constructor to have fast properties, and also
// freeze them in strong mode.
- __ CallRuntime(is_strong(language_mode())
- ? Runtime::kFinalizeClassDefinitionStrong
- : Runtime::kFinalizeClassDefinition,
- 2);
+ __ CallRuntime(Runtime::kFinalizeClassDefinition, 2);
}
// Set both the prototype and constructor to have fast properties, and also
// freeze them in strong mode.
- __ CallRuntime(is_strong(language_mode())
- ? Runtime::kFinalizeClassDefinitionStrong
- : Runtime::kFinalizeClassDefinition,
- 2);
+ __ CallRuntime(Runtime::kFinalizeClassDefinition, 2);
}
// Set both the prototype and constructor to have fast properties, and also
// freeze them in strong mode.
- __ CallRuntime(is_strong(language_mode())
- ? Runtime::kFinalizeClassDefinitionStrong
- : Runtime::kFinalizeClassDefinition,
- 2);
+ __ CallRuntime(Runtime::kFinalizeClassDefinition, 2);
}
// Set both the prototype and constructor to have fast properties, and also
// freeze them in strong mode.
- __ CallRuntime(is_strong(language_mode())
- ? Runtime::kFinalizeClassDefinitionStrong
- : Runtime::kFinalizeClassDefinition,
- 2);
+ __ CallRuntime(Runtime::kFinalizeClassDefinition, 2);
}
// Set both the prototype and constructor to have fast properties, and also
// freeze them in strong mode.
- __ CallRuntime(is_strong(language_mode())
- ? Runtime::kFinalizeClassDefinitionStrong
- : Runtime::kFinalizeClassDefinition,
- 2);
+ __ CallRuntime(Runtime::kFinalizeClassDefinition, 2);
}
// Set both the prototype and constructor to have fast properties, and also
// freeze them in strong mode.
- __ CallRuntime(is_strong(language_mode())
- ? Runtime::kFinalizeClassDefinitionStrong
- : Runtime::kFinalizeClassDefinition,
- 2);
+ __ CallRuntime(Runtime::kFinalizeClassDefinition, 2);
}
// Set both the prototype and constructor to have fast properties, and also
// freeze them in strong mode.
- __ CallRuntime(is_strong(language_mode())
- ? Runtime::kFinalizeClassDefinitionStrong
- : Runtime::kFinalizeClassDefinition,
- 2);
+ __ CallRuntime(Runtime::kFinalizeClassDefinition, 2);
}
JSObject::MigrateSlowToFast(prototype, 0, "RuntimeToFastProperties");
JSObject::MigrateSlowToFast(constructor, 0, "RuntimeToFastProperties");
+ if (constructor->map()->is_strong()) {
+ DCHECK(prototype->map()->is_strong());
+ RETURN_FAILURE_ON_EXCEPTION(isolate, JSObject::Freeze(prototype));
+ Handle<Object> result;
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
+ JSObject::Freeze(constructor));
+ return *result;
+ }
return *constructor;
}
-RUNTIME_FUNCTION(Runtime_FinalizeClassDefinitionStrong) {
- HandleScope scope(isolate);
- DCHECK(args.length() == 2);
- CONVERT_ARG_HANDLE_CHECKED(JSObject, constructor, 0);
- CONVERT_ARG_HANDLE_CHECKED(JSObject, prototype, 1);
-
- JSObject::MigrateSlowToFast(prototype, 0, "RuntimeToFastProperties");
- JSObject::MigrateSlowToFast(constructor, 0, "RuntimeToFastProperties");
-
- RETURN_FAILURE_ON_EXCEPTION(isolate, JSObject::Freeze(prototype));
- Handle<Object> result;
- ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
- JSObject::Freeze(constructor));
- return *result;
-}
-
-
RUNTIME_FUNCTION(Runtime_ClassGetSourceCode) {
HandleScope shs(isolate);
DCHECK(args.length() == 1);
F(DefineClass, 6, 1) \
F(DefineClassStrong, 6, 1) \
F(FinalizeClassDefinition, 2, 1) \
- F(FinalizeClassDefinitionStrong, 2, 1) \
F(DefineClassMethod, 3, 1) \
F(ClassGetSourceCode, 1, 1) \
F(LoadFromSuper, 4, 1) \