[build] Change Typed Array threshold to an actual build time flag.

This was supposedly a runtime flag, but we baked it into the snapshot
anyway.

Change-Id: I09d43183c4c2d59336c1077089119d6cb65dfd87
Reviewed-on: https://chromium-review.googlesource.com/664721
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48026}
This commit is contained in:
Peter Marshall 2017-09-14 14:09:54 +02:00 committed by Commit Bot
parent 79a35ebca0
commit 3a4f9b10f1
7 changed files with 20 additions and 21 deletions

View File

@ -107,6 +107,9 @@ declare_args() {
# Similar to the ARM hard float ABI but on MIPS.
v8_use_mips_abi_hardfloat = true
# Controls the threshold for on-heap/off-heap Typed Arrays.
v8_typed_array_max_size_in_heap = 64
# List of extra files to snapshot. They will be snapshotted in order so
# if files export symbols used by later files, they should go first.
#
@ -235,6 +238,8 @@ config("features") {
defines +=
[ "V8_PROMISE_INTERNAL_FIELD_COUNT=${v8_promise_internal_field_count}" ]
}
defines +=
[ "V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=${v8_typed_array_max_size_in_heap}" ]
if (v8_enable_future) {
defines += [ "V8_ENABLE_FUTURE" ]
}

View File

@ -83,6 +83,9 @@
# Enable concurrent marking.
'v8_enable_concurrent_marking%': 0,
# Controls the threshold for on-heap/off-heap Typed Arrays.
'v8_typed_array_max_size_in_heap%': 64,
},
'target_defaults': {
'conditions': [
@ -160,6 +163,7 @@
}, # configurations
'defines': [
'V8_GYP_BUILD',
'V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=<(v8_typed_array_max_size_in_heap)',
], # defines
}, # target_defaults
}

View File

@ -10,6 +10,12 @@
namespace v8 {
namespace internal {
// This is needed for gc_mole which will compile this file without the full set
// of GN defined macros.
#ifndef V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP
#define V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP 64
#endif
// -----------------------------------------------------------------------------
// ES6 section 22.2 TypedArray Objects
@ -200,9 +206,9 @@ TF_BUILTIN(TypedArrayInitialize, TypedArrayBuiltinsAssembler) {
Node* fixed_typed_map = LoadMapForType(holder);
GotoIf(TaggedIsNotSmi(byte_length), &allocate_off_heap);
GotoIf(SmiGreaterThan(byte_length,
SmiConstant(FLAG_typed_array_max_size_in_heap)),
&allocate_off_heap);
GotoIf(
SmiGreaterThan(byte_length, SmiConstant(V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP)),
&allocate_off_heap);
Goto(&allocate_on_heap);
BIND(&allocate_on_heap);
@ -734,5 +740,7 @@ TF_BUILTIN(TypedArrayPrototypeKeys, TypedArrayBuiltinsAssembler) {
context, receiver, "%TypedArray%.prototype.keys()", IterationKind::kKeys);
}
#undef V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP
} // namespace internal
} // namespace v8

View File

@ -98,8 +98,6 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
case Runtime::kInlineTypedArrayGetLength:
return ReduceArrayBufferViewField(node,
AccessBuilder::ForJSTypedArrayLength());
case Runtime::kInlineTypedArrayMaxSizeInHeap:
return ReduceTypedArrayMaxSizeInHeap(node);
case Runtime::kInlineTheHole:
return ReduceTheHole(node);
case Runtime::kInlineClassOf:
@ -383,12 +381,6 @@ Reduction JSIntrinsicLowering::ReduceMaxSmi(Node* node) {
return Replace(value);
}
Reduction JSIntrinsicLowering::ReduceTypedArrayMaxSizeInHeap(Node* node) {
Node* value = jsgraph()->Constant(FLAG_typed_array_max_size_in_heap);
ReplaceWithValue(node, value);
return Replace(value);
}
Reduction JSIntrinsicLowering::ReduceTheHole(Node* node) {
Node* value = jsgraph()->TheHoleConstant();
ReplaceWithValue(node, value);

View File

@ -68,7 +68,6 @@ class V8_EXPORT_PRIVATE JSIntrinsicLowering final
Reduction ReduceArrayBufferViewField(Node* node, FieldAccess const& access);
Reduction ReduceArrayBufferViewWasNeutered(Node* node);
Reduction ReduceMaxSmi(Node* node);
Reduction ReduceTypedArrayMaxSizeInHeap(Node* node);
// TODO(turbofan): collection.js support; drop once Maps and Sets are
// converted to proper CodeStubAssembler based builtins.

View File

@ -156,14 +156,6 @@ RUNTIME_FUNCTION(Runtime_TypedArraySortFast) {
return *array;
}
RUNTIME_FUNCTION(Runtime_TypedArrayMaxSizeInHeap) {
DCHECK_EQ(0, args.length());
DCHECK_OBJECT_SIZE(FLAG_typed_array_max_size_in_heap +
FixedTypedArrayBase::kDataOffset);
return Smi::FromInt(FLAG_typed_array_max_size_in_heap);
}
RUNTIME_FUNCTION(Runtime_IsTypedArray) {
HandleScope scope(isolate);
DCHECK_EQ(1, args.length());

View File

@ -630,7 +630,6 @@ namespace internal {
F(TypedArrayGetLength, 1, 1) \
F(TypedArrayGetBuffer, 1, 1) \
F(TypedArraySortFast, 1, 1) \
F(TypedArrayMaxSizeInHeap, 0, 1) \
F(IsTypedArray, 1, 1) \
F(IsSharedTypedArray, 1, 1) \
F(IsSharedIntegerTypedArray, 1, 1) \