Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Unified Diff: src/runtime.cc

Issue 15691017: Make assertion scopes thread safe. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 7e45753eba89e02bbe5006d92a0e4fc6a9f116f5..45ff8225595212b9e8559207bb3f868c73dc1bc8 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -568,7 +568,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateSymbol) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_SymbolName) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(Symbol, symbol, 0);
return symbol->name();
@@ -576,7 +576,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SymbolName) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateJSProxy) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(JSReceiver, handler, 0);
Object* prototype = args[1];
@@ -587,7 +587,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateJSProxy) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateJSFunctionProxy) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 4);
CONVERT_ARG_CHECKED(JSReceiver, handler, 0);
Object* call_trap = args[1];
@@ -602,7 +602,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateJSFunctionProxy) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_IsJSProxy) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
Object* obj = args[0];
return isolate->heap()->ToBoolean(obj->IsJSProxy());
@@ -610,7 +610,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_IsJSProxy) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_IsJSFunctionProxy) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
Object* obj = args[0];
return isolate->heap()->ToBoolean(obj->IsJSFunctionProxy());
@@ -618,7 +618,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_IsJSFunctionProxy) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetHandler) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSProxy, proxy, 0);
return proxy->handler();
@@ -626,7 +626,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetHandler) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetCallTrap) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSFunctionProxy, proxy, 0);
return proxy->call_trap();
@@ -634,7 +634,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetCallTrap) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetConstructTrap) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSFunctionProxy, proxy, 0);
return proxy->construct_trap();
@@ -642,7 +642,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetConstructTrap) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_Fix) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSProxy, proxy, 0);
proxy->Fix();
@@ -751,7 +751,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ArrayBufferInitialize) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_ArrayBufferGetByteLength) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSArrayBuffer, holder, 0);
return holder->byte_length();
@@ -1195,7 +1195,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_WeakMapSet) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_ClassOf) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
Object* obj = args[0];
if (!obj->IsJSObject()) return isolate->heap()->null_value();
@@ -1204,7 +1204,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ClassOf) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetPrototype) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(Object, obj, 0);
// We don't expect access checks to be needed on JSProxy objects.
@@ -1236,7 +1236,7 @@ static inline Object* GetPrototypeSkipHiddenPrototypes(Isolate* isolate,
RUNTIME_FUNCTION(MaybeObject*, Runtime_SetPrototype) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(JSObject, obj, 0);
CONVERT_ARG_CHECKED(Object, prototype, 1);
@@ -1265,7 +1265,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetPrototype) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_IsInPrototypeChain) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
// See ECMA-262, section 15.3.5.3, page 88 (steps 5 - 8).
Object* O = args[0];
@@ -1458,7 +1458,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetOwnProperty) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_PreventExtensions) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSObject, obj, 0);
return obj->PreventExtensions();
@@ -1466,7 +1466,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_PreventExtensions) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_IsExtensible) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSObject, obj, 0);
if (obj->IsJSGlobalProxy()) {
@@ -1501,7 +1501,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateApiFunction) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_IsTemplate) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
Object* arg = args[0];
bool result = arg->IsObjectTemplateInfo() || arg->IsFunctionTemplateInfo();
@@ -1510,7 +1510,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_IsTemplate) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetTemplateField) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(HeapObject, templ, 0);
CONVERT_SMI_ARG_CHECKED(index, 1)
@@ -1529,7 +1529,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetTemplateField) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_DisableAccessChecks) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(HeapObject, object, 0);
Map* old_map = object->map();
@@ -1548,7 +1548,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DisableAccessChecks) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_EnableAccessChecks) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(HeapObject, object, 0);
Map* old_map = object->map();
@@ -1781,7 +1781,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DeclareContextSlot) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_InitializeVarGlobal) {
- NoHandleAllocation nha(isolate);
+ SealHandleScope shs(isolate);
// args[0] == name
// args[1] == language_mode
// args[2] == value (optional)
@@ -1837,7 +1837,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_InitializeVarGlobal) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_InitializeConstGlobal) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
// All constants are declared with an initial value. The name
// of the constant is the first argument and the initial value
// is the second.
@@ -2043,7 +2043,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpExec) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpConstructResult) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 3);
CONVERT_SMI_ARG_CHECKED(elements_count, 0);
if (elements_count < 0 ||
@@ -2062,7 +2062,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpConstructResult) {
if (!maybe_new_object->ToObject(&new_object)) return maybe_new_object;
}
{
- AssertNoAllocation no_gc;
+ DisallowHeapAllocation no_gc;
HandleScope scope(isolate);
reinterpret_cast<HeapObject*>(new_object)->
set_map(isolate->native_context()->regexp_result_map());
@@ -2079,8 +2079,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpConstructResult) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpInitializeObject) {
- NoHandleAllocation ha(isolate);
- AssertNoAllocation no_alloc;
+ SealHandleScope shs(isolate);
+ DisallowHeapAllocation no_allocation;
ASSERT(args.length() == 5);
CONVERT_ARG_CHECKED(JSRegExp, regexp, 0);
CONVERT_ARG_CHECKED(String, source, 1);
@@ -2199,7 +2199,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SpecialArrayFunctions) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_IsClassicModeFunction) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSReceiver, callable, 0);
if (!callable->IsJSFunction()) {
@@ -2217,7 +2217,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_IsClassicModeFunction) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetDefaultReceiver) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSReceiver, callable, 0);
@@ -2275,7 +2275,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_MaterializeRegExpLiteral) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionGetName) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSFunction, f, 0);
@@ -2284,7 +2284,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionGetName) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionSetName) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(JSFunction, f, 0);
@@ -2295,7 +2295,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionSetName) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionNameShouldPrintAsAnonymous) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSFunction, f, 0);
return isolate->heap()->ToBoolean(
@@ -2304,7 +2304,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionNameShouldPrintAsAnonymous) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionMarkNameShouldPrintAsAnonymous) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSFunction, f, 0);
f->shared()->set_name_should_print_as_anonymous(true);
@@ -2313,7 +2313,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionMarkNameShouldPrintAsAnonymous) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionIsGenerator) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSFunction, f, 0);
return isolate->heap()->ToBoolean(f->shared()->is_generator());
@@ -2321,7 +2321,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionIsGenerator) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionRemovePrototype) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSFunction, f, 0);
@@ -2354,7 +2354,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionGetSourceCode) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionGetScriptSourcePosition) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSFunction, fun, 0);
@@ -2364,7 +2364,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionGetScriptSourcePosition) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionGetPositionForOffset) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(Code, code, 0);
@@ -2378,7 +2378,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionGetPositionForOffset) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionSetInstanceClassName) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(JSFunction, fun, 0);
@@ -2389,7 +2389,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionSetInstanceClassName) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionSetLength) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(JSFunction, fun, 0);
@@ -2400,7 +2400,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionSetLength) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionSetPrototype) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(JSFunction, fun, 0);
@@ -2415,7 +2415,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionSetPrototype) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionSetReadOnlyPrototype) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
RUNTIME_ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSFunction, function, 0);
@@ -2457,7 +2457,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionSetReadOnlyPrototype) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionIsAPIFunction) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSFunction, f, 0);
@@ -2466,7 +2466,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionIsAPIFunction) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionIsBuiltin) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSFunction, f, 0);
@@ -2556,7 +2556,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetExpectedNumberOfProperties) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateJSGeneratorObject) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 0);
JavaScriptFrameIterator it(isolate);
@@ -2584,7 +2584,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateJSGeneratorObject) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_SuspendJSGeneratorObject) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSGeneratorObject, generator_object, 0);
@@ -2643,7 +2643,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SuspendJSGeneratorObject) {
// EmitGeneratorResumeResume is called in any case, as it needs to reconstruct
// the stack frame and make space for arguments and operands.
RUNTIME_FUNCTION(MaybeObject*, Runtime_ResumeJSGeneratorObject) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 3);
CONVERT_ARG_CHECKED(JSGeneratorObject, generator_object, 0);
CONVERT_ARG_CHECKED(Object, value, 1);
@@ -2699,7 +2699,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ThrowGeneratorStateError) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_ObjectFreeze) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSObject, object, 0);
return object->Freeze(isolate);
@@ -2717,7 +2717,7 @@ MUST_USE_RESULT static MaybeObject* CharFromCode(Isolate* isolate,
RUNTIME_FUNCTION(MaybeObject*, Runtime_StringCharCodeAt) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(String, subject, 0);
@@ -2741,7 +2741,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringCharCodeAt) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_CharFromCode) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
return CharFromCode(isolate, args[0]);
}
@@ -2911,7 +2911,7 @@ class ReplacementStringBuilder {
Handle<String> joined_string;
if (is_ascii_) {
Handle<SeqOneByteString> seq = NewRawOneByteString(character_count_);
- AssertNoAllocation no_alloc;
+ DisallowHeapAllocation no_gc;
uint8_t* char_buffer = seq->GetChars();
StringBuilderConcatHelper(*subject_,
char_buffer,
@@ -2921,7 +2921,7 @@ class ReplacementStringBuilder {
} else {
// Non-ASCII.
Handle<SeqTwoByteString> seq = NewRawTwoByteString(character_count_);
- AssertNoAllocation no_alloc;
+ DisallowHeapAllocation no_gc;
uc16* char_buffer = seq->GetChars();
StringBuilderConcatHelper(*subject_,
char_buffer,
@@ -3163,7 +3163,7 @@ bool CompiledReplacement::Compile(Handle<String> replacement,
int capture_count,
int subject_length) {
{
- AssertNoAllocation no_alloc;
+ DisallowHeapAllocation no_gc;
String::FlatContent content = replacement->GetFlatContent();
ASSERT(content.IsFlat());
bool simple = false;
@@ -3314,7 +3314,7 @@ void FindStringIndicesDispatch(Isolate* isolate,
unsigned int limit,
Zone* zone) {
{
- AssertNoAllocation no_gc;
+ DisallowHeapAllocation no_gc;
String::FlatContent subject_content = subject->GetFlatContent();
String::FlatContent pattern_content = pattern->GetFlatContent();
ASSERT(subject_content.IsFlat());
@@ -3783,7 +3783,7 @@ int Runtime::StringMatch(Isolate* isolate,
if (!sub->IsFlat()) FlattenString(sub);
if (!pat->IsFlat()) FlattenString(pat);
- AssertNoAllocation no_heap_allocation; // ensure vectors stay valid
+ DisallowHeapAllocation no_gc; // ensure vectors stay valid
// Extract flattened substrings of cons strings before determining asciiness.
String::FlatContent seq_sub = sub->GetFlatContent();
String::FlatContent seq_pat = pat->GetFlatContent();
@@ -3894,7 +3894,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringLastIndexOf) {
if (!pat->IsFlat()) FlattenString(pat);
int position = -1;
- AssertNoAllocation no_heap_allocation; // ensure vectors stay valid
+ DisallowHeapAllocation no_gc; // ensure vectors stay valid
String::FlatContent sub_content = sub->GetFlatContent();
String::FlatContent pat_content = pat->GetFlatContent();
@@ -3928,7 +3928,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringLastIndexOf) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_StringLocaleCompare) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(String, str1, 0);
@@ -3976,7 +3976,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringLocaleCompare) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_SubString) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 3);
CONVERT_ARG_CHECKED(String, value, 0);
@@ -4238,7 +4238,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpExecMultiple) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToRadixString) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_SMI_ARG_CHECKED(radix, 1);
RUNTIME_ASSERT(2 <= radix && radix <= 36);
@@ -4274,7 +4274,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToRadixString) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToFixed) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_DOUBLE_ARG_CHECKED(value, 0);
@@ -4290,7 +4290,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToFixed) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToExponential) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_DOUBLE_ARG_CHECKED(value, 0);
@@ -4306,7 +4306,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToExponential) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToPrecision) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_DOUBLE_ARG_CHECKED(value, 0);
@@ -4443,7 +4443,7 @@ MaybeObject* Runtime::GetObjectProperty(Isolate* isolate,
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetProperty) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
Handle<Object> object = args.at<Object>(0);
@@ -4455,7 +4455,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetProperty) {
// KeyedGetProperty is called from KeyedLoadIC::GenerateGeneric.
RUNTIME_FUNCTION(MaybeObject*, Runtime_KeyedGetProperty) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
// Fast cases for getting named properties of the receiver JSObject
@@ -4663,7 +4663,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DefineOrRedefineDataProperty) {
// Return property without being observable by accessors or interceptors.
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetDataProperty) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0);
CONVERT_ARG_HANDLE_CHECKED(Name, key, 1);
@@ -4876,7 +4876,7 @@ MaybeObject* Runtime::DeleteObjectProperty(Isolate* isolate,
RUNTIME_FUNCTION(MaybeObject*, Runtime_SetProperty) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
RUNTIME_ASSERT(args.length() == 4 || args.length() == 5);
Handle<Object> object = args.at<Object>(0);
@@ -4915,7 +4915,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_TransitionElementsKind) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_TransitionElementsSmiToDouble) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
RUNTIME_ASSERT(args.length() == 1);
Handle<Object> object = args.at<Object>(0);
if (object->IsJSObject()) {
@@ -4932,7 +4932,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_TransitionElementsSmiToDouble) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_TransitionElementsDoubleToObject) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
RUNTIME_ASSERT(args.length() == 1);
Handle<Object> object = args.at<Object>(0);
if (object->IsJSObject()) {
@@ -4952,7 +4952,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_TransitionElementsDoubleToObject) {
// This is used to decide if we should transform null and undefined
// into the global object when doing call and apply.
RUNTIME_FUNCTION(MaybeObject*, Runtime_SetNativeFlag) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
RUNTIME_ASSERT(args.length() == 1);
Handle<Object> object = args.at<Object>(0);
@@ -5018,7 +5018,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StoreArrayLiteralElement) {
// Check whether debugger and is about to step into the callback that is passed
// to a built-in function such as Array.forEach.
RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugCallbackSupportsStepping) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
#ifdef ENABLE_DEBUGGER_SUPPORT
if (!isolate->IsDebuggerActive() || !isolate->debug()->StepInActive()) {
return isolate->heap()->false_value();
@@ -5038,7 +5038,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugCallbackSupportsStepping) {
// Set one shot breakpoints for the callback function that is passed to a
// built-in function such as Array.forEach to enable stepping into the callback.
RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPrepareStepInIfStepping) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
#ifdef ENABLE_DEBUGGER_SUPPORT
Debug* debug = isolate->debug();
if (!debug->IsStepping()) return isolate->heap()->undefined_value();
@@ -5057,7 +5057,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPrepareStepInIfStepping) {
// Set a local property, even if it is READ_ONLY. If the property does not
// exist, it will be added with attributes NONE.
RUNTIME_FUNCTION(MaybeObject*, Runtime_IgnoreAttributesAndSetProperty) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
RUNTIME_ASSERT(args.length() == 3 || args.length() == 4);
CONVERT_ARG_CHECKED(JSObject, object, 0);
CONVERT_ARG_CHECKED(Name, name, 1);
@@ -5077,7 +5077,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_IgnoreAttributesAndSetProperty) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_DeleteProperty) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 3);
CONVERT_ARG_CHECKED(JSReceiver, object, 0);
@@ -5108,7 +5108,7 @@ static Object* HasLocalPropertyImplementation(Isolate* isolate,
RUNTIME_FUNCTION(MaybeObject*, Runtime_HasLocalProperty) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(Name, key, 1);
@@ -5147,7 +5147,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_HasLocalProperty) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_HasProperty) {
- NoHandleAllocation na(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(JSReceiver, receiver, 0);
CONVERT_ARG_CHECKED(Name, key, 1);
@@ -5159,7 +5159,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_HasProperty) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_HasElement) {
- NoHandleAllocation na(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(JSReceiver, receiver, 0);
CONVERT_SMI_ARG_CHECKED(index, 1);
@@ -5171,7 +5171,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_HasElement) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_IsPropertyEnumerable) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(JSObject, object, 0);
@@ -5199,7 +5199,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetPropertyNames) {
// have none, the map of the object. This is used to speed up
// the check for deletions during a for-in.
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetPropertyNamesFast) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSReceiver, raw_object, 0);
@@ -5438,7 +5438,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_LocalKeys) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetArgumentsProperty) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
// Compute the frame holding the arguments.
@@ -5497,7 +5497,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetArgumentsProperty) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_ToFastProperties) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
Object* object = args[0];
return (object->IsJSObject() && !object->IsGlobalObject())
@@ -5507,7 +5507,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ToFastProperties) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_ToBool) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
return isolate->heap()->ToBoolean(args[0]->BooleanValue());
@@ -5517,7 +5517,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ToBool) {
// Returns the type string of a value; see ECMA-262, 11.4.3 (p 47).
// Possible optimizations: put the type string into the oddballs.
RUNTIME_FUNCTION(MaybeObject*, Runtime_Typeof) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
Object* obj = args[0];
if (obj->IsNumber()) return isolate->heap()->number_string();
@@ -5581,7 +5581,7 @@ static int ParseDecimalInteger(const uint8_t*s, int from, int to) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_StringToNumber) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(String, subject, 0);
subject->TryFlatten();
@@ -5636,7 +5636,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringToNumber) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NewString) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
CONVERT_SMI_ARG_CHECKED(length, 0);
CONVERT_BOOLEAN_ARG_CHECKED(is_one_byte, 1);
if (length == 0) return isolate->heap()->empty_string();
@@ -5699,7 +5699,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_BasicJSONStringify) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_StringParseInt) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
CONVERT_ARG_CHECKED(String, s, 0);
CONVERT_SMI_ARG_CHECKED(radix, 1);
@@ -5713,7 +5713,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringParseInt) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_StringParseFloat) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
CONVERT_ARG_CHECKED(String, str, 0);
// ECMA-262 section 15.1.2.3, empty string is NaN
@@ -5968,7 +5968,7 @@ MUST_USE_RESULT static MaybeObject* ConvertCase(
Arguments args,
Isolate* isolate,
unibrow::Mapping<typename ConvertTraits::UnibrowConverter, 128>* mapping) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
CONVERT_ARG_CHECKED(String, s, 0);
s = s->TryFlattenGetString();
@@ -6035,7 +6035,7 @@ static inline bool IsTrimWhiteSpace(unibrow::uchar c) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_StringTrim) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 3);
CONVERT_ARG_CHECKED(String, s, 0);
@@ -6161,7 +6161,7 @@ static int CopyCachedAsciiCharsToArray(Heap* heap,
const uint8_t* chars,
FixedArray* elements,
int length) {
- AssertNoAllocation no_gc;
+ DisallowHeapAllocation no_gc;
FixedArray* ascii_cache = heap->single_character_string_cache();
Object* undefined = heap->undefined_value();
int i;
@@ -6207,7 +6207,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringToArray) {
if (!maybe_obj->ToObject(&obj)) return maybe_obj;
}
elements = Handle<FixedArray>(FixedArray::cast(obj), isolate);
- AssertNoAllocation no_gc;
+ DisallowHeapAllocation no_gc;
String::FlatContent content = s->GetFlatContent();
if (content.IsAscii()) {
Vector<const uint8_t> chars = content.ToOneByteVector();
@@ -6242,7 +6242,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringToArray) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NewStringWrapper) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(String, value, 0);
return value->ToObject();
@@ -6257,7 +6257,7 @@ bool Runtime::IsUpperCaseChar(RuntimeState* runtime_state, uint16_t ch) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToString) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
Object* number = args[0];
@@ -6268,7 +6268,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToString) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToStringSkipCache) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
Object* number = args[0];
@@ -6280,7 +6280,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToStringSkipCache) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToInteger) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_DOUBLE_ARG_CHECKED(number, 0);
@@ -6295,7 +6295,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToInteger) {
// ES6 draft 9.1.11
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToPositiveInteger) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_DOUBLE_ARG_CHECKED(number, 0);
@@ -6312,7 +6312,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToPositiveInteger) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToIntegerMapMinusZero) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_DOUBLE_ARG_CHECKED(number, 0);
@@ -6331,7 +6331,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToIntegerMapMinusZero) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToJSUint32) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_NUMBER_CHECKED(int32_t, number, Uint32, args[0]);
@@ -6340,7 +6340,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToJSUint32) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToJSInt32) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_DOUBLE_ARG_CHECKED(number, 0);
@@ -6356,7 +6356,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToJSInt32) {
// Converts a Number to a Smi, if possible. Returns NaN if the number is not
// a small integer.
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToSmi) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
Object* obj = args[0];
@@ -6375,14 +6375,14 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberToSmi) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_AllocateHeapNumber) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 0);
return isolate->heap()->AllocateHeapNumber(0);
}
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberAdd) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
@@ -6392,7 +6392,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberAdd) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberSub) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
@@ -6402,7 +6402,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberSub) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberMul) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
@@ -6412,7 +6412,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberMul) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberUnaryMinus) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
@@ -6421,7 +6421,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberUnaryMinus) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberAlloc) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 0);
return isolate->heap()->NumberFromDouble(9876543210.0);
@@ -6429,7 +6429,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberAlloc) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberDiv) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
@@ -6439,7 +6439,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberDiv) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberMod) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
@@ -6452,7 +6452,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberMod) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberImul) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_NUMBER_CHECKED(int32_t, x, Int32, args[0]);
@@ -6462,7 +6462,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberImul) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_StringAdd) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(String, str1, 0);
CONVERT_ARG_CHECKED(String, str2, 1);
@@ -6511,7 +6511,7 @@ static inline void StringBuilderConcatHelper(String* special,
RUNTIME_FUNCTION(MaybeObject*, Runtime_StringBuilderConcat) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 3);
CONVERT_ARG_CHECKED(JSArray, array, 0);
if (!args[1]->IsSmi()) {
@@ -6628,7 +6628,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringBuilderConcat) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_StringBuilderJoin) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 3);
CONVERT_ARG_CHECKED(JSArray, array, 0);
if (!args[1]->IsSmi()) {
@@ -6753,7 +6753,7 @@ static void JoinSparseArrayWithSeparator(FixedArray* elements,
RUNTIME_FUNCTION(MaybeObject*, Runtime_SparseJoinWithSeparator) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 3);
CONVERT_ARG_CHECKED(JSArray, elements_array, 0);
RUNTIME_ASSERT(elements_array->HasFastSmiOrObjectElements());
@@ -6849,7 +6849,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SparseJoinWithSeparator) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberOr) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_NUMBER_CHECKED(int32_t, x, Int32, args[0]);
@@ -6859,7 +6859,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberOr) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberAnd) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_NUMBER_CHECKED(int32_t, x, Int32, args[0]);
@@ -6869,7 +6869,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberAnd) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberXor) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_NUMBER_CHECKED(int32_t, x, Int32, args[0]);
@@ -6879,7 +6879,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberXor) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberNot) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_NUMBER_CHECKED(int32_t, x, Int32, args[0]);
@@ -6888,7 +6888,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberNot) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberShl) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_NUMBER_CHECKED(int32_t, x, Int32, args[0]);
@@ -6898,7 +6898,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberShl) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberShr) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_NUMBER_CHECKED(uint32_t, x, Uint32, args[0]);
@@ -6908,7 +6908,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberShr) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberSar) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_NUMBER_CHECKED(int32_t, x, Int32, args[0]);
@@ -6918,7 +6918,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberSar) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberEquals) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
@@ -6937,7 +6937,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberEquals) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_StringEquals) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(String, x, 0);
@@ -6955,7 +6955,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringEquals) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberCompare) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 3);
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
@@ -6970,7 +6970,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NumberCompare) {
// Compare two Smis as if they were converted to strings and then
// compared lexicographically.
RUNTIME_FUNCTION(MaybeObject*, Runtime_SmiLexicographicCompare) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_SMI_ARG_CHECKED(x_value, 0);
CONVERT_SMI_ARG_CHECKED(y_value, 1);
@@ -7074,7 +7074,7 @@ static Object* FlatStringCompare(String* x, String* y) {
equal_prefix_result = Smi::FromInt(LESS);
}
int r;
- AssertNoAllocation no_gc;
+ DisallowHeapAllocation no_gc;
String::FlatContent x_content = x->GetFlatContent();
String::FlatContent y_content = y->GetFlatContent();
if (x_content.IsAscii()) {
@@ -7109,7 +7109,7 @@ static Object* FlatStringCompare(String* x, String* y) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_StringCompare) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(String, x, 0);
@@ -7144,7 +7144,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringCompare) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_acos) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
isolate->counters()->math_acos()->Increment();
@@ -7154,7 +7154,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_acos) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_asin) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
isolate->counters()->math_asin()->Increment();
@@ -7164,7 +7164,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_asin) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_atan) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
isolate->counters()->math_atan()->Increment();
@@ -7177,7 +7177,7 @@ static const double kPiDividedBy4 = 0.78539816339744830962;
RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_atan2) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
isolate->counters()->math_atan2()->Increment();
@@ -7200,7 +7200,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_atan2) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_ceil) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
isolate->counters()->math_ceil()->Increment();
@@ -7210,7 +7210,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_ceil) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_cos) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
isolate->counters()->math_cos()->Increment();
@@ -7220,7 +7220,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_cos) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_exp) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
isolate->counters()->math_exp()->Increment();
@@ -7231,7 +7231,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_exp) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_floor) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
isolate->counters()->math_floor()->Increment();
@@ -7241,7 +7241,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_floor) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_log) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
isolate->counters()->math_log()->Increment();
@@ -7252,7 +7252,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_log) {
// Slow version of Math.pow. We check for fast paths for special cases.
// Used if SSE2/VFP3 is not available.
RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_pow) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
isolate->counters()->math_pow()->Increment();
@@ -7274,7 +7274,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_pow) {
// Fast version of Math.pow if we know that y is not an integer and y is not
// -0.5 or 0.5. Used as slow case from full codegen.
RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_pow_cfunction) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
isolate->counters()->math_pow()->Increment();
@@ -7291,7 +7291,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_pow_cfunction) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_RoundNumber) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
isolate->counters()->math_round()->Increment();
@@ -7334,7 +7334,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_RoundNumber) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_sin) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
isolate->counters()->math_sin()->Increment();
@@ -7344,7 +7344,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_sin) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_sqrt) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
isolate->counters()->math_sqrt()->Increment();
@@ -7354,7 +7354,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_sqrt) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_tan) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
isolate->counters()->math_tan()->Increment();
@@ -7364,7 +7364,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_Math_tan) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_DateMakeDay) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_SMI_ARG_CHECKED(year, 0);
@@ -7507,7 +7507,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NewArgumentsFast) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NewStrictArgumentsFast) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 3);
JSFunction* callee = JSFunction::cast(args[0]);
@@ -7527,7 +7527,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NewStrictArgumentsFast) {
if (!maybe_obj->ToObject(&obj)) return maybe_obj;
}
- AssertNoAllocation no_gc;
+ DisallowHeapAllocation no_gc;
FixedArray* array = reinterpret_cast<FixedArray*>(obj);
array->set_map_no_write_barrier(isolate->heap()->fixed_array_map());
array->set_length(length);
@@ -7950,7 +7950,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyStubFailure) {
HandleScope scope(isolate);
ASSERT(args.length() == 0);
Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate);
- ASSERT(isolate->heap()->IsAllocationAllowed());
+ ASSERT(AllowHeapAllocation::IsAllowed());
delete deoptimizer;
return isolate->heap()->undefined_value();
}
@@ -7963,7 +7963,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyDeoptimized) {
Deoptimizer::BailoutType type =
static_cast<Deoptimizer::BailoutType>(args.smi_at(0));
Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate);
- ASSERT(isolate->heap()->IsAllocationAllowed());
+ ASSERT(AllowHeapAllocation::IsAllowed());
ASSERT(deoptimizer->compiled_code_kind() == Code::OPTIMIZED_FUNCTION);
@@ -8024,7 +8024,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyDeoptimized) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyOSR) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate);
delete deoptimizer;
return isolate->heap()->undefined_value();
@@ -8057,7 +8057,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ClearFunctionTypeFeedback) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_RunningInSimulator) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
#if defined(USE_SIMULATOR)
return isolate->heap()->true_value();
#else
@@ -8256,14 +8256,14 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CompileForOnStackReplacement) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_CheckIsBootstrapping) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
RUNTIME_ASSERT(isolate->bootstrapper()->IsActive());
return isolate->heap()->undefined_value();
}
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetRootNaN) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
RUNTIME_ASSERT(isolate->bootstrapper()->IsActive());
return isolate->heap()->nan_value();
}
@@ -8357,7 +8357,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetConstructorDelegate) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NewGlobalContext) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(JSFunction, function, 0);
@@ -8377,7 +8377,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NewGlobalContext) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NewFunctionContext) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSFunction, function, 0);
@@ -8394,7 +8394,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NewFunctionContext) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_PushWithContext) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
JSObject* extension_object;
if (args[0]->IsJSObject()) {
@@ -8438,7 +8438,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_PushWithContext) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_PushCatchContext) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 3);
String* name = String::cast(args[0]);
Object* thrown_object = args[1];
@@ -8464,7 +8464,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_PushCatchContext) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_PushBlockContext) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
ScopeInfo* scope_info = ScopeInfo::cast(args[0]);
JSFunction* function;
@@ -8488,7 +8488,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_PushBlockContext) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_IsJSModule) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
Object* obj = args[0];
return isolate->heap()->ToBoolean(obj->IsJSModule());
@@ -8496,7 +8496,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_IsJSModule) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_PushModuleContext) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_SMI_ARG_CHECKED(index, 0);
@@ -8880,7 +8880,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ReThrow) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_PromoteScheduledException) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT_EQ(0, args.length());
return isolate->PromoteScheduledException();
}
@@ -8908,12 +8908,12 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ThrowNotDateError) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_StackGuard) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 0);
// First check if this is a real stack overflow.
if (isolate->stack_guard()->IsStackOverflow()) {
- NoHandleAllocation na(isolate);
+ SealHandleScope shs(isolate);
return isolate->StackOverflow();
}
@@ -8922,7 +8922,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StackGuard) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_Interrupt) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 0);
return Execution::HandleStackGuardInterrupt(isolate);
}
@@ -8958,7 +8958,7 @@ static void PrintTransition(Isolate* isolate, Object* result) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_TraceEnter) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 0);
PrintTransition(isolate, NULL);
return isolate->heap()->undefined_value();
@@ -8966,14 +8966,14 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_TraceEnter) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_TraceExit) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
PrintTransition(isolate, args[0]);
return args[0]; // return TOS
}
RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPrint) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
#ifdef DEBUG
@@ -9004,7 +9004,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPrint) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugTrace) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 0);
isolate->PrintStack(stdout);
return isolate->heap()->undefined_value();
@@ -9012,7 +9012,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugTrace) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_DateCurrentTime) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 0);
// According to ECMA-262, section 15.9.1, page 117, the precision of
@@ -9038,7 +9038,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DateParseString) {
if (maybe_result_array->IsFailure()) return maybe_result_array;
RUNTIME_ASSERT(output->HasFastObjectElements());
- AssertNoAllocation no_allocation;
+ DisallowHeapAllocation no_gc;
FixedArray* output_array = FixedArray::cast(output->elements());
RUNTIME_ASSERT(output_array->length() >= DateParser::OUTPUT_SIZE);
@@ -9064,7 +9064,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DateParseString) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_DateLocalTimezone) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
@@ -9075,7 +9075,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DateLocalTimezone) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_DateToUTC) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_DOUBLE_ARG_CHECKED(x, 0);
@@ -9086,7 +9086,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DateToUTC) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_GlobalReceiver) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
Object* global = args[0];
if (!global->IsJSGlobalObject()) return isolate->heap()->null_value();
@@ -9235,7 +9235,7 @@ static MaybeObject* Allocate(Isolate* isolate,
// Allocate a block of memory in the given space (filled with a filler).
// Use as fallback for allocation in generated code when the space
// is full.
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
RUNTIME_ASSERT(IsAligned(size, kPointerSize));
RUNTIME_ASSERT(size > 0);
Heap* heap = isolate->heap();
@@ -9257,7 +9257,7 @@ static MaybeObject* Allocate(Isolate* isolate,
RUNTIME_FUNCTION(MaybeObject*, Runtime_AllocateInNewSpace) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(Smi, size_smi, 0);
return Allocate(isolate, size_smi->value(), NEW_SPACE);
@@ -9265,7 +9265,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_AllocateInNewSpace) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_AllocateInOldPointerSpace) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(Smi, size_smi, 0);
return Allocate(isolate, size_smi->value(), OLD_POINTER_SPACE);
@@ -9273,7 +9273,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_AllocateInOldPointerSpace) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_AllocateInOldDataSpace) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(Smi, size_smi, 0);
return Allocate(isolate, size_smi->value(), OLD_DATA_SPACE);
@@ -9284,7 +9284,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_AllocateInOldDataSpace) {
// array. Returns true if the element was pushed on the stack and
// false otherwise.
RUNTIME_FUNCTION(MaybeObject*, Runtime_PushIfAbsent) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(JSArray, array, 0);
CONVERT_ARG_CHECKED(JSReceiver, element, 1);
@@ -10001,7 +10001,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ArrayConcat) {
// This will not allocate (flatten the string), but it may run
// very slowly for very deeply nested ConsStrings. For debugging use only.
RUNTIME_FUNCTION(MaybeObject*, Runtime_GlobalPrint) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(String, string, 0);
@@ -10020,7 +10020,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GlobalPrint) {
// property.
// Returns the number of non-undefined elements collected.
RUNTIME_FUNCTION(MaybeObject*, Runtime_RemoveArrayHoles) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(JSObject, object, 0);
CONVERT_NUMBER_CHECKED(uint32_t, limit, Uint32, args[1]);
@@ -10030,7 +10030,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_RemoveArrayHoles) {
// Move contents of argument 0 (an array) to argument 1 (an array)
RUNTIME_FUNCTION(MaybeObject*, Runtime_MoveArrayContents) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(JSArray, from, 0);
CONVERT_ARG_CHECKED(JSArray, to, 1);
@@ -10056,7 +10056,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_MoveArrayContents) {
// How many elements does this object/array have?
RUNTIME_FUNCTION(MaybeObject*, Runtime_EstimateNumberOfElements) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSObject, object, 0);
HeapObject* elements = object->elements();
@@ -10115,7 +10115,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetArrayKeys) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_LookupAccessor) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 3);
CONVERT_ARG_CHECKED(JSReceiver, receiver, 0);
CONVERT_ARG_CHECKED(Name, name, 1);
@@ -10128,7 +10128,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_LookupAccessor) {
#ifdef ENABLE_DEBUGGER_SUPPORT
RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugBreak) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 0);
return Execution::DebugBreakHelper();
}
@@ -10151,7 +10151,7 @@ static StackFrame::Id UnwrapFrameId(int wrapped) {
// clearing the event listener function
// args[1]: object supplied during callback
RUNTIME_FUNCTION(MaybeObject*, Runtime_SetDebugEventListener) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
RUNTIME_ASSERT(args[0]->IsJSFunction() ||
args[0]->IsUndefined() ||
@@ -10165,7 +10165,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetDebugEventListener) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_Break) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 0);
isolate->stack_guard()->DebugBreak();
return isolate->heap()->undefined_value();
@@ -10363,7 +10363,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugGetProperty) {
// Return the property type calculated from the property details.
// args[0]: smi with property details.
RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPropertyTypeFromDetails) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_PROPERTY_DETAILS_CHECKED(details, 0);
return Smi::FromInt(static_cast<int>(details.type()));
@@ -10373,7 +10373,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPropertyTypeFromDetails) {
// Return the property attribute calculated from the property details.
// args[0]: smi with property details.
RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPropertyAttributesFromDetails) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_PROPERTY_DETAILS_CHECKED(details, 0);
return Smi::FromInt(static_cast<int>(details.attributes()));
@@ -10383,7 +10383,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPropertyAttributesFromDetails) {
// Return the property insertion index calculated from the property details.
// args[0]: smi with property details.
RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugPropertyIndexFromDetails) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_PROPERTY_DETAILS_CHECKED(details, 0);
// TODO(verwaest): Depends on the type of details.
@@ -10421,7 +10421,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugIndexedInterceptorElementValue) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_CheckExecutionState) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() >= 1);
CONVERT_NUMBER_CHECKED(int, break_id, Int32, args[0]);
// Check that the break id is valid.
@@ -12322,8 +12322,8 @@ static int DebugReferencedBy(HeapIterator* iterator,
FixedArray* instances, int instances_size,
JSFunction* arguments_function) {
Isolate* isolate = target->GetIsolate();
- NoHandleAllocation ha(isolate);
- AssertNoAllocation no_alloc;
+ SealHandleScope shs(isolate);
+ DisallowHeapAllocation no_allocation;
// Iterate the heap.
int count = 0;
@@ -12391,7 +12391,7 @@ static int DebugReferencedBy(HeapIterator* iterator,
// args[1]: constructor function for instances to exclude (Mirror)
// args[2]: the the maximum number of objects to return
RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugReferencedBy) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 3);
// First perform a full GC in order to avoid references from dead objects.
@@ -12455,7 +12455,7 @@ static int DebugConstructedBy(HeapIterator* iterator,
int max_references,
FixedArray* instances,
int instances_size) {
- AssertNoAllocation no_alloc;
+ DisallowHeapAllocation no_allocation;
// Iterate the heap.
int count = 0;
@@ -12485,7 +12485,7 @@ static int DebugConstructedBy(HeapIterator* iterator,
// args[0]: the constructor to find instances of
// args[1]: the the maximum number of objects to return
RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugConstructedBy) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
// First perform a full GC in order to avoid dead objects.
@@ -12535,7 +12535,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugConstructedBy) {
// Find the effective prototype object as returned by __proto__.
// args[0]: the object to find the prototype for.
RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugGetPrototype) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSObject, obj, 0);
return GetPrototypeSkipHiddenPrototypes(isolate, obj);
@@ -12562,7 +12562,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugSetScriptSource) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_SystemBreak) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 0);
CPU::DebugBreak();
return isolate->heap()->undefined_value();
@@ -12600,7 +12600,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugDisassembleConstructor) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionGetInferredName) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
CONVERT_ARG_CHECKED(JSFunction, f, 0);
@@ -12611,7 +12611,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionGetInferredName) {
static int FindSharedFunctionInfosForScript(HeapIterator* iterator,
Script* script,
FixedArray* buffer) {
- AssertNoAllocation no_allocations;
+ DisallowHeapAllocation no_allocation;
int counter = 0;
int buffer_size = buffer->length();
for (HeapObject* obj = iterator->next();
@@ -12654,7 +12654,7 @@ RUNTIME_FUNCTION(MaybeObject*,
Heap* heap = isolate->heap();
{
heap->EnsureHeapIsIterable();
- AssertNoAllocation no_allocations;
+ DisallowHeapAllocation no_allocation;
HeapIterator heap_iterator(heap);
Script* scr = *script;
FixedArray* arr = *array;
@@ -12663,7 +12663,7 @@ RUNTIME_FUNCTION(MaybeObject*,
if (number > kBufferSize) {
array = isolate->factory()->NewFixedArray(number);
heap->EnsureHeapIsIterable();
- AssertNoAllocation no_allocations;
+ DisallowHeapAllocation no_allocation;
HeapIterator heap_iterator(heap);
Script* scr = *script;
FixedArray* arr = *array;
@@ -12948,7 +12948,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ExecuteInDebugContext) {
// Sets a v8 flag.
RUNTIME_FUNCTION(MaybeObject*, Runtime_SetFlags) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
CONVERT_ARG_CHECKED(String, arg, 0);
SmartArrayPointer<char> flags =
arg->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL);
@@ -12960,7 +12960,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetFlags) {
// Performs a GC.
// Presently, it only does a full GC.
RUNTIME_FUNCTION(MaybeObject*, Runtime_CollectGarbage) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, "%CollectGarbage");
return isolate->heap()->undefined_value();
}
@@ -12968,7 +12968,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CollectGarbage) {
// Gets the current heap usage.
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetHeapUsage) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
int usage = static_cast<int>(isolate->heap()->SizeOfObjects());
if (!Smi::IsValid(usage)) {
return *isolate->factory()->NewNumberFromInt(usage);
@@ -12980,14 +12980,14 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetHeapUsage) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_ProfilerResume) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
v8::V8::ResumeProfiler();
return isolate->heap()->undefined_value();
}
RUNTIME_FUNCTION(MaybeObject*, Runtime_ProfilerPause) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
v8::V8::PauseProfiler();
return isolate->heap()->undefined_value();
}
@@ -13006,7 +13006,7 @@ static Handle<Object> Runtime_GetScriptFromScriptName(
Handle<Script> script;
Heap* heap = script_name->GetHeap();
heap->EnsureHeapIsIterable();
- AssertNoAllocation no_allocation_during_heap_iteration;
+ DisallowHeapAllocation no_allocation_during_heap_iteration;
HeapIterator iterator(heap);
HeapObject* obj = NULL;
while (script.is_null() && ((obj = iterator.next()) != NULL)) {
@@ -13107,7 +13107,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetOverflowedStackTrace) {
// Returns V8 version as a string.
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetV8Version) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT_EQ(args.length(), 0);
const char* version_string = v8::V8::GetVersion();
@@ -13118,7 +13118,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetV8Version) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_Abort) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
OS::PrintError("abort: %s\n",
reinterpret_cast<char*>(args[0]) + args.smi_at(1));
@@ -13139,7 +13139,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_FlattenString) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetFromCache) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
// This is only called from codegen, so checks might be more lax.
CONVERT_ARG_CHECKED(JSFunctionResultCache, cache, 0);
Object* key = args[1];
@@ -13237,14 +13237,14 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetFromCache) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_MessageGetStartPosition) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
CONVERT_ARG_CHECKED(JSMessageObject, message, 0);
return Smi::FromInt(message->start_position());
}
RUNTIME_FUNCTION(MaybeObject*, Runtime_MessageGetScript) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
CONVERT_ARG_CHECKED(JSMessageObject, message, 0);
return message->script();
}
@@ -13298,11 +13298,11 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ListNatives) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_Log) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(String, format, 0);
CONVERT_ARG_CHECKED(JSArray, elms, 1);
- AssertNoAllocation no_gc;
+ DisallowHeapAllocation no_gc;
String::FlatContent format_content = format->GetFlatContent();
RUNTIME_ASSERT(format_content.IsAscii());
Vector<const uint8_t> chars = format_content.ToOneByteVector();
@@ -13347,7 +13347,7 @@ ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastProperties)
RUNTIME_FUNCTION(MaybeObject*, Runtime_HaveSameMap) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(JSObject, obj1, 0);
CONVERT_ARG_CHECKED(JSObject, obj2, 1);
@@ -13356,7 +13356,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_HaveSameMap) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_IsObserved) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
if (!args[0]->IsJSReceiver()) return isolate->heap()->false_value();
@@ -13372,7 +13372,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_IsObserved) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_SetIsObserved) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 2);
CONVERT_ARG_CHECKED(JSReceiver, obj, 0);
CONVERT_BOOLEAN_ARG_CHECKED(is_observed, 1);
@@ -13403,7 +13403,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetIsObserved) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_SetObserverDeliveryPending) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 0);
isolate->set_observer_delivery_pending(true);
return isolate->heap()->undefined_value();
@@ -13411,7 +13411,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetObserverDeliveryPending) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_GetObservationState) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 0);
return isolate->heap()->observation_state();
}
@@ -13432,7 +13432,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_ObservationWeakMapCreate) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_UnwrapGlobalProxy) {
- NoHandleAllocation ha(isolate);
+ SealHandleScope shs(isolate);
ASSERT(args.length() == 1);
Object* object = args[0];
if (object->IsJSGlobalProxy()) {
« src/api.cc ('K') | « src/optimizing-compiler-thread.cc ('k') | src/safepoint-table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698