v8/test/mjsunit/harmony/modules-import-namespace.js
Jakob Kummerow 8043f283f6 [test] Add test for Turbofan module namespace access
Turbofan support for property loads from module namespace objects
has been tested by the test/js-perf-tests/Modules/basic-namespace
benchmark, but so far not by the mjsunit suite. This CL adds such
a test.
This is a follow-up to 8d7379c066.

Change-Id: I3c4183d761693199e6bc8740b812279efcd791a0
Reviewed-on: https://chromium-review.googlesource.com/1142594
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54535}
2018-07-19 02:28:29 +00:00

20 lines
441 B
JavaScript

// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// MODULE
// Flags: --allow-natives-syntax
import * as m from "modules-skip-3.js";
function get() {
return m.stringlife;
}
assertEquals("42", get());
assertEquals("42", get());
assertEquals("42", get());
%OptimizeFunctionOnNextCall(get);
assertEquals("42", get());