Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1600)

Unified Diff: test/unittests/compiler/js-typed-lowering-unittest.cc

Issue 1482213002: [turbofan] Support for typed lowering of "prototype" load from functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/typer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/js-typed-lowering-unittest.cc
diff --git a/test/unittests/compiler/js-typed-lowering-unittest.cc b/test/unittests/compiler/js-typed-lowering-unittest.cc
index 7e80cfd32d151c54975ca93c8f46982024152060..af6bfbecf99ca69eff501516694a99ac915bc186 100644
--- a/test/unittests/compiler/js-typed-lowering-unittest.cc
+++ b/test/unittests/compiler/js-typed-lowering-unittest.cc
@@ -952,6 +952,27 @@ TEST_F(JSTypedLoweringTest, JSLoadNamedStringLength) {
}
+TEST_F(JSTypedLoweringTest, JSLoadNamedFunctionPrototype) {
+ VectorSlotPair feedback;
+ Handle<Name> name = factory()->prototype_string();
+ Handle<JSFunction> function = isolate()->object_function();
+ Handle<JSObject> function_prototype(JSObject::cast(function->prototype()));
+ Node* const receiver = Parameter(Type::Constant(function, zone()), 0);
+ Node* const vector = Parameter(Type::Internal(), 1);
+ Node* const context = Parameter(Type::Internal(), 2);
+ Node* const effect = graph()->start();
+ Node* const control = graph()->start();
+ TRACED_FOREACH(LanguageMode, language_mode, kLanguageModes) {
+ Reduction const r = Reduce(
+ graph()->NewNode(javascript()->LoadNamed(language_mode, name, feedback),
+ receiver, vector, context, EmptyFrameState(),
+ EmptyFrameState(), effect, control));
+ ASSERT_TRUE(r.Changed());
+ EXPECT_THAT(r.replacement(), IsHeapConstant(function_prototype));
+ }
+}
+
+
// -----------------------------------------------------------------------------
// JSAdd
« no previous file with comments | « src/compiler/typer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698