Remove unused runtime functions
The list of runtime function use counts was generated with: $ grep -o '^ *F(\w*' src/runtime/runtime.h | sed 's/^ *F(//' | sort | while read f; do USE_COUNT=$(git grep "\(Runtime::k\|Runtime::kInline\|%\|%_\)$f" | wc -l); echo $USE_COUNT $f; done This reduces libv8.so size by 59K on an x64 release build. Bug: v8:7310 Change-Id: Ib4d097e63ed065f41bf73e9529e4354575be5229 Reviewed-on: https://chromium-review.googlesource.com/934272 Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Commit-Queue: Jakob Gruber <jgruber@chromium.org> Cr-Commit-Position: refs/heads/master@{#51526}
This commit is contained in:
parent
61d653c99b
commit
1ee80ebab0
@ -288,17 +288,6 @@ Object* DoFunctionBind(Isolate* isolate, BuiltinArguments args) {
|
||||
// ES6 section 19.2.3.2 Function.prototype.bind ( thisArg, ...args )
|
||||
BUILTIN(FunctionPrototypeBind) { return DoFunctionBind(isolate, args); }
|
||||
|
||||
// TODO(verwaest): This is a temporary helper until the FastFunctionBind stub
|
||||
// can tailcall to the builtin directly.
|
||||
RUNTIME_FUNCTION(Runtime_FunctionBind) {
|
||||
DCHECK_EQ(2, args.length());
|
||||
Arguments* incoming = reinterpret_cast<Arguments*>(args[0]);
|
||||
// Rewrap the arguments as builtins arguments.
|
||||
int argc = incoming->length() + BuiltinArguments::kNumExtraArgsWithReceiver;
|
||||
BuiltinArguments caller_args(argc, incoming->arguments() + 1);
|
||||
return DoFunctionBind(isolate, caller_args);
|
||||
}
|
||||
|
||||
// ES6 section 19.2.3.5 Function.prototype.toString ( )
|
||||
BUILTIN(FunctionPrototypeToString) {
|
||||
HandleScope scope(isolate);
|
||||
|
@ -323,8 +323,6 @@ bool IntrinsicHasNoSideEffect(Runtime::FunctionId id) {
|
||||
V(CreateArrayLiteral) \
|
||||
V(CreateObjectLiteral) \
|
||||
V(CreateRegExpLiteral) \
|
||||
/* Collections */ \
|
||||
V(GenericHash) \
|
||||
/* Called from builtins */ \
|
||||
V(ClassOf) \
|
||||
V(StringAdd) \
|
||||
|
116
src/objects.cc
116
src/objects.cc
@ -699,39 +699,6 @@ Handle<String> Object::TypeOf(Isolate* isolate, Handle<Object> object) {
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
MaybeHandle<Object> Object::Multiply(Isolate* isolate, Handle<Object> lhs,
|
||||
Handle<Object> rhs) {
|
||||
if (!lhs->IsNumber() || !rhs->IsNumber()) {
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, lhs, Object::ToNumber(lhs), Object);
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, rhs, Object::ToNumber(rhs), Object);
|
||||
}
|
||||
return isolate->factory()->NewNumber(lhs->Number() * rhs->Number());
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
MaybeHandle<Object> Object::Divide(Isolate* isolate, Handle<Object> lhs,
|
||||
Handle<Object> rhs) {
|
||||
if (!lhs->IsNumber() || !rhs->IsNumber()) {
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, lhs, Object::ToNumber(lhs), Object);
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, rhs, Object::ToNumber(rhs), Object);
|
||||
}
|
||||
return isolate->factory()->NewNumber(lhs->Number() / rhs->Number());
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
MaybeHandle<Object> Object::Modulus(Isolate* isolate, Handle<Object> lhs,
|
||||
Handle<Object> rhs) {
|
||||
if (!lhs->IsNumber() || !rhs->IsNumber()) {
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, lhs, Object::ToNumber(lhs), Object);
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, rhs, Object::ToNumber(rhs), Object);
|
||||
}
|
||||
return isolate->factory()->NewNumber(Modulo(lhs->Number(), rhs->Number()));
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
MaybeHandle<Object> Object::Add(Isolate* isolate, Handle<Object> lhs,
|
||||
Handle<Object> rhs) {
|
||||
@ -757,89 +724,6 @@ MaybeHandle<Object> Object::Add(Isolate* isolate, Handle<Object> lhs,
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
MaybeHandle<Object> Object::Subtract(Isolate* isolate, Handle<Object> lhs,
|
||||
Handle<Object> rhs) {
|
||||
if (!lhs->IsNumber() || !rhs->IsNumber()) {
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, lhs, Object::ToNumber(lhs), Object);
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, rhs, Object::ToNumber(rhs), Object);
|
||||
}
|
||||
return isolate->factory()->NewNumber(lhs->Number() - rhs->Number());
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
MaybeHandle<Object> Object::ShiftLeft(Isolate* isolate, Handle<Object> lhs,
|
||||
Handle<Object> rhs) {
|
||||
if (!lhs->IsNumber() || !rhs->IsNumber()) {
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, lhs, Object::ToNumber(lhs), Object);
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, rhs, Object::ToNumber(rhs), Object);
|
||||
}
|
||||
return isolate->factory()->NewNumberFromInt(NumberToInt32(*lhs)
|
||||
<< (NumberToUint32(*rhs) & 0x1F));
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
MaybeHandle<Object> Object::ShiftRight(Isolate* isolate, Handle<Object> lhs,
|
||||
Handle<Object> rhs) {
|
||||
if (!lhs->IsNumber() || !rhs->IsNumber()) {
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, lhs, Object::ToNumber(lhs), Object);
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, rhs, Object::ToNumber(rhs), Object);
|
||||
}
|
||||
return isolate->factory()->NewNumberFromInt(NumberToInt32(*lhs) >>
|
||||
(NumberToUint32(*rhs) & 0x1F));
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
MaybeHandle<Object> Object::ShiftRightLogical(Isolate* isolate,
|
||||
Handle<Object> lhs,
|
||||
Handle<Object> rhs) {
|
||||
if (!lhs->IsNumber() || !rhs->IsNumber()) {
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, lhs, Object::ToNumber(lhs), Object);
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, rhs, Object::ToNumber(rhs), Object);
|
||||
}
|
||||
return isolate->factory()->NewNumberFromUint(NumberToUint32(*lhs) >>
|
||||
(NumberToUint32(*rhs) & 0x1F));
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
MaybeHandle<Object> Object::BitwiseAnd(Isolate* isolate, Handle<Object> lhs,
|
||||
Handle<Object> rhs) {
|
||||
if (!lhs->IsNumber() || !rhs->IsNumber()) {
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, lhs, Object::ToNumber(lhs), Object);
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, rhs, Object::ToNumber(rhs), Object);
|
||||
}
|
||||
return isolate->factory()->NewNumberFromInt(NumberToInt32(*lhs) &
|
||||
NumberToInt32(*rhs));
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
MaybeHandle<Object> Object::BitwiseOr(Isolate* isolate, Handle<Object> lhs,
|
||||
Handle<Object> rhs) {
|
||||
if (!lhs->IsNumber() || !rhs->IsNumber()) {
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, lhs, Object::ToNumber(lhs), Object);
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, rhs, Object::ToNumber(rhs), Object);
|
||||
}
|
||||
return isolate->factory()->NewNumberFromInt(NumberToInt32(*lhs) |
|
||||
NumberToInt32(*rhs));
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
MaybeHandle<Object> Object::BitwiseXor(Isolate* isolate, Handle<Object> lhs,
|
||||
Handle<Object> rhs) {
|
||||
if (!lhs->IsNumber() || !rhs->IsNumber()) {
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, lhs, Object::ToNumber(lhs), Object);
|
||||
ASSIGN_RETURN_ON_EXCEPTION(isolate, rhs, Object::ToNumber(rhs), Object);
|
||||
}
|
||||
return isolate->factory()->NewNumberFromInt(NumberToInt32(*lhs) ^
|
||||
NumberToInt32(*rhs));
|
||||
}
|
||||
|
||||
// static
|
||||
MaybeHandle<Object> Object::OrdinaryHasInstance(Isolate* isolate,
|
||||
Handle<Object> callable,
|
||||
|
@ -1355,34 +1355,10 @@ class Object {
|
||||
// ES6 section 12.5.6 The typeof Operator
|
||||
static Handle<String> TypeOf(Isolate* isolate, Handle<Object> object);
|
||||
|
||||
// ES6 section 12.6 Multiplicative Operators
|
||||
MUST_USE_RESULT static MaybeHandle<Object> Multiply(Isolate* isolate,
|
||||
Handle<Object> lhs,
|
||||
Handle<Object> rhs);
|
||||
MUST_USE_RESULT static MaybeHandle<Object> Divide(Isolate* isolate,
|
||||
Handle<Object> lhs,
|
||||
Handle<Object> rhs);
|
||||
MUST_USE_RESULT static MaybeHandle<Object> Modulus(Isolate* isolate,
|
||||
Handle<Object> lhs,
|
||||
Handle<Object> rhs);
|
||||
|
||||
// ES6 section 12.7 Additive Operators
|
||||
MUST_USE_RESULT static MaybeHandle<Object> Add(Isolate* isolate,
|
||||
Handle<Object> lhs,
|
||||
Handle<Object> rhs);
|
||||
MUST_USE_RESULT static MaybeHandle<Object> Subtract(Isolate* isolate,
|
||||
Handle<Object> lhs,
|
||||
Handle<Object> rhs);
|
||||
|
||||
// ES6 section 12.8 Bitwise Shift Operators
|
||||
MUST_USE_RESULT static MaybeHandle<Object> ShiftLeft(Isolate* isolate,
|
||||
Handle<Object> lhs,
|
||||
Handle<Object> rhs);
|
||||
MUST_USE_RESULT static MaybeHandle<Object> ShiftRight(Isolate* isolate,
|
||||
Handle<Object> lhs,
|
||||
Handle<Object> rhs);
|
||||
MUST_USE_RESULT static MaybeHandle<Object> ShiftRightLogical(
|
||||
Isolate* isolate, Handle<Object> lhs, Handle<Object> rhs);
|
||||
|
||||
// ES6 section 12.9 Relational Operators
|
||||
MUST_USE_RESULT static inline Maybe<bool> GreaterThan(Handle<Object> x,
|
||||
@ -1394,17 +1370,6 @@ class Object {
|
||||
MUST_USE_RESULT static inline Maybe<bool> LessThanOrEqual(Handle<Object> x,
|
||||
Handle<Object> y);
|
||||
|
||||
// ES6 section 12.11 Binary Bitwise Operators
|
||||
MUST_USE_RESULT static MaybeHandle<Object> BitwiseAnd(Isolate* isolate,
|
||||
Handle<Object> lhs,
|
||||
Handle<Object> rhs);
|
||||
MUST_USE_RESULT static MaybeHandle<Object> BitwiseOr(Isolate* isolate,
|
||||
Handle<Object> lhs,
|
||||
Handle<Object> rhs);
|
||||
MUST_USE_RESULT static MaybeHandle<Object> BitwiseXor(Isolate* isolate,
|
||||
Handle<Object> lhs,
|
||||
Handle<Object> rhs);
|
||||
|
||||
// ES6 section 7.3.19 OrdinaryHasInstance (C, O).
|
||||
MUST_USE_RESULT static MaybeHandle<Object> OrdinaryHasInstance(
|
||||
Isolate* isolate, Handle<Object> callable, Handle<Object> object);
|
||||
|
@ -29,20 +29,6 @@ RUNTIME_FUNCTION(Runtime_TheHole) {
|
||||
return isolate->heap()->the_hole_value();
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_GetExistingHash) {
|
||||
SealHandleScope shs(isolate);
|
||||
DCHECK_EQ(1, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
|
||||
return object->GetHash();
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_GenericHash) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(1, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
|
||||
return object->GetOrCreateHash(isolate);
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_SetGrow) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(1, args.length());
|
||||
@ -113,15 +99,6 @@ RUNTIME_FUNCTION(Runtime_GetWeakMapEntries) {
|
||||
return *JSWeakCollection::GetEntries(holder, max_entries);
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_WeakCollectionInitialize) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(1, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(JSWeakCollection, weak_collection, 0);
|
||||
JSWeakCollection::Initialize(weak_collection, isolate);
|
||||
return *weak_collection;
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_WeakCollectionDelete) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(3, args.length());
|
||||
|
@ -1041,26 +1041,6 @@ RUNTIME_FUNCTION(Runtime_SetScopeVariableValue) {
|
||||
return isolate->heap()->ToBoolean(res);
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_DebugPrintScopes) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(0, args.length());
|
||||
|
||||
#ifdef DEBUG
|
||||
// Print the scopes for the top frame.
|
||||
JavaScriptFrameIterator it(isolate);
|
||||
if (!it.done()) {
|
||||
JavaScriptFrame* frame = it.frame();
|
||||
FrameInspector frame_inspector(frame, 0, isolate);
|
||||
for (ScopeIterator si(isolate, &frame_inspector); !si.Done(); si.Next()) {
|
||||
si.DebugPrint();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return isolate->heap()->undefined_value();
|
||||
}
|
||||
|
||||
|
||||
// Sets the disable break state
|
||||
// args[0]: disable break state
|
||||
RUNTIME_FUNCTION(Runtime_SetBreakPointsActive) {
|
||||
@ -1578,46 +1558,6 @@ int ScriptLinePosition(Handle<Script> script, int line) {
|
||||
|
||||
} // namespace
|
||||
|
||||
// TODO(5530): Remove once uses in debug.js are gone.
|
||||
RUNTIME_FUNCTION(Runtime_ScriptLineStartPosition) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
CONVERT_ARG_CHECKED(JSValue, script, 0);
|
||||
CONVERT_NUMBER_CHECKED(int32_t, line, Int32, args[1]);
|
||||
|
||||
CHECK(script->value()->IsScript());
|
||||
Handle<Script> script_handle = Handle<Script>(Script::cast(script->value()));
|
||||
|
||||
return Smi::FromInt(ScriptLinePosition(script_handle, line));
|
||||
}
|
||||
|
||||
// TODO(5530): Remove once uses in debug.js are gone.
|
||||
RUNTIME_FUNCTION(Runtime_ScriptLineEndPosition) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
CONVERT_ARG_CHECKED(JSValue, script, 0);
|
||||
CONVERT_NUMBER_CHECKED(int32_t, line, Int32, args[1]);
|
||||
|
||||
CHECK(script->value()->IsScript());
|
||||
Handle<Script> script_handle = Handle<Script>(Script::cast(script->value()));
|
||||
|
||||
if (script_handle->type() == Script::TYPE_WASM) {
|
||||
// Return zero for now; this function will disappear soon anyway.
|
||||
return Smi::FromInt(0);
|
||||
}
|
||||
|
||||
Script::InitLineEnds(script_handle);
|
||||
|
||||
FixedArray* line_ends_array = FixedArray::cast(script_handle->line_ends());
|
||||
const int line_count = line_ends_array->length();
|
||||
|
||||
if (line < 0 || line >= line_count) {
|
||||
return Smi::FromInt(-1);
|
||||
} else {
|
||||
return Smi::cast(line_ends_array->get(line));
|
||||
}
|
||||
}
|
||||
|
||||
static Handle<Object> GetJSPositionInfo(Handle<Script> script, int position,
|
||||
Script::OffsetFlag offset_flag,
|
||||
Isolate* isolate) {
|
||||
@ -1881,26 +1821,11 @@ RUNTIME_FUNCTION(Runtime_DebugAsyncFunctionPromiseCreated) {
|
||||
return isolate->heap()->undefined_value();
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_DebugPromiseReject) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(JSPromise, rejected_promise, 0);
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
|
||||
|
||||
isolate->debug()->OnPromiseReject(rejected_promise, value);
|
||||
return isolate->heap()->undefined_value();
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_DebugIsActive) {
|
||||
SealHandleScope shs(isolate);
|
||||
return Smi::FromInt(isolate->debug()->is_active());
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) {
|
||||
UNIMPLEMENTED();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
namespace {
|
||||
Handle<JSObject> MakeRangeObject(Isolate* isolate, const CoverageBlock& range) {
|
||||
Factory* factory = isolate->factory();
|
||||
|
@ -88,17 +88,6 @@ RUNTIME_FUNCTION(Runtime_FunctionGetContextData) {
|
||||
return fun->native_context()->debug_context_id();
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_FunctionSetLength) {
|
||||
SealHandleScope shs(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
|
||||
CONVERT_ARG_CHECKED(JSFunction, fun, 0);
|
||||
CONVERT_SMI_ARG_CHECKED(length, 1);
|
||||
fun->shared()->set_length(length);
|
||||
return isolate->heap()->undefined_value();
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_FunctionIsAPIFunction) {
|
||||
SealHandleScope shs(isolate);
|
||||
DCHECK_EQ(1, args.length());
|
||||
|
@ -37,24 +37,6 @@ RUNTIME_FUNCTION(Runtime_GetModuleNamespace) {
|
||||
return *Module::GetModuleNamespace(module, module_request);
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_LoadModuleVariable) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(1, args.length());
|
||||
CONVERT_SMI_ARG_CHECKED(index, 0);
|
||||
Handle<Module> module(isolate->context()->module());
|
||||
return *Module::LoadVariable(module, index);
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_StoreModuleVariable) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
CONVERT_SMI_ARG_CHECKED(index, 0);
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
|
||||
Handle<Module> module(isolate->context()->module());
|
||||
Module::StoreVariable(module, index, value);
|
||||
return isolate->heap()->undefined_value();
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_GetImportMetaObject) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(0, args.length());
|
||||
|
@ -758,26 +758,6 @@ RUNTIME_FUNCTION(Runtime_CompleteInobjectSlackTrackingForMap) {
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_LoadMutableDouble) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0);
|
||||
CONVERT_ARG_HANDLE_CHECKED(Smi, index, 1);
|
||||
CHECK_EQ(index->value() & 1, 1);
|
||||
FieldIndex field_index =
|
||||
FieldIndex::ForLoadByFieldIndex(object->map(), index->value());
|
||||
if (field_index.is_inobject()) {
|
||||
CHECK(field_index.property_index() <
|
||||
object->map()->GetInObjectProperties());
|
||||
} else {
|
||||
CHECK(field_index.outobject_array_index() <
|
||||
object->property_dictionary()->length());
|
||||
}
|
||||
return *JSObject::FastPropertyAt(object, Representation::Double(),
|
||||
field_index);
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_TryMigrateInstance) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(1, args.length());
|
||||
@ -795,13 +775,6 @@ RUNTIME_FUNCTION(Runtime_TryMigrateInstance) {
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_IsJSGlobalProxy) {
|
||||
SealHandleScope shs(isolate);
|
||||
DCHECK_EQ(1, args.length());
|
||||
CONVERT_ARG_CHECKED(Object, obj, 0);
|
||||
return isolate->heap()->ToBoolean(obj->IsJSGlobalProxy());
|
||||
}
|
||||
|
||||
static bool IsValidAccessor(Isolate* isolate, Handle<Object> obj) {
|
||||
return obj->IsNullOrUndefined(isolate) || obj->IsCallable();
|
||||
}
|
||||
@ -911,25 +884,6 @@ RUNTIME_FUNCTION(Runtime_CollectTypeProfile) {
|
||||
return isolate->heap()->undefined_value();
|
||||
}
|
||||
|
||||
// Return property without being observable by accessors or interceptors.
|
||||
RUNTIME_FUNCTION(Runtime_GetDataProperty) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(JSReceiver, object, 0);
|
||||
CONVERT_ARG_HANDLE_CHECKED(Name, name, 1);
|
||||
return *JSReceiver::GetDataProperty(object, name);
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_GetConstructorName) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(1, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
|
||||
|
||||
CHECK(!object->IsNullOrUndefined(isolate));
|
||||
Handle<JSReceiver> recv = Object::ToObject(isolate, object).ToHandleChecked();
|
||||
return *JSReceiver::GetConstructorName(recv);
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_HasFastPackedElements) {
|
||||
SealHandleScope shs(isolate);
|
||||
DCHECK_EQ(1, args.length());
|
||||
|
@ -9,33 +9,6 @@
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_Multiply) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, lhs, 0);
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, rhs, 1);
|
||||
RETURN_RESULT_OR_FAILURE(isolate, Object::Multiply(isolate, lhs, rhs));
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_Divide) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, lhs, 0);
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, rhs, 1);
|
||||
RETURN_RESULT_OR_FAILURE(isolate, Object::Divide(isolate, lhs, rhs));
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_Modulus) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, lhs, 0);
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, rhs, 1);
|
||||
RETURN_RESULT_OR_FAILURE(isolate, Object::Modulus(isolate, lhs, rhs));
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_Add) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
@ -45,69 +18,6 @@ RUNTIME_FUNCTION(Runtime_Add) {
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_Subtract) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, lhs, 0);
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, rhs, 1);
|
||||
RETURN_RESULT_OR_FAILURE(isolate, Object::Subtract(isolate, lhs, rhs));
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_ShiftLeft) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, lhs, 0);
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, rhs, 1);
|
||||
RETURN_RESULT_OR_FAILURE(isolate, Object::ShiftLeft(isolate, lhs, rhs));
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_ShiftRight) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, lhs, 0);
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, rhs, 1);
|
||||
RETURN_RESULT_OR_FAILURE(isolate, Object::ShiftRight(isolate, lhs, rhs));
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_ShiftRightLogical) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, lhs, 0);
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, rhs, 1);
|
||||
RETURN_RESULT_OR_FAILURE(isolate,
|
||||
Object::ShiftRightLogical(isolate, lhs, rhs));
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_BitwiseAnd) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, lhs, 0);
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, rhs, 1);
|
||||
RETURN_RESULT_OR_FAILURE(isolate, Object::BitwiseAnd(isolate, lhs, rhs));
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_BitwiseOr) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, lhs, 0);
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, rhs, 1);
|
||||
RETURN_RESULT_OR_FAILURE(isolate, Object::BitwiseOr(isolate, lhs, rhs));
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_BitwiseXor) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, lhs, 0);
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, rhs, 1);
|
||||
RETURN_RESULT_OR_FAILURE(isolate, Object::BitwiseXor(isolate, lhs, rhs));
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_Equal) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
@ -184,14 +94,5 @@ RUNTIME_FUNCTION(Runtime_GreaterThanOrEqual) {
|
||||
return isolate->heap()->ToBoolean(result.FromJust());
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_InstanceOf) {
|
||||
HandleScope shs(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, callable, 1);
|
||||
RETURN_RESULT_OR_FAILURE(isolate,
|
||||
Object::InstanceOf(isolate, object, callable));
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace v8
|
||||
|
@ -1920,14 +1920,6 @@ RUNTIME_FUNCTION(Runtime_RegExpReplace) {
|
||||
RETURN_RESULT_OR_FAILURE(isolate, builder.Finish());
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_RegExpExecReThrow) {
|
||||
SealHandleScope shs(isolate);
|
||||
DCHECK_EQ(0, args.length());
|
||||
Object* exception = isolate->pending_exception();
|
||||
isolate->clear_pending_exception();
|
||||
return isolate->ReThrow(exception);
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_RegExpInitializeAndCompile) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(3, args.length());
|
||||
|
@ -12,17 +12,6 @@
|
||||
namespace v8 {
|
||||
namespace internal {
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_CreateSymbol) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(1, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(Object, name, 0);
|
||||
CHECK(name->IsString() || name->IsUndefined(isolate));
|
||||
Handle<Symbol> symbol = isolate->factory()->NewSymbol();
|
||||
if (name->IsString()) symbol->set_name(*name);
|
||||
return *symbol;
|
||||
}
|
||||
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_CreatePrivateSymbol) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_GE(1, args.length());
|
||||
|
@ -175,22 +175,6 @@ RUNTIME_FUNCTION(Runtime_IsConcurrentRecompilationSupported) {
|
||||
isolate->concurrent_recompilation_enabled());
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_TypeProfile) {
|
||||
HandleScope scope(isolate);
|
||||
DCHECK_EQ(1, args.length());
|
||||
|
||||
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
|
||||
if (function->has_feedback_vector()) {
|
||||
FeedbackVector* vector = function->feedback_vector();
|
||||
if (vector->metadata()->HasTypeProfileSlot()) {
|
||||
FeedbackSlot slot = vector->GetTypeProfileSlot();
|
||||
FeedbackNexus nexus(vector, slot);
|
||||
return nexus.GetTypeProfile();
|
||||
}
|
||||
}
|
||||
return *isolate->factory()->NewJSObject(isolate->object_function());
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_OptimizeFunctionOnNextCall) {
|
||||
HandleScope scope(isolate);
|
||||
|
||||
@ -745,31 +729,6 @@ RUNTIME_FUNCTION(Runtime_TraceExit) {
|
||||
return obj; // return TOS
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_GetExceptionDetails) {
|
||||
HandleScope shs(isolate);
|
||||
DCHECK_EQ(1, args.length());
|
||||
CONVERT_ARG_HANDLE_CHECKED(JSObject, exception_obj, 0);
|
||||
|
||||
Factory* factory = isolate->factory();
|
||||
Handle<JSMessageObject> message_obj =
|
||||
isolate->CreateMessage(exception_obj, nullptr);
|
||||
|
||||
Handle<JSObject> message = factory->NewJSObject(isolate->object_function());
|
||||
|
||||
Handle<String> key;
|
||||
Handle<Object> value;
|
||||
|
||||
key = factory->NewStringFromAsciiChecked("start_pos");
|
||||
value = handle(Smi::FromInt(message_obj->start_position()), isolate);
|
||||
JSObject::SetProperty(message, key, value, LanguageMode::kStrict).Assert();
|
||||
|
||||
key = factory->NewStringFromAsciiChecked("end_pos");
|
||||
value = handle(Smi::FromInt(message_obj->end_position()), isolate);
|
||||
JSObject::SetProperty(message, key, value, LanguageMode::kStrict).Assert();
|
||||
|
||||
return *message;
|
||||
}
|
||||
|
||||
RUNTIME_FUNCTION(Runtime_HaveSameMap) {
|
||||
SealHandleScope shs(isolate);
|
||||
DCHECK_EQ(2, args.length());
|
||||
@ -864,7 +823,6 @@ ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(DoubleElements)
|
||||
ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(HoleyElements)
|
||||
ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(DictionaryElements)
|
||||
ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(SloppyArgumentsElements)
|
||||
ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FixedTypedArrayElements)
|
||||
// Properties test sitting with elements tests - not fooling anyone.
|
||||
ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastProperties)
|
||||
|
||||
|
@ -44,7 +44,6 @@ namespace internal {
|
||||
F(GetArrayKeys, 2, 1) \
|
||||
F(TrySliceSimpleNonFastElements, 3, 1) \
|
||||
F(NewArray, -1 /* >= 3 */, 1) \
|
||||
F(FunctionBind, -1, 1) \
|
||||
F(NormalizeElements, 1, 1) \
|
||||
F(GrowArrayElements, 2, 1) \
|
||||
F(HasComplexElements, 1, 1) \
|
||||
@ -97,8 +96,6 @@ namespace internal {
|
||||
|
||||
#define FOR_EACH_INTRINSIC_COLLECTIONS(F) \
|
||||
F(TheHole, 0, 1) \
|
||||
F(GenericHash, 1, 1) \
|
||||
F(GetExistingHash, 1, 1) \
|
||||
F(SetGrow, 1, 1) \
|
||||
F(SetShrink, 1, 1) \
|
||||
F(SetIteratorClone, 1, 1) \
|
||||
@ -106,7 +103,6 @@ namespace internal {
|
||||
F(MapGrow, 1, 1) \
|
||||
F(MapIteratorClone, 1, 1) \
|
||||
F(GetWeakMapEntries, 2, 1) \
|
||||
F(WeakCollectionInitialize, 1, 1) \
|
||||
F(WeakCollectionDelete, 3, 1) \
|
||||
F(WeakCollectionSet, 4, 1) \
|
||||
F(GetWeakSetValues, 2, 1) \
|
||||
@ -150,7 +146,6 @@ namespace internal {
|
||||
F(GetGeneratorScopeCount, 1, 1) \
|
||||
F(GetGeneratorScopeDetails, 2, 1) \
|
||||
F(SetScopeVariableValue, 6, 1) \
|
||||
F(DebugPrintScopes, 0, 1) \
|
||||
F(SetBreakPointsActive, 1, 1) \
|
||||
F(GetBreakLocations, 1, 1) \
|
||||
F(SetFunctionBreakPoint, 3, 1) \
|
||||
@ -174,8 +169,6 @@ namespace internal {
|
||||
F(GetHeapUsage, 0, 1) \
|
||||
F(GetScript, 1, 1) \
|
||||
F(ScriptLineCount, 1, 1) \
|
||||
F(ScriptLineStartPosition, 2, 1) \
|
||||
F(ScriptLineEndPosition, 2, 1) \
|
||||
F(ScriptLocationFromLine, 4, 1) \
|
||||
F(ScriptLocationFromLine2, 4, 1) \
|
||||
F(ScriptPositionInfo, 3, 1) \
|
||||
@ -185,10 +178,8 @@ namespace internal {
|
||||
F(DebugPrepareStepInSuspendedGenerator, 0, 1) \
|
||||
F(DebugPushPromise, 1, 1) \
|
||||
F(DebugPopPromise, 0, 1) \
|
||||
F(DebugPromiseReject, 2, 1) \
|
||||
F(DebugAsyncFunctionPromiseCreated, 1, 1) \
|
||||
F(DebugIsActive, 0, 1) \
|
||||
F(DebugBreakInOptimizedCode, 0, 1) \
|
||||
F(DebugCollectCoverage, 0, 1) \
|
||||
F(DebugTogglePreciseCoverage, 1, 1) \
|
||||
F(DebugToggleBlockCoverage, 1, 1) \
|
||||
@ -227,7 +218,6 @@ namespace internal {
|
||||
F(FunctionGetSourceCode, 1, 1) \
|
||||
F(FunctionGetScriptSourcePosition, 1, 1) \
|
||||
F(FunctionGetContextData, 1, 1) \
|
||||
F(FunctionSetLength, 2, 1) \
|
||||
F(FunctionIsAPIFunction, 1, 1) \
|
||||
F(SetCode, 2, 1) \
|
||||
F(SetNativeFlag, 1, 1) \
|
||||
@ -357,9 +347,7 @@ namespace internal {
|
||||
#define FOR_EACH_INTRINSIC_MODULE(F) \
|
||||
F(DynamicImportCall, 2, 1) \
|
||||
F(GetImportMetaObject, 0, 1) \
|
||||
F(GetModuleNamespace, 1, 1) \
|
||||
F(LoadModuleVariable, 1, 1) \
|
||||
F(StoreModuleVariable, 2, 1)
|
||||
F(GetModuleNamespace, 1, 1)
|
||||
|
||||
#define FOR_EACH_INTRINSIC_NUMBERS(F) \
|
||||
F(IsValidSmi, 1, 1) \
|
||||
@ -401,14 +389,10 @@ namespace internal {
|
||||
F(AllocateHeapNumber, 0, 1) \
|
||||
F(NewObject, 2, 1) \
|
||||
F(CompleteInobjectSlackTrackingForMap, 1, 1) \
|
||||
F(LoadMutableDouble, 2, 1) \
|
||||
F(TryMigrateInstance, 1, 1) \
|
||||
F(IsJSGlobalProxy, 1, 1) \
|
||||
F(DefineAccessorPropertyUnchecked, 5, 1) \
|
||||
F(DefineDataPropertyInLiteral, 6, 1) \
|
||||
F(CollectTypeProfile, 3, 1) \
|
||||
F(GetDataProperty, 2, 1) \
|
||||
F(GetConstructorName, 1, 1) \
|
||||
F(HasFastPackedElements, 1, 1) \
|
||||
F(ValueOf, 1, 1) \
|
||||
F(IsJSReceiver, 1, 1) \
|
||||
@ -437,17 +421,7 @@ namespace internal {
|
||||
F(GetOwnPropertyDescriptor, 2, 1)
|
||||
|
||||
#define FOR_EACH_INTRINSIC_OPERATORS(F) \
|
||||
F(Multiply, 2, 1) \
|
||||
F(Divide, 2, 1) \
|
||||
F(Modulus, 2, 1) \
|
||||
F(Add, 2, 1) \
|
||||
F(Subtract, 2, 1) \
|
||||
F(ShiftLeft, 2, 1) \
|
||||
F(ShiftRight, 2, 1) \
|
||||
F(ShiftRightLogical, 2, 1) \
|
||||
F(BitwiseAnd, 2, 1) \
|
||||
F(BitwiseOr, 2, 1) \
|
||||
F(BitwiseXor, 2, 1) \
|
||||
F(Equal, 2, 1) \
|
||||
F(NotEqual, 2, 1) \
|
||||
F(StrictEqual, 2, 1) \
|
||||
@ -455,8 +429,7 @@ namespace internal {
|
||||
F(LessThan, 2, 1) \
|
||||
F(GreaterThan, 2, 1) \
|
||||
F(LessThanOrEqual, 2, 1) \
|
||||
F(GreaterThanOrEqual, 2, 1) \
|
||||
F(InstanceOf, 2, 1)
|
||||
F(GreaterThanOrEqual, 2, 1)
|
||||
|
||||
#define FOR_EACH_INTRINSIC_PROMISE(F) \
|
||||
F(EnqueueMicrotask, 1, 1) \
|
||||
@ -484,7 +457,6 @@ namespace internal {
|
||||
F(IsRegExp, 1, 1) \
|
||||
F(RegExpExec, 4, 1) \
|
||||
F(RegExpExecMultiple, 4, 1) \
|
||||
F(RegExpExecReThrow, 0, 1) \
|
||||
F(RegExpInitializeAndCompile, 3, 1) \
|
||||
F(RegExpInternalReplace, 3, 1) \
|
||||
F(RegExpReplace, 3, 1) \
|
||||
@ -545,7 +517,6 @@ namespace internal {
|
||||
F(StringMaxLength, 0, 1)
|
||||
|
||||
#define FOR_EACH_INTRINSIC_SYMBOL(F) \
|
||||
F(CreateSymbol, 1, 1) \
|
||||
F(CreatePrivateSymbol, -1 /* <= 1 */, 1) \
|
||||
F(CreatePrivateFieldSymbol, 0, 1) \
|
||||
F(SymbolDescription, 1, 1) \
|
||||
@ -571,7 +542,6 @@ namespace internal {
|
||||
F(FreezeWasmLazyCompilation, 1, 1) \
|
||||
F(GetCallable, 0, 1) \
|
||||
F(GetDeoptCount, 1, 1) \
|
||||
F(GetExceptionDetails, 1, 1) \
|
||||
F(GetOptimizationStatus, -1, 1) \
|
||||
F(GetUndetectable, 0, 1) \
|
||||
F(GetWasmRecoveredTrapCount, 0, 1) \
|
||||
@ -587,7 +557,6 @@ namespace internal {
|
||||
F(HasFixedInt16Elements, 1, 1) \
|
||||
F(HasFixedInt32Elements, 1, 1) \
|
||||
F(HasFixedInt8Elements, 1, 1) \
|
||||
F(HasFixedTypedArrayElements, 1, 1) \
|
||||
F(HasFixedUint16Elements, 1, 1) \
|
||||
F(HasFixedUint32Elements, 1, 1) \
|
||||
F(HasFixedUint8ClampedElements, 1, 1) \
|
||||
@ -628,7 +597,6 @@ namespace internal {
|
||||
F(SystemBreak, 0, 1) \
|
||||
F(TraceEnter, 0, 1) \
|
||||
F(TraceExit, 1, 1) \
|
||||
F(TypeProfile, 1, 1) \
|
||||
F(UnblockConcurrentRecompilation, 0, 1) \
|
||||
F(ValidateWasmInstancesChain, 2, 1) \
|
||||
F(ValidateWasmModuleState, 1, 1) \
|
||||
|
Loading…
Reference in New Issue
Block a user