mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
deps: cherry-pick 7abdadc from upstream V8
Original commit message:
Sprinkle some DisallowHeapAllocation
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I7d34ccddeea08f5935e360e8c36791365f27f89e
Reviewed-on: https://chromium-review.googlesource.com/647706
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47804}
PR-URL: https://github.com/nodejs/node/pull/19824
Refs: https://github.com/v8/v8/commit/7abdadca0e3e5a780647b8ade0c586c2e7583f9c
Fixes: https://github.com/nodejs/node/issues/19769
Reviewed-By: Yang Guo <yangguo@chromium.org>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
This commit is contained in:
1 parent
c97237bc10
commit
09f5e252bf
3 files changed
+12
-2
No files matched your search
Vendored
+1
-1
@@ -11,7 +11,7 @@
|
||||
#define V8_MAJOR_VERSION 6
|
||||
#define V8_MINOR_VERSION 2
|
||||
#define V8_BUILD_NUMBER 414
|
||||
#define V8_PATCH_LEVEL 51
|
||||
#define V8_PATCH_LEVEL 52
|
||||
|
||||
// Use 1 for candidates and 0 otherwise.
|
||||
// (Boolean macro values are not supported by all preprocessors.)
|
||||
|
||||
Vendored
+1
@@ -5190,6 +5190,7 @@ Local<v8::Context> v8::Object::CreationContext() {
|
||||
|
||||
|
||||
int v8::Object::GetIdentityHash() {
|
||||
i::DisallowHeapAllocation no_gc;
|
||||
auto isolate = Utils::OpenHandle(this)->GetIsolate();
|
||||
i::HandleScope scope(isolate);
|
||||
auto self = Utils::OpenHandle(this);
|
||||
|
||||
Vendored
+10
-1
@@ -2301,6 +2301,7 @@ namespace {
|
||||
// objects. This avoids a double lookup in the cases where we know we will
|
||||
// add the hash to the JSObject if it does not already exist.
|
||||
Object* GetSimpleHash(Object* object) {
|
||||
DisallowHeapAllocation no_gc;
|
||||
// The object is either a Smi, a HeapNumber, a name, an odd-ball, a real JS
|
||||
// object, or a Harmony proxy.
|
||||
if (object->IsSmi()) {
|
||||
@@ -2333,10 +2334,10 @@ Object* GetSimpleHash(Object* object) {
|
||||
} // namespace
|
||||
|
||||
Object* Object::GetHash() {
|
||||
DisallowHeapAllocation no_gc;
|
||||
Object* hash = GetSimpleHash(this);
|
||||
if (hash->IsSmi()) return hash;
|
||||
|
||||
DisallowHeapAllocation no_gc;
|
||||
DCHECK(IsJSReceiver());
|
||||
JSReceiver* receiver = JSReceiver::cast(this);
|
||||
Isolate* isolate = receiver->GetIsolate();
|
||||
@@ -2345,10 +2346,12 @@ Object* Object::GetHash() {
|
||||
|
||||
// static
|
||||
Smi* Object::GetOrCreateHash(Isolate* isolate, Object* key) {
|
||||
DisallowHeapAllocation no_gc;
|
||||
return key->GetOrCreateHash(isolate);
|
||||
}
|
||||
|
||||
Smi* Object::GetOrCreateHash(Isolate* isolate) {
|
||||
DisallowHeapAllocation no_gc;
|
||||
Object* hash = GetSimpleHash(this);
|
||||
if (hash->IsSmi()) return Smi::cast(hash);
|
||||
|
||||
@@ -6286,6 +6289,7 @@ Object* SetHashAndUpdateProperties(HeapObject* properties, int masked_hash) {
|
||||
}
|
||||
|
||||
int GetIdentityHashHelper(Isolate* isolate, JSReceiver* object) {
|
||||
DisallowHeapAllocation no_gc;
|
||||
Object* properties = object->raw_properties_or_hash();
|
||||
if (properties->IsSmi()) {
|
||||
return Smi::ToInt(properties);
|
||||
@@ -6312,6 +6316,7 @@ int GetIdentityHashHelper(Isolate* isolate, JSReceiver* object) {
|
||||
} // namespace
|
||||
|
||||
void JSReceiver::SetIdentityHash(int masked_hash) {
|
||||
DisallowHeapAllocation no_gc;
|
||||
DCHECK_NE(PropertyArray::kNoHashSentinel, masked_hash);
|
||||
DCHECK_EQ(masked_hash & JSReceiver::kHashMask, masked_hash);
|
||||
|
||||
@@ -6322,6 +6327,7 @@ void JSReceiver::SetIdentityHash(int masked_hash) {
|
||||
}
|
||||
|
||||
void JSReceiver::SetProperties(HeapObject* properties) {
|
||||
DisallowHeapAllocation no_gc;
|
||||
Isolate* isolate = properties->GetIsolate();
|
||||
int hash = GetIdentityHashHelper(isolate, this);
|
||||
Object* new_properties = properties;
|
||||
@@ -6337,6 +6343,7 @@ void JSReceiver::SetProperties(HeapObject* properties) {
|
||||
|
||||
template <typename ProxyType>
|
||||
Smi* GetOrCreateIdentityHashHelper(Isolate* isolate, ProxyType* proxy) {
|
||||
DisallowHeapAllocation no_gc;
|
||||
Object* maybe_hash = proxy->hash();
|
||||
if (maybe_hash->IsSmi()) return Smi::cast(maybe_hash);
|
||||
|
||||
@@ -6346,6 +6353,7 @@ Smi* GetOrCreateIdentityHashHelper(Isolate* isolate, ProxyType* proxy) {
|
||||
}
|
||||
|
||||
Object* JSObject::GetIdentityHash(Isolate* isolate) {
|
||||
DisallowHeapAllocation no_gc;
|
||||
if (IsJSGlobalProxy()) {
|
||||
return JSGlobalProxy::cast(this)->hash();
|
||||
}
|
||||
@@ -6359,6 +6367,7 @@ Object* JSObject::GetIdentityHash(Isolate* isolate) {
|
||||
}
|
||||
|
||||
Smi* JSObject::GetOrCreateIdentityHash(Isolate* isolate) {
|
||||
DisallowHeapAllocation no_gc;
|
||||
if (IsJSGlobalProxy()) {
|
||||
return GetOrCreateIdentityHashHelper(isolate, JSGlobalProxy::cast(this));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user