Skip to content

Commit 09f5e25

Browse files
targosgibfahn
authored andcommitted
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: #19824 Refs: v8/v8@7abdadc Fixes: #19769 Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
1 parent c97237b commit 09f5e25

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

deps/v8/include/v8-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 6
1212
#define V8_MINOR_VERSION 2
1313
#define V8_BUILD_NUMBER 414
14-
#define V8_PATCH_LEVEL 51
14+
#define V8_PATCH_LEVEL 52
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/api.cc

+1
Original file line numberDiff line numberDiff line change
@@ -5190,6 +5190,7 @@ Local<v8::Context> v8::Object::CreationContext() {
51905190

51915191

51925192
int v8::Object::GetIdentityHash() {
5193+
i::DisallowHeapAllocation no_gc;
51935194
auto isolate = Utils::OpenHandle(this)->GetIsolate();
51945195
i::HandleScope scope(isolate);
51955196
auto self = Utils::OpenHandle(this);

deps/v8/src/objects.cc

+10-1
Original file line numberDiff line numberDiff line change
@@ -2301,6 +2301,7 @@ namespace {
23012301
// objects. This avoids a double lookup in the cases where we know we will
23022302
// add the hash to the JSObject if it does not already exist.
23032303
Object* GetSimpleHash(Object* object) {
2304+
DisallowHeapAllocation no_gc;
23042305
// The object is either a Smi, a HeapNumber, a name, an odd-ball, a real JS
23052306
// object, or a Harmony proxy.
23062307
if (object->IsSmi()) {
@@ -2333,10 +2334,10 @@ Object* GetSimpleHash(Object* object) {
23332334
} // namespace
23342335

23352336
Object* Object::GetHash() {
2337+
DisallowHeapAllocation no_gc;
23362338
Object* hash = GetSimpleHash(this);
23372339
if (hash->IsSmi()) return hash;
23382340

2339-
DisallowHeapAllocation no_gc;
23402341
DCHECK(IsJSReceiver());
23412342
JSReceiver* receiver = JSReceiver::cast(this);
23422343
Isolate* isolate = receiver->GetIsolate();
@@ -2345,10 +2346,12 @@ Object* Object::GetHash() {
23452346

23462347
// static
23472348
Smi* Object::GetOrCreateHash(Isolate* isolate, Object* key) {
2349+
DisallowHeapAllocation no_gc;
23482350
return key->GetOrCreateHash(isolate);
23492351
}
23502352

23512353
Smi* Object::GetOrCreateHash(Isolate* isolate) {
2354+
DisallowHeapAllocation no_gc;
23522355
Object* hash = GetSimpleHash(this);
23532356
if (hash->IsSmi()) return Smi::cast(hash);
23542357

@@ -6286,6 +6289,7 @@ Object* SetHashAndUpdateProperties(HeapObject* properties, int masked_hash) {
62866289
}
62876290

62886291
int GetIdentityHashHelper(Isolate* isolate, JSReceiver* object) {
6292+
DisallowHeapAllocation no_gc;
62896293
Object* properties = object->raw_properties_or_hash();
62906294
if (properties->IsSmi()) {
62916295
return Smi::ToInt(properties);
@@ -6312,6 +6316,7 @@ int GetIdentityHashHelper(Isolate* isolate, JSReceiver* object) {
63126316
} // namespace
63136317

63146318
void JSReceiver::SetIdentityHash(int masked_hash) {
6319+
DisallowHeapAllocation no_gc;
63156320
DCHECK_NE(PropertyArray::kNoHashSentinel, masked_hash);
63166321
DCHECK_EQ(masked_hash & JSReceiver::kHashMask, masked_hash);
63176322

@@ -6322,6 +6327,7 @@ void JSReceiver::SetIdentityHash(int masked_hash) {
63226327
}
63236328

63246329
void JSReceiver::SetProperties(HeapObject* properties) {
6330+
DisallowHeapAllocation no_gc;
63256331
Isolate* isolate = properties->GetIsolate();
63266332
int hash = GetIdentityHashHelper(isolate, this);
63276333
Object* new_properties = properties;
@@ -6337,6 +6343,7 @@ void JSReceiver::SetProperties(HeapObject* properties) {
63376343

63386344
template <typename ProxyType>
63396345
Smi* GetOrCreateIdentityHashHelper(Isolate* isolate, ProxyType* proxy) {
6346+
DisallowHeapAllocation no_gc;
63406347
Object* maybe_hash = proxy->hash();
63416348
if (maybe_hash->IsSmi()) return Smi::cast(maybe_hash);
63426349

@@ -6346,6 +6353,7 @@ Smi* GetOrCreateIdentityHashHelper(Isolate* isolate, ProxyType* proxy) {
63466353
}
63476354

63486355
Object* JSObject::GetIdentityHash(Isolate* isolate) {
6356+
DisallowHeapAllocation no_gc;
63496357
if (IsJSGlobalProxy()) {
63506358
return JSGlobalProxy::cast(this)->hash();
63516359
}
@@ -6359,6 +6367,7 @@ Object* JSObject::GetIdentityHash(Isolate* isolate) {
63596367
}
63606368

63616369
Smi* JSObject::GetOrCreateIdentityHash(Isolate* isolate) {
6370+
DisallowHeapAllocation no_gc;
63626371
if (IsJSGlobalProxy()) {
63636372
return GetOrCreateIdentityHashHelper(isolate, JSGlobalProxy::cast(this));
63646373
}

0 commit comments

Comments
 (0)