v8/test/mjsunit/tools/log-ic.js
Camillo Bruni cd658fd283 [mjsunit] Fix tmp log files for --log tests
https://crrev.com/c/2972915 previously added more gitignore files to the
repository. This left the repo dirty after running mjsunit tests due to
lingering .log files.

- Add test/mjsunit/tools/tmp dir to keep and ignore temporary log files
  without the need for a platform specific tmp dir
- Use temporary logfiles with --logfile=+ for log-ci.js tests

Change-Id: I1b1a47f45603d6c3027c6ca7050c78e8df0664ce
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2992720
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75451}
2021-06-30 07:06:50 +00:00

62 lines
1.3 KiB
JavaScript

// Copyright 2019 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.
// Flags: --log-ic --logfile='+' --allow-natives-syntax
// The idea behind this test is to make sure we do not crash when using the
// --log-ic flag.
(function testLoadIC() {
function loadIC(obj) {
return obj.field;
}
%EnsureFeedbackVectorForFunction(loadIC);
var obj = {field: 'hello'};
loadIC(obj);
loadIC(obj);
loadIC(obj);
})();
(function testStoreIC() {
function storeIC(obj, value) {
return obj.field = value;
}
%EnsureFeedbackVectorForFunction(storeIC);
var obj = {field: 'hello'};
storeIC(obj, 'world');
storeIC(obj, 'world');
storeIC(obj, 'world');
})();
(function testKeyedLoadIC() {
function keyedLoadIC(obj, field) {
return obj[field];
}
%EnsureFeedbackVectorForFunction(keyedLoadIC);
var obj = {field: 'hello'};
keyedLoadIC(obj, 'field');
keyedLoadIC(obj, 'field');
keyedLoadIC(obj, 'field');
})();
(function testKeyedStoreIC() {
function keyedStoreIC(obj, field, value) {
return obj[field] = value;
}
%EnsureFeedbackVectorForFunction(keyedStoreIC);
var obj = {field: 'hello'};
keyedStoreIC(obj, 'field', 'world');
keyedStoreIC(obj, 'field', 'world');
keyedStoreIC(obj, 'field', 'world');
})();