Commit cbf3b0bc authored by svenpanne's avatar svenpanne Committed by Commit bot

More -fsanitize=vptr fixes.

This actually fixes 3 different issues when accessing Operand1:

   * Object vs. HeapObject

   * Wrong defaults for equals/hash

   * silently dropping const

TEST=test/mjsunit/regress/regress-441099.js
BUG=chromium:441099
LOG=y

Review URL: https://codereview.chromium.org/812563002

Cr-Commit-Position: refs/heads/master@{#25843}
parent 08146dc0
......@@ -1017,7 +1017,7 @@ void InstructionSelector::VisitFloat64RoundTiesAway(Node* node) {
void InstructionSelector::VisitCall(Node* node) {
ArmOperandGenerator g(this);
CallDescriptor* descriptor = OpParameter<CallDescriptor*>(node);
const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(node);
FrameStateDescriptor* frame_state_descriptor = NULL;
if (descriptor->NeedsFrameState()) {
......
......@@ -1085,7 +1085,7 @@ void InstructionSelector::VisitFloat64RoundTiesAway(Node* node) {
void InstructionSelector::VisitCall(Node* node) {
Arm64OperandGenerator g(this);
CallDescriptor* descriptor = OpParameter<CallDescriptor*>(node);
const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(node);
FrameStateDescriptor* frame_state_descriptor = NULL;
if (descriptor->NeedsFrameState()) {
......
......@@ -719,7 +719,7 @@ void InstructionSelector::VisitFloat64RoundTiesAway(Node* node) {
void InstructionSelector::VisitCall(Node* node) {
IA32OperandGenerator g(this);
CallDescriptor* descriptor = OpParameter<CallDescriptor*>(node);
const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(node);
FrameStateDescriptor* frame_state_descriptor = NULL;
......
......@@ -338,10 +338,10 @@ class FlagsContinuation FINAL {
// TODO(bmeurer): Get rid of the CallBuffer business and make
// InstructionSelector::VisitCall platform independent instead.
struct CallBuffer {
CallBuffer(Zone* zone, CallDescriptor* descriptor,
CallBuffer(Zone* zone, const CallDescriptor* descriptor,
FrameStateDescriptor* frame_state);
CallDescriptor* descriptor;
const CallDescriptor* descriptor;
FrameStateDescriptor* frame_state_descriptor;
NodeVector output_nodes;
InstructionOperandVector outputs;
......
......@@ -298,7 +298,7 @@ void InstructionSelector::MarkAsRepresentation(MachineType rep, Node* node) {
// TODO(bmeurer): Get rid of the CallBuffer business and make
// InstructionSelector::VisitCall platform independent instead.
CallBuffer::CallBuffer(Zone* zone, CallDescriptor* d,
CallBuffer::CallBuffer(Zone* zone, const CallDescriptor* d,
FrameStateDescriptor* frame_desc)
: descriptor(d),
frame_state_descriptor(frame_desc),
......
......@@ -438,7 +438,7 @@ void InstructionSelector::VisitFloat64RoundTiesAway(Node* node) {
void InstructionSelector::VisitCall(Node* node) {
MipsOperandGenerator g(this);
CallDescriptor* descriptor = OpParameter<CallDescriptor*>(node);
const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(node);
FrameStateDescriptor* frame_state_descriptor = NULL;
if (descriptor->NeedsFrameState()) {
......
......@@ -630,7 +630,7 @@ void InstructionSelector::VisitFloat64RoundTiesAway(Node* node) {
void InstructionSelector::VisitCall(Node* node) {
Mips64OperandGenerator g(this);
CallDescriptor* descriptor = OpParameter<CallDescriptor*>(node);
const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(node);
FrameStateDescriptor* frame_state_descriptor = NULL;
if (descriptor->NeedsFrameState()) {
......
......@@ -172,6 +172,20 @@ inline T const& OpParameter(const Operator* op) {
return static_cast<const Operator1<T>*>(op)->parameter();
}
// NOTE: We have to be careful to use the right equal/hash functions below, for
// float/double we always use the ones operating on the bit level.
template <>
inline float const& OpParameter(const Operator* op) {
return static_cast<const Operator1<float, base::bit_equal_to<float>,
base::bit_hash<float>>*>(op)->parameter();
}
template <>
inline double const& OpParameter(const Operator* op) {
return static_cast<const Operator1<double, base::bit_equal_to<double>,
base::bit_hash<double>>*>(op)->parameter();
}
} // namespace compiler
} // namespace internal
} // namespace v8
......
......@@ -626,7 +626,7 @@ Bounds Typer::Visitor::TypeNumberConstant(Node* node) {
Bounds Typer::Visitor::TypeHeapConstant(Node* node) {
return Bounds(TypeConstant(OpParameter<Unique<Object> >(node).handle()));
return Bounds(TypeConstant(OpParameter<Unique<HeapObject> >(node).handle()));
}
......
......@@ -922,7 +922,7 @@ void InstructionSelector::VisitFloat64RoundTiesAway(Node* node) {
void InstructionSelector::VisitCall(Node* node) {
X64OperandGenerator g(this);
CallDescriptor* descriptor = OpParameter<CallDescriptor*>(node);
const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(node);
FrameStateDescriptor* frame_state_descriptor = NULL;
if (descriptor->NeedsFrameState()) {
......
// Copyright 2014 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.
var Module;
if (!Module) Module = eval('(function() { try { return Module || {} } catch(e) { return {} } })()');
else if (ENVIRONMENT_IS_SHELL) {
}
var Runtime = {
stackSave: function () {
},
alignMemory: function (quantum) { var ret = size = Math.ceil()*(quantum ? quantum : 8); return ret; }}
function allocate() {
}
function callRuntimeCallbacks(callbacks) {
var callback = callbacks.shift();
var func = callback.func;
if (typeof func === 'number') {
} else {
func();
}
}
var __ATINIT__ = []; // functions called during startup
function ensureInitRuntime() {
callRuntimeCallbacks(__ATINIT__);
}
/* global initializers */ __ATINIT__.push({ func: function() { runPostSets() } });
function __formatString() {
switch (next) {
}
}
var Browser={mainLoop:{queue:[],pause:function () {
}},moduleContextCreatedCallbacks:[],workers:[],init:function () {
}};
var asm = (function() {
'use asm';
function setThrew() {
}
function runPostSets() {
}
function _main() {
}
function _free() {
}
return { runPostSets: runPostSets};
})
();
var runPostSets = Module["runPostSets"] = asm["runPostSets"];
var i64Math = (function() { // Emscripten wrapper
/**
*/
})();
ensureInitRuntime();
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