Commit 33f2012e authored by Benedikt Meurer's avatar Benedikt Meurer Committed by Commit Bot

[runtime] Remove unused %GetPrototype.

The %GetPrototype runtime function is not used anymore. Also remove the
cctests that were introduced to guard the Crankshaft optimizations for
the %_GetPrototype intrinsic.

Bug: v8:8015
Change-Id: I4b848f2c8d67209dae002d260a26867299d6b4a5
Reviewed-on: https://chromium-review.googlesource.com/1199106Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55541}
parent 923127f8
......@@ -459,14 +459,6 @@ MaybeHandle<Object> Runtime::SetObjectProperty(Isolate* isolate,
}
RUNTIME_FUNCTION(Runtime_GetPrototype) {
HandleScope scope(isolate);
DCHECK_EQ(1, args.length());
CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0);
RETURN_RESULT_OR_FAILURE(isolate, JSReceiver::GetPrototype(isolate, obj));
}
RUNTIME_FUNCTION(Runtime_InternalSetPrototype) {
HandleScope scope(isolate);
DCHECK_EQ(2, args.length());
......
......@@ -325,7 +325,6 @@ namespace internal {
F(GetOwnPropertyDescriptor, 2, 1) \
F(GetOwnPropertyKeys, 2, 1) \
F(GetProperty, 2, 1) \
F(GetPrototype, 1, 1) \
F(HasFastPackedElements, 1, 1) \
F(HasInPrototypeChain, 2, 1) \
F(HasProperty, 2, 1) \
......
......@@ -26450,58 +26450,6 @@ TEST(TurboAsmDisablesNeuter) {
CHECK(!result->IsNeuterable());
}
TEST(GetPrototypeAccessControl) {
i::FLAG_allow_natives_syntax = true;
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope handle_scope(isolate);
LocalContext env;
v8::Local<v8::ObjectTemplate> obj_template = v8::ObjectTemplate::New(isolate);
obj_template->SetAccessCheckCallback(AccessAlwaysBlocked);
CHECK(env->Global()
->Set(env.local(), v8_str("prohibited"),
obj_template->NewInstance(env.local()).ToLocalChecked())
.FromJust());
CHECK(CompileRun(
"function f() { return %_GetPrototype(prohibited); }"
"%OptimizeFunctionOnNextCall(f);"
"f();")->IsNull());
}
TEST(GetPrototypeHidden) {
i::FLAG_allow_natives_syntax = true;
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope handle_scope(isolate);
LocalContext env;
Local<FunctionTemplate> t = FunctionTemplate::New(isolate);
t->SetHiddenPrototype(true);
Local<Object> proto = t->GetFunction(env.local())
.ToLocalChecked()
->NewInstance(env.local())
.ToLocalChecked();
Local<Object> object = Object::New(isolate);
Local<Object> proto2 = Object::New(isolate);
object->SetPrototype(env.local(), proto).FromJust();
proto->SetPrototype(env.local(), proto2).FromJust();
CHECK(env->Global()->Set(env.local(), v8_str("object"), object).FromJust());
CHECK(env->Global()->Set(env.local(), v8_str("proto"), proto).FromJust());
CHECK(env->Global()->Set(env.local(), v8_str("proto2"), proto2).FromJust());
v8::Local<v8::Value> result = CompileRun("%_GetPrototype(object)");
CHECK(result->Equals(env.local(), proto2).FromJust());
result = CompileRun(
"function f() { return %_GetPrototype(object); }"
"%OptimizeFunctionOnNextCall(f);"
"f()");
CHECK(result->Equals(env.local(), proto2).FromJust());
}
TEST(ClassPrototypeCreationContext) {
v8::Isolate* isolate = CcTest::isolate();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment