summaryrefslogtreecommitdiff
path: root/deps/v8/src/code-stub-assembler.cc
diff options
context:
space:
mode:
authorMyles Borins <mylesborins@google.com>2018-06-11 13:12:02 -0400
committerMyles Borins <mylesborins@google.com>2018-06-13 11:12:01 -0400
commiteb2d3a3b9c9aed0c4bf2da743b163c5121bf8919 (patch)
tree8b4a21ea836a9d8e36a8dfce0a809ee4e4b3cd9e /deps/v8/src/code-stub-assembler.cc
parent59ace5752a13136eee7ae07ca173bc2addda2e9f (diff)
downloadnode-new-eb2d3a3b9c9aed0c4bf2da743b163c5121bf8919.tar.gz
deps: patch V8 to 6.7.288.46
PR-URL: https://github.com/nodejs/node/pull/21260 Refs: https://github.com/v8/v8/compare/6.7.288.45...6.7.288.46 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Diffstat (limited to 'deps/v8/src/code-stub-assembler.cc')
-rw-r--r--deps/v8/src/code-stub-assembler.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/deps/v8/src/code-stub-assembler.cc b/deps/v8/src/code-stub-assembler.cc
index 556efe7d0a..b85609d956 100644
--- a/deps/v8/src/code-stub-assembler.cc
+++ b/deps/v8/src/code-stub-assembler.cc
@@ -534,6 +534,18 @@ TNode<Smi> CodeStubAssembler::SmiFromInt32(SloppyTNode<Int32T> value) {
WordShl(value_intptr, SmiShiftBitsConstant()));
}
+TNode<BoolT> CodeStubAssembler::IsValidPositiveSmi(TNode<IntPtrT> value) {
+ intptr_t constant_value;
+ if (ToIntPtrConstant(value, constant_value)) {
+ return (static_cast<uintptr_t>(constant_value) <=
+ static_cast<uintptr_t>(Smi::kMaxValue))
+ ? Int32TrueConstant()
+ : Int32FalseConstant();
+ }
+
+ return UintPtrLessThanOrEqual(value, IntPtrConstant(Smi::kMaxValue));
+}
+
TNode<Smi> CodeStubAssembler::SmiTag(SloppyTNode<IntPtrT> value) {
int32_t constant_value;
if (ToInt32Constant(value, constant_value) && Smi::IsValid(constant_value)) {
@@ -1002,6 +1014,19 @@ void CodeStubAssembler::GotoIfForceSlowPath(Label* if_true) {
Node* CodeStubAssembler::AllocateRaw(Node* size_in_bytes, AllocationFlags flags,
Node* top_address, Node* limit_address) {
+ // TODO(jgruber, chromium:848672): TNodeify AllocateRaw.
+ // TODO(jgruber, chromium:848672): Call FatalProcessOutOfMemory if this fails.
+ {
+ intptr_t constant_value;
+ if (ToIntPtrConstant(size_in_bytes, constant_value)) {
+ CHECK(Internals::IsValidSmi(constant_value));
+ CHECK_GT(constant_value, 0);
+ } else {
+ CSA_CHECK(this,
+ IsValidPositiveSmi(UncheckedCast<IntPtrT>(size_in_bytes)));
+ }
+ }
+
Node* top = Load(MachineType::Pointer(), top_address);
Node* limit = Load(MachineType::Pointer(), limit_address);