[asm.js] Ensure proper encapsulation of "asmjs" component.

This makes sure that only the "asm-js.h" header is exposed to outside
the directory holding the asm.js validator. It ensures that internals
don't leak out of that component, unless they are explicitly exposed
through the defined interface.

R=clemensh@chromium.org
BUG=v8:6127

Change-Id: I7c41782254cfce102af8edf4356205cfca904e60
Reviewed-on: https://chromium-review.googlesource.com/496147
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45125}
This commit is contained in:
Michael Starzinger 2017-05-04 15:52:39 +02:00 committed by Commit Bot
parent 516d8438ad
commit 25959abf79
5 changed files with 12 additions and 7 deletions

View File

@ -1,6 +1,8 @@
include_rules = [
"+base/trace_event/common/trace_event_common.h",
"+src",
"-src/asmjs",
"+src/asmjs/asm-js.h",
"-src/compiler",
"+src/compiler/pipeline.h",
"+src/compiler/code-assembler.h",

View File

@ -5,6 +5,8 @@
#ifndef V8_ASMJS_ASM_JS_H_
#define V8_ASMJS_ASM_JS_H_
// Clients of this interface shouldn't depend on lots of asmjs internals.
// Do not include anything from src/asmjs here!
#include "src/globals.h"
namespace v8 {

View File

@ -108,4 +108,4 @@
V(kUnsigned, -3, "{unsigned value}") \
V(kDouble, -4, "{double value}")
#endif
#endif // V8_ASMJS_ASM_NAMES_H_

View File

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SRC_ASMJS_ASM_TYPES_H_
#define SRC_ASMJS_ASM_TYPES_H_
#ifndef V8_ASMJS_ASM_TYPES_H_
#define V8_ASMJS_ASM_TYPES_H_
#include <string>
@ -347,4 +347,4 @@ class V8_EXPORT_PRIVATE AsmType {
} // namespace internal
} // namespace v8
#endif // SRC_ASMJS_ASM_TYPES_H_
#endif // V8_ASMJS_ASM_TYPES_H_

View File

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_WASM_SWITCH_LOGIC_H
#define V8_WASM_SWITCH_LOGIC_H
#ifndef V8_ASMJS_SWITCH_LOGIC_H
#define V8_ASMJS_SWITCH_LOGIC_H
#include "src/globals.h"
#include "src/zone/zone-containers.h"
@ -25,8 +25,9 @@ struct CaseNode : public ZoneObject {
};
V8_EXPORT_PRIVATE CaseNode* OrderCases(ZoneVector<int>* cases, Zone* zone);
} // namespace wasm
} // namespace internal
} // namespace v8
#endif
#endif // V8_ASMJS_SWITCH_LOGIC_H