49 #define F(name, number_of_args, result_size) \
50 Object* Runtime_##name(int args_length, Object** args_object, \
53 #define P(name, number_of_args, result_size) \
54 ObjectPair Runtime_##name(int args_length, Object** args_object, \
57 #define I(name, number_of_args, result_size) \
58 Object* RuntimeReference_##name(int args_length, Object** args_object, \
73 bool* is_result_from_cache) {
74 Isolate* isolate = context->GetIsolate();
75 int properties_length = constant_properties->length();
76 int number_of_properties = properties_length / 2;
78 int number_of_string_keys = 0;
79 for (
int p = 0; p != properties_length; p += 2) {
80 Object* key = constant_properties->get(p);
82 if (key->IsInternalizedString()) {
83 number_of_string_keys++;
86 number_of_properties--;
91 DCHECK(number_of_string_keys != number_of_properties);
97 const int kMaxKeys = 10;
98 if ((number_of_string_keys == number_of_properties) &&
99 (number_of_string_keys < kMaxKeys)) {
102 isolate->
factory()->NewFixedArray(number_of_string_keys);
103 if (number_of_string_keys > 0) {
105 for (
int p = 0; p < properties_length; p += 2) {
106 Object* key = constant_properties->get(p);
107 if (key->IsInternalizedString()) {
108 keys->set(index++, key);
111 DCHECK(index == number_of_string_keys);
113 *is_result_from_cache =
true;
114 return isolate->
factory()->ObjectLiteralMapFromCache(context,
keys);
116 *is_result_from_cache =
false;
129 bool has_function_literal) {
143 bool is_result_from_cache =
false;
145 ?
Handle<Map>(context->object_function()->initial_map())
147 &is_result_from_cache);
153 isolate->
factory()->NewJSObjectFromMap(
map, pretenure_flag);
159 int length = constant_properties->length();
160 bool should_transform =
161 !is_result_from_cache && boilerplate->HasFastProperties();
162 bool should_normalize = should_transform || has_function_literal;
163 if (should_normalize) {
169 for (
int index = 0; index < length; index += 2) {
171 Handle<Object> value(constant_properties->get(index + 1), isolate);
172 if (value->IsFixedArray()) {
182 if (key->IsInternalizedString()) {
194 }
else if (key->ToArrayIndex(&element_index)) {
202 double num = key->Number();
221 if (should_transform && !has_function_literal) {
223 boilerplate->map()->unused_property_fields());
233 if (!object->IsJSObject()) {
259 isolate->
factory()->NewJSObject(constructor, pretenure_flag));
262 static_cast<ElementsKind>(Smi::cast(elements->get(0))->value());
264 FixedArrayBase::cast(elements->get(1)));
270 Object* maps_array = native_context->js_array_maps();
271 DCHECK(!maps_array->IsUndefined());
272 Object*
map = FixedArray::cast(maps_array)->get(constant_elements_kind);
273 object->set_map(Map::cast(
map));
278 copied_elements_values = isolate->
factory()->CopyFixedDoubleArray(
282 const bool is_cow = (constant_elements_values->map() ==
283 isolate->
heap()->fixed_cow_array_map());
285 copied_elements_values = constant_elements_values;
289 for (
int i = 0;
i < fixed_array_values->length();
i++) {
290 DCHECK(!fixed_array_values->get(
i)->IsFixedArray());
297 isolate->
factory()->CopyFixedArray(fixed_array_values);
298 copied_elements_values = fixed_array_values_copy;
299 for (
int i = 0;
i < fixed_array_values->length();
i++) {
300 if (fixed_array_values->get(
i)->IsFixedArray()) {
308 fixed_array_values_copy->set(
i, *result);
313 object->set_elements(*copied_elements_values);
314 object->set_length(
Smi::FromInt(copied_elements_values->length()));
324 const bool kHasNoFunctionLiteral =
false;
328 kHasNoFunctionLiteral);
331 kHasNoFunctionLiteral);
344 DCHECK(args.length() == 4);
349 bool should_have_fast_elements = (
flags & ObjectLiteral::kFastElements) != 0;
350 bool has_function_literal = (
flags & ObjectLiteral::kHasFunction) != 0;
352 RUNTIME_ASSERT(literals_index >= 0 && literals_index < literals->length());
358 if (*literal_site == isolate->heap()->undefined_value()) {
361 isolate, raw_boilerplate,
363 should_have_fast_elements,
364 has_function_literal));
371 creation_context.
ExitScope(site, boilerplate);
374 literals->set(literals_index, *site);
385 usage_context.
ExitScope(site, boilerplate);
398 if (*literal_site == isolate->
heap()->undefined_value()) {
399 DCHECK(*elements != isolate->
heap()->empty_fixed_array());
402 isolate, boilerplate,
409 &creation_context).is_null()) {
414 literals->set(literals_index, *site);
429 literals_index >= 0 && literals_index < literals->length(),
JSObject);
436 bool enable_mementos = (
flags & ArrayLiteral::kDisableMementos) == 0;
445 usage_context.
ExitScope(site, boilerplate);
452 DCHECK(args.length() == 4);
468 DCHECK(args.length() == 3);
477 ArrayLiteral::kShallowElements));
484 DCHECK(args.length() == 1);
488 if (
name->IsString()) symbol->set_name(*
name);
495 DCHECK(args.length() == 1);
499 if (
name->IsString()) symbol->set_name(*
name);
506 DCHECK(args.length() == 1);
509 Handle<Symbol> symbol = isolate->factory()->NewPrivateOwnSymbol();
510 if (
name->IsString()) symbol->set_name(*
name);
517 DCHECK(args.length() == 1);
520 Handle<String> part = isolate->factory()->private_intern_string();
527 if (!symbol->IsSymbol()) {
528 DCHECK(symbol->IsUndefined());
529 symbol = isolate->factory()->NewPrivateSymbol();
541 DCHECK(args.length() == 1);
548 SealHandleScope shs(isolate);
549 DCHECK(args.length() == 1);
551 return symbol->name();
557 DCHECK(args.length() == 0);
558 return *isolate->GetSymbolRegistry();
563 SealHandleScope shs(isolate);
564 DCHECK(args.length() == 1);
566 return isolate->heap()->ToBoolean(symbol->is_private());
572 DCHECK(args.length() == 2);
575 if (!prototype->IsJSReceiver()) prototype = isolate->factory()->null_value();
576 return *isolate->factory()->NewJSProxy(handler, prototype);
582 DCHECK(args.length() == 4);
585 RUNTIME_ASSERT(call_trap->IsJSFunction() || call_trap->IsJSFunctionProxy());
588 if (!prototype->IsJSReceiver()) prototype = isolate->factory()->null_value();
589 return *isolate->factory()->NewJSFunctionProxy(handler, call_trap,
590 construct_trap, prototype);
595 SealHandleScope shs(isolate);
596 DCHECK(args.length() == 1);
598 return isolate->heap()->ToBoolean(obj->IsJSProxy());
603 SealHandleScope shs(isolate);
604 DCHECK(args.length() == 1);
606 return isolate->heap()->ToBoolean(obj->IsJSFunctionProxy());
611 SealHandleScope shs(isolate);
612 DCHECK(args.length() == 1);
614 return proxy->handler();
619 SealHandleScope shs(isolate);
620 DCHECK(args.length() == 1);
622 return proxy->call_trap();
627 SealHandleScope shs(isolate);
628 DCHECK(args.length() == 1);
630 return proxy->construct_trap();
636 DCHECK(args.length() == 1);
639 return isolate->heap()->undefined_value();
645 DCHECK(args.length() == 1);
648 DCHECK(!obj->IsAccessCheckNeeded() || obj->IsJSObject());
652 !isolate->MayNamedAccess(
655 isolate->ReportFailedAccessCheck(
659 return isolate->heap()->undefined_value();
685 DCHECK(args.length() == 2);
688 DCHECK(!obj->IsAccessCheckNeeded());
689 DCHECK(!obj->map()->is_observed());
699 DCHECK(args.length() == 2);
702 if (obj->IsAccessCheckNeeded() &&
703 !isolate->MayNamedAccess(obj, isolate->factory()->proto_string(),
707 return isolate->heap()->undefined_value();
709 if (obj->map()->is_observed()) {
716 if (!new_value->SameValue(*old_value)) {
718 obj,
"setPrototype", isolate->factory()->proto_string(), old_value);
731 DCHECK(args.length() == 2);
738 if (iter.
IsAtEnd())
return isolate->heap()->false_value();
739 if (iter.
IsAtEnd(O))
return isolate->heap()->true_value();
761 Factory* factory = isolate->
factory();
769 if (
name->AsArrayIndex(&index)) {
775 if (attrs ==
ABSENT)
return factory->undefined_value();
781 if (maybe_accessors.
is_null()) {
788 LookupIterator it(obj,
name, LookupIterator::HIDDEN);
792 if (attrs ==
ABSENT)
return factory->undefined_value();
796 it.GetAccessors()->IsAccessorPair()) {
801 if (maybe_accessors.
is_null()) {
813 if (maybe_accessors.ToHandle(&accessors)) {
823 return factory->NewJSArrayWithElements(elms);
836 DCHECK(args.length() == 2);
848 DCHECK(args.length() == 1);
859 DCHECK(args.length() == 2);
863 Handle<Symbol> home_object_symbol(isolate->heap()->home_object_symbol());
871 DCHECK(args.length() == 0);
872 return isolate->heap()->home_object_symbol();
878 DCHECK(args.length() == 3);
883 if (home_object->IsAccessCheckNeeded() &&
891 if (!proto->IsJSReceiver())
return isolate->heap()->undefined_value();
903 if (home_object->IsAccessCheckNeeded() &&
911 if (!proto->IsJSReceiver())
return isolate->
heap()->undefined_value();
926 DCHECK(args.length() == 4);
938 DCHECK(args.length() == 4);
949 SealHandleScope shs(isolate);
950 DCHECK(args.length() == 1);
952 if (obj->IsJSGlobalProxy()) {
954 if (iter.
IsAtEnd())
return isolate->heap()->false_value();
958 return isolate->heap()->ToBoolean(obj->map()->is_extensible());
964 DCHECK(args.length() == 2);
967 return *isolate->factory()->CreateApiFunction(data, prototype);
972 SealHandleScope shs(isolate);
973 DCHECK(args.length() == 1);
975 bool result = arg->IsObjectTemplateInfo() || arg->IsFunctionTemplateInfo();
976 return isolate->heap()->ToBoolean(result);
981 SealHandleScope shs(isolate);
982 DCHECK(args.length() == 2);
1001 DCHECK(args.length() == 1);
1004 bool needs_access_checks = old_map->is_access_check_needed();
1005 if (needs_access_checks) {
1008 new_map->set_is_access_check_needed(
false);
1011 return isolate->heap()->ToBoolean(needs_access_checks);
1017 DCHECK(args.length() == 1);
1023 new_map->set_is_access_check_needed(
true);
1025 return isolate->heap()->undefined_value();
1033 isolate, NewTypeError(
"var_redeclaration",
HandleVector(args, 1)));
1041 bool is_const,
bool is_function) {
1043 LookupIterator it(global,
name, LookupIterator::HIDDEN_SKIP_INTERCEPTOR);
1045 if (!
maybe.has_value)
return isolate->
heap()->exception();
1053 if (is_var)
return isolate->
heap()->undefined_value();
1063 PropertyDetails old_details = it.property_details();
1066 if (old_details.IsReadOnly() || old_details.IsDontEnum() ||
1071 attr = old_attributes;
1077 global,
name, value, attr));
1079 return isolate->
heap()->undefined_value();
1085 DCHECK(args.length() == 3);
1093 int length =
pairs->length();
1094 for (
int i = 0;
i < length;
i += 2) {
1102 bool is_var = initial_value->IsUndefined();
1103 bool is_const = initial_value->IsTheHole();
1104 bool is_function = initial_value->IsSharedFunctionInfo();
1105 DCHECK(is_var + is_const + is_function == 1);
1113 isolate->factory()->NewFunctionFromSharedFunctionInfo(shared, context,
1117 value = isolate->factory()->undefined_value();
1126 if (is_function && is_native) attr |=
READ_ONLY;
1131 is_var, is_const, is_function);
1132 if (isolate->has_pending_exception())
return result;
1135 return isolate->heap()->undefined_value();
1173 LookupIterator it(global,
name, LookupIterator::HIDDEN_SKIP_INTERCEPTOR);
1185 if ((old_attributes &
READ_ONLY) != 0 ||
1194 global,
name, value, attr));
1202 DCHECK(args.length() == 4);
1216 bool is_var = *initial_value ==
NULL;
1217 bool is_const = initial_value->IsTheHole();
1218 bool is_function = initial_value->IsJSFunction();
1219 DCHECK(is_var + is_const + is_function == 1);
1226 context->Lookup(
name,
flags, &index, &attributes, &binding_flags);
1230 is_function ? initial_value
1235 if ((attributes !=
ABSENT && holder->IsJSGlobalObject()) ||
1236 (context_arg->has_extension() &&
1237 context_arg->extension()->IsJSGlobalObject())) {
1239 value, attr, is_var, is_const, is_function);
1242 if (attributes !=
ABSENT) {
1244 if (is_const || (attributes &
READ_ONLY) != 0) {
1249 if (is_var)
return isolate->heap()->undefined_value();
1253 DCHECK(holder.is_identical_to(context));
1254 context->set(index, *initial_value);
1255 return isolate->heap()->undefined_value();
1260 }
else if (context->has_extension()) {
1261 object =
handle(JSObject::cast(context->extension()));
1262 DCHECK(object->IsJSContextExtensionObject() || object->IsJSGlobalObject());
1264 DCHECK(context->IsFunctionContext());
1266 isolate->factory()->NewJSObject(isolate->context_extension_function());
1267 context->set_extension(*
object);
1271 object,
name, value, attr));
1273 return isolate->heap()->undefined_value();
1279 DCHECK(args.length() == 3);
1282 DCHECK(!value->IsTheHole());
1293 context->Lookup(
name,
flags, &index, &attributes, &binding_flags);
1296 DCHECK(holder->IsContext());
1301 if (context->get(index)->IsTheHole()) context->set(index, *value);
1313 DCHECK(context_arg->has_extension());
1314 if (attributes ==
ABSENT) {
1315 holder =
handle(context_arg->extension(), isolate);
1321 DCHECK(holder->IsJSGlobalObject() || holder->IsJSContextExtensionObject());
1323 LookupIterator it(holder,
name, LookupIterator::HIDDEN_SKIP_INTERCEPTOR);
1325 if (!
maybe.has_value)
return isolate->heap()->exception();
1330 if ((old_attributes &
READ_ONLY) != 0 ||
1348 DCHECK(args.length() == 2);
1353 if (object->HasFastProperties() && !object->IsJSGlobalProxy()) {
1362 DCHECK(args.length() == 1);
1364 Object* length = prototype->length();
1365 RUNTIME_ASSERT(length->IsSmi() && Smi::cast(length)->value() == 0);
1369 prototype->set_elements(isolate->heap()->empty_fixed_array());
1379 isolate->
factory()->NewFunctionWithoutPrototype(key, code);
1380 optimized->shared()->DontAdaptArguments();
1387 DCHECK(args.length() == 0);
1389 isolate->factory()->NewJSObject(isolate->object_function());
1394 InstallBuiltin(isolate, holder,
"unshift", Builtins::kArrayUnshift);
1396 InstallBuiltin(isolate, holder,
"splice", Builtins::kArraySplice);
1397 InstallBuiltin(isolate, holder,
"concat", Builtins::kArrayConcat);
1404 SealHandleScope shs(isolate);
1405 DCHECK(args.length() == 1);
1407 if (!callable->IsJSFunction()) {
1411 isolate, delegate, Execution::TryGetFunctionDelegate(
1413 callable = JSFunction::cast(*delegate);
1415 JSFunction*
function = JSFunction::cast(callable);
1422 SealHandleScope shs(isolate);
1423 DCHECK(args.length() == 1);
1426 if (!callable->IsJSFunction()) {
1430 isolate, delegate, Execution::TryGetFunctionDelegate(
1432 callable = JSFunction::cast(*delegate);
1434 JSFunction*
function = JSFunction::cast(callable);
1438 return isolate->heap()->undefined_value();
1443 return function->global_proxy();
1448 SealHandleScope shs(isolate);
1449 DCHECK(args.length() == 1);
1452 return f->shared()->name();
1457 SealHandleScope shs(isolate);
1458 DCHECK(args.length() == 2);
1462 f->shared()->set_name(
name);
1463 return isolate->heap()->undefined_value();
1468 SealHandleScope shs(isolate);
1469 DCHECK(args.length() == 1);
1471 return isolate->heap()->ToBoolean(
1472 f->shared()->name_should_print_as_anonymous());
1477 SealHandleScope shs(isolate);
1478 DCHECK(args.length() == 1);
1480 f->shared()->set_name_should_print_as_anonymous(
true);
1481 return isolate->heap()->undefined_value();
1486 SealHandleScope shs(isolate);
1487 DCHECK(args.length() == 1);
1489 return isolate->heap()->ToBoolean(f->shared()->is_generator());
1494 SealHandleScope shs(isolate);
1495 DCHECK(args.length() == 1);
1497 return isolate->heap()->ToBoolean(f->shared()->is_arrow());
1502 SealHandleScope shs(isolate);
1503 DCHECK(args.length() == 1);
1505 return isolate->heap()->ToBoolean(f->shared()->is_concise_method());
1510 SealHandleScope shs(isolate);
1511 DCHECK(args.length() == 1);
1516 return isolate->heap()->undefined_value();
1522 DCHECK(args.length() == 1);
1526 if (!script->IsScript())
return isolate->heap()->undefined_value();
1534 DCHECK(args.length() == 1);
1538 return *shared->GetSourceCode();
1543 SealHandleScope shs(isolate);
1544 DCHECK(args.length() == 1);
1547 int pos = fun->shared()->start_position();
1553 SealHandleScope shs(isolate);
1554 DCHECK(args.length() == 2);
1567 SealHandleScope shs(isolate);
1568 DCHECK(args.length() == 2);
1572 fun->SetInstanceClassName(
name);
1573 return isolate->heap()->undefined_value();
1578 SealHandleScope shs(isolate);
1579 DCHECK(args.length() == 2);
1584 (length & 0xC0000000) == 0x0);
1585 fun->shared()->set_length(length);
1586 return isolate->heap()->undefined_value();
1592 DCHECK(args.length() == 2);
1603 SealHandleScope shs(isolate);
1604 DCHECK(args.length() == 1);
1607 return isolate->heap()->ToBoolean(f->shared()->IsApiFunction());
1612 SealHandleScope shs(isolate);
1613 DCHECK(args.length() == 1);
1616 return isolate->heap()->ToBoolean(f->IsBuiltin());
1622 DCHECK(args.length() == 2);
1632 return isolate->heap()->exception();
1637 DCHECK(target_shared->code()->gc_metadata() ==
NULL);
1638 DCHECK(source_shared->code()->gc_metadata() ==
NULL);
1639 target_shared->set_dont_flush(
true);
1640 source_shared->set_dont_flush(
true);
1644 target_shared->ReplaceCode(source_shared->code());
1645 target_shared->set_scope_info(source_shared->scope_info());
1646 target_shared->set_length(source_shared->length());
1647 target_shared->set_feedback_vector(source_shared->feedback_vector());
1648 target_shared->set_formal_parameter_count(
1649 source_shared->formal_parameter_count());
1650 target_shared->set_script(source_shared->script());
1651 target_shared->set_start_position_and_type(
1652 source_shared->start_position_and_type());
1653 target_shared->set_end_position(source_shared->end_position());
1654 bool was_native = target_shared->native();
1655 target_shared->set_compiler_hints(source_shared->compiler_hints());
1656 target_shared->set_native(was_native);
1657 target_shared->set_profiler_ticks(source_shared->profiler_ticks());
1660 target->ReplaceCode(source_shared->code());
1661 DCHECK(target->next_function_link()->IsUndefined());
1666 int number_of_literals = source->NumberOfLiterals();
1668 isolate->factory()->NewFixedArray(number_of_literals,
TENURED);
1669 if (number_of_literals > 0) {
1671 context->native_context());
1673 target->set_context(*context);
1676 if (isolate->logger()->is_logging_code_events() ||
1677 isolate->cpu_profiler()->is_profiling()) {
1678 isolate->logger()->LogExistingFunction(source_shared,
1688 DCHECK(args.length() == 0);
1690 JavaScriptFrameIterator it(isolate);
1699 generator = isolate->factory()->NewJSGeneratorObject(
function);
1701 generator->set_function(*
function);
1703 generator->set_receiver(frame->
receiver());
1704 generator->set_continuation(0);
1705 generator->set_operand_stack(isolate->heap()->empty_fixed_array());
1706 generator->set_stack_handler_index(-1);
1714 DCHECK(args.length() == 1);
1717 JavaScriptFrameIterator stack_iterator(isolate);
1724 DCHECK_LT(0, generator_object->continuation());
1731 operands_count -= 2;
1733 if (operands_count == 0) {
1736 DCHECK_EQ(generator_object->operand_stack(),
1737 isolate->heap()->empty_fixed_array());
1738 DCHECK_EQ(generator_object->stack_handler_index(), -1);
1741 DCHECK(!frame->HasHandler());
1743 int stack_handler_index = -1;
1745 isolate->factory()->NewFixedArray(operands_count);
1747 generator_object->set_operand_stack(*operand_stack);
1748 generator_object->set_stack_handler_index(stack_handler_index);
1751 return isolate->heap()->undefined_value();
1763 SealHandleScope shs(isolate);
1764 DCHECK(args.length() == 3);
1768 JavaScriptFrameIterator stack_iterator(isolate);
1777 Address pc = generator_object->function()->
code()->instruction_start();
1778 int offset = generator_object->continuation();
1780 frame->set_pc(
pc + offset);
1781 if (FLAG_enable_ool_constant_pool) {
1782 frame->set_constant_pool(
1783 generator_object->function()->code()->constant_pool());
1787 FixedArray* operand_stack = generator_object->operand_stack();
1788 int operands_count = operand_stack->
length();
1789 if (operands_count != 0) {
1791 generator_object->stack_handler_index());
1792 generator_object->set_operand_stack(isolate->heap()->empty_fixed_array());
1793 generator_object->set_stack_handler_index(-1);
1798 switch (resume_mode) {
1802 return isolate->Throw(value);
1806 return isolate->ThrowIllegalOperation();
1812 DCHECK(args.length() == 1);
1814 int continuation = generator->continuation();
1816 ?
"generator_finished"
1817 :
"generator_running";
1825 DCHECK(args.length() == 1);
1830 !object->map()->is_observed() && !object->IsJSProxy());
1841 if (index <
static_cast<uint32_t>(string->length())) {
1842 Factory* factory =
string->GetIsolate()->factory();
1843 return factory->LookupSingleCharacterStringFromCode(
1846 return Execution::CharAt(
string, index);
1854 if (object->IsString()) {
1856 if (!result->IsUndefined())
return result;
1860 if (object->IsStringObjectWithCharacterAt(index)) {
1864 if (!result->IsUndefined())
return result;
1868 if (object->IsString() || object->IsNumber() || object->IsBoolean()) {
1880 if (key->IsName()) {
1885 Execution::ToString(isolate, key),
Name);
1897 if (key->ToArrayIndex(&index)) {
1915 if (object->IsUndefined() || object->IsNull()) {
1924 if (key->ToArrayIndex(&index)) {
1934 if (
name->AsArrayIndex(&index)) {
1944 DCHECK(args.length() == 2);
1958 DCHECK(args.length() == 2);
1974 if (receiver_obj->IsJSObject()) {
1975 if (!receiver_obj->IsJSGlobalProxy() &&
1976 !receiver_obj->IsAccessCheckNeeded() && key_obj->IsName()) {
1980 if (receiver->HasFastProperties()) {
1982 Handle<Map> receiver_map(receiver->map(), isolate);
1984 int index = keyed_lookup_cache->
Lookup(receiver_map, key);
1987 return receiver->RawFastPropertyAt(
1988 FieldIndex::ForKeyedLookupCacheIndex(*receiver_map, index));
1992 LookupIterator it(receiver, key, LookupIterator::OWN);
1993 if (it.state() == LookupIterator::DATA &&
1994 it.property_details().type() ==
FIELD) {
1995 FieldIndex field_index = it.GetFieldIndex();
1998 if (!it.representation().IsDouble()) {
1999 keyed_lookup_cache->
Update(receiver_map, key,
2000 field_index.GetKeyedLookupCacheIndex());
2013 if (!receiver->IsGlobalObject())
return value;
2014 value = PropertyCell::cast(value)->value();
2015 if (!value->IsTheHole())
return value;
2019 }
else if (key_obj->IsSmi()) {
2027 ElementsKind elements_kind = js_object->GetElementsKind();
2030 if (key->value() >= js_object->elements()->length()) {
2044 }
else if (receiver_obj->IsString() && key_obj->IsSmi()) {
2047 int index = args.smi_at(1);
2048 if (index >= 0 && index < str->length()) {
2063 return obj->IsUndefined() || obj->IsSpecFunction() || obj->IsNull();
2070 if (component->IsUndefined())
return isolate->
factory()->undefined_value();
2079 DCHECK(args.length() == 5);
2085 RUNTIME_ASSERT(getter->IsUndefined() || getter->IsFunctionTemplateInfo());
2086 RUNTIME_ASSERT(setter->IsUndefined() || setter->IsFunctionTemplateInfo());
2094 return isolate->heap()->undefined_value();
2106 DCHECK(args.length() == 5);
2118 bool fast = obj->HasFastProperties();
2122 return isolate->heap()->undefined_value();
2134 DCHECK(args.length() == 4);
2142 LookupIterator it(js_object,
name, LookupIterator::OWN_SKIP_INTERCEPTOR);
2143 if (it.IsFound() && it.state() == LookupIterator::ACCESS_CHECK) {
2145 return isolate->heap()->undefined_value();
2174 DCHECK(args.length() == 2);
2186 if (object->IsUndefined() || object->IsNull()) {
2193 if (object->IsJSProxy()) {
2195 if (key->IsSymbol()) {
2199 Execution::ToString(isolate, key),
Object);
2208 if (key->ToArrayIndex(&index)) {
2210 if (!object->IsJSObject())
return value;
2220 if (js_object->IsStringObjectWithCharacterAt(index)) {
2225 if (js_object->HasExternalArrayElements() ||
2226 js_object->HasFixedTypedArrayElements()) {
2227 if (!value->IsNumber() && !value->IsUndefined()) {
2237 return result.
is_null() ? result : value;
2240 if (key->IsName()) {
2242 if (
name->AsArrayIndex(&index)) {
2244 if (!object->IsJSObject())
return value;
2246 if (js_object->HasExternalArrayElements()) {
2247 if (!value->IsNumber() && !value->IsUndefined()) {
2263 Execution::ToString(isolate, key),
Object);
2266 if (
name->AsArrayIndex(&index)) {
2268 if (!object->IsJSObject())
return value;
2281 Isolate* isolate = js_object->GetIsolate();
2284 if (key->ToArrayIndex(&index)) {
2292 if (js_object->IsStringObjectWithCharacterAt(index)) {
2300 if (key->IsName()) {
2302 if (
name->AsArrayIndex(&index)) {
2315 Execution::ToString(isolate, key),
Object);
2318 if (
name->AsArrayIndex(&index)) {
2334 if (key->ToArrayIndex(&index)) {
2341 if (receiver->IsStringObjectWithCharacterAt(index)) {
2342 return isolate->
factory()->true_value();
2349 if (key->IsName()) {
2355 Execution::ToString(isolate, key),
Object);
2392 DCHECK(!key->ToArrayIndex(&index));
2393 LookupIterator it(
object, key, LookupIterator::OWN_SKIP_INTERCEPTOR);
2395 if (!
maybe.has_value)
return isolate->heap()->exception();
2423 if (key->IsName()) {
2425 LookupIterator::OWN_SKIP_INTERCEPTOR);
2428 duplicate = it.IsFound();
2433 if (!
maybe.has_value)
return isolate->heap()->exception();
2434 duplicate =
maybe.value;
2440 NewTypeError(
"duplicate_template_property",
HandleVector(args, 1)));
2487 key->ToArrayIndex(&index);
2511 SealHandleScope shs(isolate);
2516 if (object->IsJSFunction()) {
2518 func->shared()->set_native(
true);
2520 return isolate->heap()->undefined_value();
2525 SealHandleScope shs(isolate);
2529 if (object->IsJSFunction()) {
2530 JSFunction* func = JSFunction::cast(*
object);
2531 func->shared()->set_inline_builtin(
true);
2533 return isolate->heap()->undefined_value();
2548 if (raw_literal_cell->IsAllocationSite()) {
2550 boilerplate = JSArray::cast(site->transition_info());
2552 boilerplate = JSArray::cast(raw_literal_cell);
2555 ElementsKind elements_kind =
object->GetElementsKind();
2560 if (value->IsNumber()) {
2566 boilerplate_object->GetElementsKind(), transitioned_kind)) {
2571 FixedDoubleArray* double_array = FixedDoubleArray::cast(object->elements());
2572 HeapNumber* number = HeapNumber::cast(*value);
2573 double_array->
set(store_index, number->
Number());
2581 boilerplate_object->GetElementsKind();
2583 transitioned_kind)) {
2587 FixedArray* object_array = FixedArray::cast(object->elements());
2588 object_array->
set(store_index, *value);
2597 DCHECK(args.length() == 1);
2598 if (!isolate->debug()->is_active() || !isolate->debug()->StepInActive()) {
2599 return isolate->heap()->false_value();
2603 return isolate->heap()->ToBoolean(callback->IsJSFunction() &&
2604 !JSFunction::cast(callback)->IsBuiltin());
2611 DCHECK(args.length() == 1);
2612 Debug* debug = isolate->debug();
2613 if (!debug->
IsStepping())
return isolate->heap()->undefined_value();
2617 RUNTIME_ASSERT(object->IsJSFunction() || object->IsJSGeneratorObject());
2619 if (object->IsJSFunction()) {
2630 return isolate->heap()->undefined_value();
2635 DCHECK(args.length() == 1);
2638 isolate->PushPromise(promise);
2639 return isolate->heap()->undefined_value();
2644 DCHECK(args.length() == 0);
2645 SealHandleScope shs(isolate);
2646 isolate->PopPromise();
2647 return isolate->heap()->undefined_value();
2652 DCHECK(args.length() == 1);
2655 isolate->debug()->OnPromiseEvent(data);
2656 return isolate->heap()->undefined_value();
2661 DCHECK(args.length() == 2);
2665 isolate->debug()->OnPromiseReject(promise, value);
2666 return isolate->heap()->undefined_value();
2671 DCHECK(args.length() == 1);
2674 isolate->debug()->OnAsyncTaskEvent(data);
2675 return isolate->heap()->undefined_value();
2681 DCHECK(args.length() == 3);
2699 if (!
maybe.has_value)
return isolate->
heap()->exception();
2700 if (
maybe.value)
return isolate->
heap()->true_value();
2708 ->is_hidden_prototype()) {
2716 return isolate->
heap()->false_value();
2722 DCHECK(args.length() == 2);
2727 const bool key_is_array_index = key->AsArrayIndex(&index);
2730 if (object->IsJSObject()) {
2736 if (!
maybe.has_value)
return isolate->heap()->exception();
2737 DCHECK(!isolate->has_pending_exception());
2739 return isolate->heap()->true_value();
2741 Map*
map = js_obj->map();
2742 if (!key_is_array_index && !
map->has_named_interceptor() &&
2743 !HeapObject::cast(
map->prototype())->map()->is_hidden_prototype()) {
2744 return isolate->heap()->false_value();
2749 }
else if (object->IsString() && key_is_array_index) {
2752 if (index <
static_cast<uint32_t>(string->length())) {
2753 return isolate->heap()->true_value();
2756 return isolate->heap()->false_value();
2762 DCHECK(args.length() == 2);
2767 if (!
maybe.has_value)
return isolate->heap()->exception();
2768 return isolate->heap()->ToBoolean(
maybe.value);
2774 DCHECK(args.length() == 2);
2779 if (!
maybe.has_value)
return isolate->heap()->exception();
2780 return isolate->heap()->ToBoolean(
maybe.value);
2786 DCHECK(args.length() == 2);
2793 if (!
maybe.has_value)
return isolate->heap()->exception();
2795 return isolate->heap()->ToBoolean((
maybe.value &
DONT_ENUM) == 0);
2801 DCHECK(args.length() == 1);
2805 isolate->counters()->for_in()->Increment();
2810 return *isolate->factory()->NewJSArrayWithElements(elements);
2820 SealHandleScope shs(isolate);
2821 DCHECK(args.length() == 1);
2825 if (raw_object->IsSimpleEnum())
return raw_object->map();
2835 if (object->IsSimpleEnum())
return object->map();
2859 DCHECK(args.length() == 2);
2860 if (!args[0]->IsJSObject()) {
2861 return isolate->heap()->undefined_value();
2869 if (obj->IsJSGlobalProxy()) {
2871 if (obj->IsAccessCheckNeeded() &&
2872 !isolate->MayNamedAccess(obj, isolate->factory()->undefined_value(),
2876 return *isolate->factory()->NewJSArray(0);
2887 int total_property_count = 0;
2890 for (
int i = 0;
i < length;
i++) {
2895 if (jsproto->IsAccessCheckNeeded() &&
2896 !isolate->MayNamedAccess(jsproto,
2897 isolate->factory()->undefined_value(),
2901 return *isolate->factory()->NewJSArray(0);
2904 n = jsproto->NumberOfOwnProperties(filter);
2905 own_property_count[
i] = n;
2906 total_property_count += n;
2913 isolate->factory()->NewFixedArray(total_property_count);
2916 int next_copy_index = 0;
2917 int hidden_strings = 0;
2920 for (
int i = 0;
i < length;
i++) {
2924 jsproto->GetOwnPropertyNames(*names, next_copy_index, filter);
2929 for (
int j = next_copy_index;
2930 j < next_copy_index + own_property_count[
i]; j++) {
2931 Object* name_from_hidden_proto = names->get(j);
2932 for (
int k = 0; k < next_copy_index; k++) {
2933 if (names->get(k) != isolate->heap()->hidden_string()) {
2935 if (name_from_hidden_proto ==
name) {
2936 names->set(j, isolate->heap()->hidden_string());
2944 next_copy_index += own_property_count[
i];
2956 if (hidden_strings > 0) {
2958 names = isolate->factory()->NewFixedArray(names->length() - hidden_strings);
2960 for (
int i = 0;
i < total_property_count;
i++) {
2962 if (
name == isolate->heap()->hidden_string()) {
2966 names->set(dest_pos++,
name);
2971 return *isolate->factory()->NewJSArrayWithElements(names);
2979 DCHECK(args.length() == 1);
2980 if (!args[0]->IsJSObject()) {
2981 return isolate->heap()->undefined_value();
2988 return *isolate->factory()->NewJSArrayWithElements(names);
2996 DCHECK(args.length() == 1);
2997 if (!args[0]->IsJSObject()) {
3003 if (obj->HasNamedInterceptor()) result |= 2;
3004 if (obj->HasIndexedInterceptor()) result |= 1;
3014 DCHECK(args.length() == 1);
3017 if (obj->HasNamedInterceptor()) {
3023 return isolate->heap()->undefined_value();
3031 DCHECK(args.length() == 1);
3034 if (obj->HasIndexedInterceptor()) {
3040 return isolate->heap()->undefined_value();
3046 DCHECK(args.length() == 1);
3050 if (object->IsJSGlobalProxy()) {
3052 if (object->IsAccessCheckNeeded() &&
3053 !isolate->MayNamedAccess(
object, isolate->factory()->undefined_value(),
3057 return *isolate->factory()->NewJSArray(0);
3062 if (iter.
IsAtEnd())
return *isolate->factory()->NewJSArray(0);
3073 int length = contents->length();
3075 for (
int i = 0;
i < length;
i++) {
3076 Object* entry = contents->get(
i);
3077 if (entry->IsString()) {
3078 copy->set(
i, entry);
3080 DCHECK(entry->IsNumber());
3084 isolate->factory()->NumberToString(entry_handle);
3085 copy->set(
i, *entry_str);
3088 return *isolate->factory()->NewJSArrayWithElements(copy);
3093 SealHandleScope shs(isolate);
3094 DCHECK(args.length() == 1);
3098 JavaScriptFrameIterator it(isolate);
3099 it.AdvanceToArgumentsFrame();
3108 if (raw_key->ToArrayIndex(&index) && index < n) {
3113 if (raw_key->IsSymbol()) {
3115 if (symbol->Equals(isolate->native_context()->iterator_symbol())) {
3116 return isolate->native_context()->array_values_iterator();
3130 Execution::ToString(isolate, raw_key));
3134 if (key->AsArrayIndex(&index)) {
3138 Handle<Object> initial_prototype(isolate->initial_object_prototype());
3153 if (function->shared()->strict_mode() ==
STRICT) {
3155 isolate, NewTypeError(
"strict_arguments_callee",
3156 HandleVector<Object>(
NULL, 0)));
3172 DCHECK(args.length() == 1);
3174 if (object->IsJSObject() && !object->IsGlobalObject()) {
3182 SealHandleScope shs(isolate);
3183 DCHECK(args.length() == 1);
3186 return isolate->heap()->ToBoolean(object->BooleanValue());
3193 SealHandleScope shs(isolate);
3194 DCHECK(args.length() == 1);
3196 if (obj->IsNumber())
return isolate->heap()->number_string();
3197 HeapObject* heap_obj = HeapObject::cast(obj);
3201 return isolate->heap()->undefined_string();
3206 return isolate->heap()->string_string();
3209 switch (instance_type) {
3211 if (heap_obj->IsTrue() || heap_obj->IsFalse()) {
3212 return isolate->heap()->boolean_string();
3214 if (heap_obj->IsNull()) {
3215 return isolate->heap()->object_string();
3217 DCHECK(heap_obj->IsUndefined());
3218 return isolate->heap()->undefined_string();
3220 return isolate->heap()->symbol_string();
3223 return isolate->heap()->function_string();
3227 return isolate->heap()->object_string();
3233 SealHandleScope shs(isolate);
3234 DCHECK(args.length() == 2);
3237 intptr_t value =
reinterpret_cast<intptr_t
>(value_raw);
3241 case Token::EQ_STRICT:
3242 return isolate->heap()->ToBoolean(value == 0);
3244 case Token::NE_STRICT:
3245 return isolate->heap()->ToBoolean(value != 0);
3247 return isolate->heap()->ToBoolean(value < 0);
3249 return isolate->heap()->ToBoolean(value > 0);
3251 return isolate->heap()->ToBoolean(value <= 0);
3253 return isolate->heap()->ToBoolean(value >= 0);
3256 return isolate->heap()->undefined_value();
3263 DCHECK(args.length() == 1);
3271 DCHECK(args.length() == 0);
3272 return *isolate->factory()->NewHeapNumber(0);
3280 SealHandleScope shs(isolate);
3281 DCHECK(args.length() == 2);
3286 int days = isolate->date_cache()->DaysFromYearMonth(year, month);
3294 DCHECK(args.length() == 3);
3300 DateCache* date_cache = isolate->date_cache();
3304 bool is_value_nan =
false;
3305 if (std::isnan(time)) {
3306 value = isolate->factory()->nan_value();
3307 is_value_nan =
true;
3310 value = isolate->factory()->nan_value();
3311 is_value_nan =
true;
3313 time = is_utc ? time : date_cache->
ToUTC(
static_cast<int64_t
>(time));
3315 value = isolate->factory()->nan_value();
3316 is_value_nan =
true;
3321 date->SetValue(*value, is_value_nan);
3329 int argument_count) {
3331 isolate->
factory()->NewArgumentsObject(callee, argument_count);
3334 int parameter_count = callee->shared()->formal_parameter_count();
3335 if (argument_count > 0) {
3336 if (parameter_count > 0) {
3337 int mapped_count =
Min(argument_count, parameter_count);
3340 parameter_map->set_map(isolate->
heap()->sloppy_arguments_elements_map());
3345 result->set_map(*
map);
3346 result->set_elements(*parameter_map);
3353 parameter_map->set(0, *context);
3354 parameter_map->set(1, *arguments);
3357 int index = argument_count - 1;
3358 while (index >= mapped_count) {
3361 arguments->set(index, *(parameters - index - 1));
3366 while (index >= 0) {
3369 int context_local_count = scope_info->ContextLocalCount();
3370 bool duplicate =
false;
3371 for (
int j = index + 1; j < parameter_count; ++j) {
3372 if (scope_info->ParameterName(j) == *
name) {
3381 arguments->set(index, *(parameters - index - 1));
3382 parameter_map->set_the_hole(index + 2);
3386 int context_index = -1;
3387 for (
int j = 0; j < context_local_count; ++j) {
3388 if (scope_info->ContextLocalName(j) == *
name) {
3393 DCHECK(context_index >= 0);
3394 arguments->set_the_hole(index);
3407 result->set_elements(*elements);
3408 for (
int i = 0;
i < argument_count; ++
i) {
3409 elements->set(
i, *(parameters -
i - 1));
3420 int argument_count) {
3422 isolate->
factory()->NewArgumentsObject(callee, argument_count);
3424 if (argument_count > 0) {
3426 isolate->
factory()->NewUninitializedFixedArray(argument_count);
3429 for (
int i = 0;
i < argument_count;
i++) {
3430 array->set(
i, *--parameters,
mode);
3432 result->set_elements(*array);
3440 DCHECK(args.length() == 1);
3442 JavaScriptFrameIterator it(isolate);
3445 it.AdvanceToArgumentsFrame();
3451 return callee->shared()->strict_mode() ==
STRICT
3459 DCHECK(args.length() == 3);
3461 Object** parameters =
reinterpret_cast<Object**
>(args[1]);
3469 DCHECK(args.length() == 3);
3471 Object** parameters =
reinterpret_cast<Object**
>(args[1]);
3479 DCHECK(args.length() == 1);
3483 return *isolate->factory()->NewFunctionFromSharedFunctionInfo(shared, context,
3490 DCHECK(args.length() == 3);
3498 return *isolate->factory()->NewFunctionFromSharedFunctionInfo(shared, context,
3510 JavaScriptFrameIterator it(isolate);
3514 if (functions.length() > 1) {
3515 int inlined_jsframe_index = functions.length() - 1;
3516 JSFunction* inlined_function = functions[inlined_jsframe_index];
3517 SlotRefValueBuilder slot_refs(
3518 frame, inlined_jsframe_index,
3519 inlined_function->shared()->formal_parameter_count());
3521 int args_count = slot_refs.args_length();
3523 *total_argc = prefix_argc + args_count;
3526 slot_refs.Prepare(isolate);
3527 for (
int i = 0;
i < args_count;
i++) {
3529 param_data[prefix_argc +
i] = val;
3531 slot_refs.Finish(isolate);
3535 it.AdvanceToArgumentsFrame();
3539 *total_argc = prefix_argc + args_count;
3542 for (
int i = 0;
i < args_count;
i++) {
3544 param_data[prefix_argc +
i] = val;
3553 DCHECK(args.length() == 4);
3560 bound_function->shared()->set_bound(
true);
3576 if (bindee->IsJSFunction() && JSFunction::cast(*bindee)->shared()->bound()) {
3578 JSFunction::cast(*bindee)->function_bindings());
3581 isolate->factory()->NewFixedArray(old_bindings->length() + argc);
3585 for (
int n = old_bindings->length();
i < n;
i++) {
3586 new_bindings->set(
i, old_bindings->get(
i));
3590 new_bindings = isolate->factory()->NewFixedArray(array_size);
3596 for (
int j = 0; j < argc; j++,
i++) {
3597 new_bindings->set(
i, *arguments[j + 1]);
3599 new_bindings->set_map_no_write_barrier(
3600 isolate->heap()->fixed_cow_array_map());
3601 bound_function->set_function_bindings(*new_bindings);
3607 isolate->native_context()->bound_function_map());
3609 Handle<String> length_string = isolate->factory()->length_string();
3614 bound_function, length_string, new_length, attr));
3615 return *bound_function;
3621 DCHECK(args.length() == 1);
3623 if (callable->IsJSFunction()) {
3625 if (function->shared()->bound()) {
3627 RUNTIME_ASSERT(bindings->map() == isolate->heap()->fixed_cow_array_map());
3628 return *isolate->factory()->NewJSArrayWithElements(bindings);
3631 return isolate->heap()->undefined_value();
3637 DCHECK(args.length() == 1);
3650 DCHECK(!bound_function->IsJSFunction() ||
3656 for (
int i = 0;
i < bound_argc;
i++) {
3661 if (!bound_function->IsJSFunction()) {
3663 isolate, bound_function,
3664 Execution::TryGetConstructorDelegate(isolate, bound_function));
3666 DCHECK(bound_function->IsJSFunction());
3671 total_argc, param_data.
get()));
3680 if (!constructor->IsJSFunction()) {
3683 NewTypeError(
"not_constructor", arguments));
3690 if (!function->should_have_prototype() && !function->shared()->bound()) {
3693 NewTypeError(
"not_constructor", arguments));
3702 if (function->has_initial_map()) {
3725 result = isolate->
factory()->NewJSObject(
function);
3727 result = isolate->
factory()->NewJSObjectWithMemento(
function, site);
3730 isolate->
counters()->constructed_objects()->Increment();
3731 isolate->
counters()->constructed_objects_runtime()->Increment();
3739 DCHECK(args.length() == 1);
3748 DCHECK(args.length() == 2);
3752 if (feedback->IsAllocationSite()) {
3762 DCHECK(args.length() == 1);
3765 function->CompleteInobjectSlackTracking();
3767 return isolate->heap()->undefined_value();
3772 SealHandleScope shs(isolate);
3773 DCHECK(args.length() == 0);
3775 return isolate->heap()->undefined_value();
3780 SealHandleScope shs(isolate);
3781 DCHECK(args.length() == 0);
3783 return isolate->heap()->nan_value();
3789 DCHECK(args.length() >= 2);
3790 int argc = args.length() - 2;
3792 Object* receiver = args[0];
3795 const int argv_small_size = 10;
3799 if (argc > argv_small_size) {
3801 if (argv ==
NULL)
return isolate->StackOverflow();
3805 for (
int i = 0;
i < argc; ++
i) {
3814 Execution::Call(isolate, hfun, hreceiver, argc, argv,
true));
3821 DCHECK(args.length() == 5);
3830 static int kMaxArgc = 1000000;
3834 const int argv_small_size = 10;
3838 if (argc > argv_small_size) {
3840 if (argv ==
NULL)
return isolate->StackOverflow();
3844 for (
int i = 0;
i < argc; ++
i) {
3852 Execution::Call(isolate, fun, receiver, argc, argv,
true));
3859 DCHECK(args.length() == 1);
3862 return *Execution::GetFunctionDelegate(isolate,
object);
3868 DCHECK(args.length() == 1);
3871 return *Execution::GetConstructorDelegate(isolate,
object);
3877 DCHECK(args.length() == 2);
3882 isolate->factory()->NewGlobalContext(
function, scope_info);
3884 DCHECK(function->context() == isolate->context());
3885 DCHECK(function->context()->global_object() == result->global_object());
3886 result->global_object()->set_global_context(*result);
3893 DCHECK(args.length() == 1);
3897 DCHECK(function->context() == isolate->context());
3898 int length =
function->shared()->scope_info()->ContextLength();
3899 return *isolate->factory()->NewFunctionContext(length,
function);
3905 DCHECK(args.length() == 2);
3907 if (args[0]->IsJSReceiver()) {
3913 if (!maybe_object.ToHandle(&extension_object)) {
3921 if (args[1]->IsSmi()) {
3925 function =
handle(isolate->native_context()->closure());
3932 isolate->factory()->NewWithContext(
function, current, extension_object);
3933 isolate->set_context(*context);
3940 DCHECK(args.length() == 3);
3944 if (args[2]->IsSmi()) {
3948 function =
handle(isolate->native_context()->closure());
3954 function, current,
name, thrown_object);
3955 isolate->set_context(*context);
3962 DCHECK(args.length() == 2);
3965 if (args[1]->IsSmi()) {
3969 function =
handle(isolate->native_context()->closure());
3975 isolate->factory()->NewBlockContext(
function, current, scope_info);
3976 isolate->set_context(*context);
3982 SealHandleScope shs(isolate);
3983 DCHECK(args.length() == 1);
3985 return isolate->heap()->ToBoolean(obj->IsJSModule());
3990 SealHandleScope shs(isolate);
3991 DCHECK(args.length() == 2);
3994 if (!args[1]->IsScopeInfo()) {
3999 isolate->set_context(context);
4007 Factory* factory = isolate->factory();
4010 context->set_module(*module);
4011 Context* previous = isolate->context();
4012 context->set_previous(previous);
4013 context->set_closure(previous->
closure());
4015 isolate->set_context(*context);
4026 DCHECK(args.length() == 1);
4028 Context* host_context = isolate->context();
4030 for (
int i = 0;
i < descriptions->length(); ++
i) {
4032 int host_index = description->host_index();
4036 for (
int j = 0; j < description->length(); ++j) {
4039 int index = description->index(j);
4051 DCHECK(!result->IsUndefined());
4074 DCHECK(!isolate->has_pending_exception());
4075 return isolate->heap()->undefined_value();
4081 DCHECK(args.length() == 2);
4091 context->Lookup(
name,
flags, &index, &attributes, &binding_flags);
4095 return isolate->heap()->true_value();
4099 if (holder->IsContext()) {
4100 return isolate->heap()->false_value();
4115 DCHECK(!holder->IsGlobalObject());
4124 Object* constructor = holder->
map()->constructor();
4125 if (constructor != context_extension_function)
return holder;
4129 return isolate->
heap()->undefined_value();
4138 if (!args[0]->IsContext() || !args[1]->IsString()) {
4149 context->Lookup(
name,
flags, &index, &attributes, &binding_flags);
4156 DCHECK(holder->IsContext());
4162 switch (binding_flags) {
4165 if (value->IsTheHole()) {
4168 isolate->
factory()->NewReferenceError(
"not_defined",
4170 if (maybe_error.ToHandle(&error)) isolate->
Throw(*error);
4177 DCHECK(!value->IsTheHole());
4180 if (value->IsTheHole()) {
4182 value = isolate->
heap()->undefined_value();
4197 if (!object->IsJSProxy()) {
4205 object->IsGlobalObject()
4206 ? Object::cast(isolate->
heap()->undefined_value())
4207 : object->IsJSProxy() ?
static_cast<Object*
>(*
object)
4209 isolate, JSObject::cast(*
object)),
4218 return MakePair(*value, *receiver_handle);
4226 if (maybe_error.ToHandle(&error)) isolate->
Throw(*error);
4231 isolate->
heap()->undefined_value());
4248 DCHECK(args.length() == 4);
4260 context->Lookup(
name,
flags, &index, &attributes, &binding_flags);
4262 if (isolate->has_pending_exception())
return isolate->heap()->exception();
4268 }
else if (strict_mode ==
STRICT) {
4281 if (attributes !=
ABSENT) {
4284 }
else if (strict_mode ==
STRICT) {
4302 DCHECK(args.length() == 1);
4304 return isolate->Throw(args[0]);
4310 DCHECK(args.length() == 1);
4312 return isolate->ReThrow(args[0]);
4317 SealHandleScope shs(isolate);
4318 DCHECK(args.length() == 0);
4319 return isolate->PromoteScheduledException();
4325 DCHECK(args.length() == 1);
4334 DCHECK(args.length() == 0);
4336 isolate, NewReferenceError(
"non_method", HandleVector<Object>(
NULL, 0)));
4342 DCHECK(args.length() == 0);
4345 NewReferenceError(
"unsupported_super", HandleVector<Object>(
NULL, 0)));
4351 DCHECK(args.length() == 0);
4353 isolate, NewTypeError(
"not_date_object", HandleVector<Object>(
NULL, 0)));
4358 SealHandleScope shs(isolate);
4359 DCHECK(args.length() == 0);
4362 StackLimitCheck check(isolate);
4363 if (check.JsHasOverflowed()) {
4364 return isolate->StackOverflow();
4367 return isolate->stack_guard()->HandleInterrupts();
4372 SealHandleScope shs(isolate);
4373 DCHECK(args.length() == 0);
4374 return isolate->stack_guard()->HandleInterrupts();
4380 for (JavaScriptFrameIterator it(isolate); !it.done(); it.Advance()) n++;
4388 const int nmax = 80;
4391 PrintF(
"%4d:%*s", n, n,
"");
4393 PrintF(
"%4d:%*s", n, nmax,
"...");
4396 if (result ==
NULL) {
4409 SealHandleScope shs(isolate);
4410 DCHECK(args.length() == 0);
4412 return isolate->heap()->undefined_value();
4417 SealHandleScope shs(isolate);
4418 DCHECK(args.length() == 1);
4427 DCHECK(args.length() == 0);
4428 if (FLAG_log_timer_events)
LOG(isolate, CurrentTimeEvent());
4435 if (FLAG_verify_predictable) {
4436 millis = 1388534400000.0;
4437 millis +=
Floor(isolate->heap()->synthetic_time());
4441 return *isolate->factory()->NewNumber(millis);
4447 DCHECK(args.length() == 2);
4464 isolate->unicode_cache());
4468 isolate->unicode_cache());
4474 return isolate->heap()->null_value();
4481 DCHECK(args.length() == 1);
4487 isolate->date_cache()->LocalTimezone(
static_cast<int64_t
>(x));
4489 isolate->factory()->NewStringFromUtf8(
CStrVector(zone)).ToHandleChecked();
4496 DCHECK(args.length() == 1);
4501 int64_t time = isolate->date_cache()->ToUTC(
static_cast<int64_t
>(x));
4503 return *isolate->factory()->NewNumber(
static_cast<double>(time));
4509 DCHECK(args.length() == 0);
4512 isolate->factory()->NewFixedArray(1,
TENURED);
4514 isolate->eternal_handles()->CreateSingleton(
4522 isolate->factory()->NewJSObject(isolate->array_function());
4529 SealHandleScope shs(isolate);
4530 DCHECK(args.length() == 1);
4532 if (!global->IsJSGlobalObject())
return isolate->heap()->null_value();
4533 return JSGlobalObject::cast(global)->global_proxy();
4538 SealHandleScope shs(isolate);
4539 DCHECK(args.length() == 1);
4541 if (!global->IsJSGlobalObject())
return isolate->heap()->false_value();
4542 return isolate->heap()->ToBoolean(
4543 !JSGlobalObject::cast(global)->IsDetached());
4549 DCHECK(args.length() == 1);
4554 return *isolate->factory()->NewFillerObject(
size,
false,
NEW_SPACE);
4560 DCHECK(args.length() == 2);
4568 return *isolate->factory()->NewFillerObject(
size, double_align,
space);
4577 DCHECK(args.length() == 2);
4581 int length = Smi::cast(array->length())->value();
4582 FixedArray* elements = FixedArray::cast(array->elements());
4583 for (
int i = 0;
i < length;
i++) {
4584 if (elements->
get(
i) == *element)
return isolate->heap()->false_value();
4590 return isolate->heap()->true_value();
4611 isolate->global_handles()->Create(*storage))),
4639 SeededNumberDictionary::cast(*
storage_));
4642 if (!result.is_identical_to(dict)) {
4660 static_cast<uint32_t>(FixedArrayBase::cast(*storage_)->length())) {
4673 array->set_map(*
map);
4674 array->set_length(*length);
4686 uint32_t current_length =
static_cast<uint32_t>(current_storage->length());
4690 if (!element->IsTheHole()) {
4693 if (!new_storage.is_identical_to(slow_storage)) {
4724 int element_count = 0;
4725 switch (array->GetElementsKind()) {
4733 int fast_length =
static_cast<int>(length);
4735 for (
int i = 0;
i < fast_length;
i++) {
4736 if (!elements->get(
i)->IsTheHole()) element_count++;
4745 int fast_length =
static_cast<int>(length);
4746 if (array->elements()->IsFixedArray()) {
4747 DCHECK(FixedArray::cast(array->elements())->length() == 0);
4751 FixedDoubleArray::cast(array->elements()));
4752 for (
int i = 0;
i < fast_length;
i++) {
4753 if (!elements->is_the_hole(
i)) element_count++;
4759 SeededNumberDictionary::cast(array->elements()));
4760 int capacity = dictionary->Capacity();
4761 for (
int i = 0;
i < capacity;
i++) {
4763 if (dictionary->IsKey(*key)) {
4770 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \
4771 case EXTERNAL_##TYPE##_ELEMENTS: \
4772 case TYPE##_ELEMENTS:
4775 #undef TYPED_ARRAY_CASE
4781 return element_count;
4785 template <
class ExternalArrayClass,
class ElementType>
4788 bool elements_are_ints,
4789 bool elements_are_guaranteed_smis,
4792 ExternalArrayClass::cast(receiver->elements()));
4796 if (elements_are_ints) {
4797 if (elements_are_guaranteed_smis) {
4798 for (
uint32_t j = 0; j < len; j++) {
4802 visitor->
visit(j, e);
4805 for (
uint32_t j = 0; j < len; j++) {
4807 int64_t val =
static_cast<int64_t
>(array->get_scalar(j));
4810 visitor->
visit(j, e);
4813 isolate->
factory()->NewNumber(
static_cast<ElementType
>(val));
4814 visitor->
visit(j, e);
4819 for (
uint32_t j = 0; j < len; j++) {
4822 visitor->
visit(j, e);
4832 return (a == b) ? 0 : (a < b) ? -1 : 1;
4838 Isolate* isolate =
object->GetIsolate();
4847 if (range < length) length = range;
4849 if (!elements->get(
i)->IsTheHole()) {
4857 if (object->elements()->IsFixedArray()) {
4858 DCHECK(object->elements()->length() == 0);
4862 FixedDoubleArray::cast(object->elements()));
4864 if (range < length) length = range;
4866 if (!elements->is_the_hole(
i)) {
4874 SeededNumberDictionary::cast(object->elements()));
4875 uint32_t capacity = dict->Capacity();
4876 for (
uint32_t j = 0; j < capacity; j++) {
4879 if (dict->IsKey(*k)) {
4882 if (index < range) {
4883 indices->
Add(index);
4889 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \
4890 case TYPE##_ELEMENTS: \
4891 case EXTERNAL_##TYPE##_ELEMENTS:
4894 #undef TYPED_ARRAY_CASE
4897 FixedArrayBase::cast(object->elements())->length());
4898 if (range <= length) {
4907 if (length == range)
return;
4913 double length_num = length_obj.ToHandleChecked()->Number();
4949 switch (receiver->GetElementsKind()) {
4957 int fast_length =
static_cast<int>(length);
4958 DCHECK(fast_length <= elements->length());
4959 for (
int j = 0; j < fast_length; j++) {
4962 if (!element_value->IsTheHole()) {
4963 visitor->
visit(j, element_value);
4966 if (!
maybe.has_value)
return false;
4971 isolate, element_value,
4973 visitor->
visit(j, element_value);
4982 if (length == 0)
break;
4985 if (receiver->elements()->IsFixedArray()) {
4986 DCHECK(receiver->elements()->length() == 0);
4990 FixedDoubleArray::cast(receiver->elements()));
4991 int fast_length =
static_cast<int>(length);
4992 DCHECK(fast_length <= elements->length());
4993 for (
int j = 0; j < fast_length; j++) {
4995 if (!elements->is_the_hole(j)) {
4996 double double_value = elements->get_scalar(j);
4998 isolate->
factory()->NewNumber(double_value);
4999 visitor->
visit(j, element_value);
5002 if (!
maybe.has_value)
return false;
5008 isolate, element_value,
5010 visitor->
visit(j, element_value);
5024 int n = indices.length();
5032 visitor->
visit(index, element);
5036 }
while (j < n && indices[j] == index);
5042 ExternalUint8ClampedArray::cast(receiver->elements()));
5043 for (
uint32_t j = 0; j < length; j++) {
5045 visitor->
visit(j, e);
5050 IterateExternalArrayElements<ExternalInt8Array, int8_t>(
5051 isolate, receiver,
true,
true, visitor);
5055 IterateExternalArrayElements<ExternalUint8Array, uint8_t>(
5056 isolate, receiver,
true,
true, visitor);
5060 IterateExternalArrayElements<ExternalInt16Array, int16_t>(
5061 isolate, receiver,
true,
true, visitor);
5065 IterateExternalArrayElements<ExternalUint16Array, uint16_t>(
5066 isolate, receiver,
true,
true, visitor);
5070 IterateExternalArrayElements<ExternalInt32Array, int32_t>(
5071 isolate, receiver,
true,
false, visitor);
5075 IterateExternalArrayElements<ExternalUint32Array, uint32_t>(
5076 isolate, receiver,
true,
false, visitor);
5080 IterateExternalArrayElements<ExternalFloat32Array, float>(
5081 isolate, receiver,
false,
false, visitor);
5085 IterateExternalArrayElements<ExternalFloat64Array, double>(
5086 isolate, receiver,
false,
false, visitor);
5106 DCHECK(args.length() == 1);
5109 int argument_count =
static_cast<int>(arguments->length()->Number());
5120 uint32_t estimate_result_length = 0;
5121 uint32_t estimate_nof_elements = 0;
5122 for (
int i = 0;
i < argument_count;
i++) {
5127 if (obj->IsJSArray()) {
5129 length_estimate =
static_cast<uint32_t>(array->length()->Number());
5130 if (length_estimate != 0) {
5139 if (obj->IsHeapObject()) {
5140 if (obj->IsNumber()) {
5148 length_estimate = 1;
5149 element_estimate = 1;
5155 estimate_result_length += length_estimate;
5160 estimate_nof_elements += element_estimate;
5167 bool fast_case = (estimate_nof_elements * 2) >= estimate_result_length;
5171 isolate->factory()->NewFixedDoubleArray(estimate_result_length);
5173 bool failure =
false;
5174 if (estimate_result_length > 0) {
5177 for (
int i = 0;
i < argument_count;
i++) {
5180 double_storage->set(j, Smi::cast(*obj)->value());
5182 }
else if (obj->IsNumber()) {
5183 double_storage->set(j, obj->Number());
5186 JSArray* array = JSArray::cast(*obj);
5192 if (length == 0)
break;
5194 FixedDoubleArray::cast(array->elements());
5206 double_storage->set(j, double_value);
5213 FixedArray* elements(FixedArray::cast(array->elements()));
5216 if (element->IsTheHole()) {
5220 int32_t int_value = Smi::cast(element)->value();
5221 double_storage->set(j, int_value);
5242 array->set_map(*
map);
5243 array->set_length(length);
5244 array->set_elements(*storage);
5255 isolate->factory()->NewFixedArrayWithHoles(estimate_result_length);
5259 estimate_nof_elements + (estimate_nof_elements >> 2);
5266 for (
int i = 0;
i < argument_count;
i++) {
5268 if (obj->IsJSArray()) {
5271 return isolate->heap()->exception();
5274 visitor.
visit(0, obj);
5282 NewRangeError(
"invalid_array_length", HandleVector<Object>(
NULL, 0)));
5296 DCHECK(args.length() == 2);
5306 DCHECK(args.length() == 2);
5316 to->set_length(from->length());
5329 DCHECK(args.length() == 1);
5332 SealHandleScope shs(isolate);
5333 if (elements->IsDictionary()) {
5338 DCHECK(array->length()->IsSmi());
5340 int length = elements->length();
5347 const int kNumberOfHoleCheckSamples = 97;
5348 int increment = (length < kNumberOfHoleCheckSamples)
5350 :
static_cast<int>(length / kNumberOfHoleCheckSamples);
5353 for (
int i = 0;
i < length;
i += increment) {
5354 if (!accessor->
HasElement(array, array,
i, elements)) {
5358 int estimate =
static_cast<int>((kNumberOfHoleCheckSamples - holes) /
5359 kNumberOfHoleCheckSamples * length);
5372 DCHECK(args.length() == 2);
5375 if (array->elements()->IsDictionary()) {
5379 !iter.
IsAtEnd(); iter.Advance()) {
5382 ->HasIndexedInterceptor()) {
5385 return *isolate->factory()->NewNumberFromUint(length);
5390 isolate->factory()->NewFixedArray(current->NumberOfOwnElements(
NONE));
5391 current->GetOwnElementKeys(*current_keys,
NONE);
5398 for (
int i = 0;
i <
keys->length();
i++) {
5401 return *isolate->factory()->NewJSArrayWithElements(
keys);
5404 array->HasFastDoubleElements());
5405 uint32_t actual_length =
static_cast<uint32_t>(array->elements()->length());
5406 return *isolate->factory()->NewNumberFromUint(
Min(actual_length, length));
5413 DCHECK(args.length() == 3);
5418 if (!receiver->IsJSObject())
return isolate->heap()->undefined_value();
5428 SealHandleScope shs(isolate);
5429 DCHECK(args.length() == 0);
5430 isolate->debug()->HandleDebugBreak();
5431 return isolate->heap()->undefined_value();
5443 return static_cast<StackFrame::Id
>(wrapped << 2);
5452 SealHandleScope shs(isolate);
5453 DCHECK(args.length() == 2);
5454 RUNTIME_ASSERT(args[0]->IsJSFunction() || args[0]->IsUndefined() ||
5458 isolate->debug()->SetEventListener(callback, data);
5460 return isolate->heap()->undefined_value();
5465 SealHandleScope shs(isolate);
5466 DCHECK(args.length() == 0);
5467 isolate->stack_guard()->RequestDebugBreak();
5468 return isolate->heap()->undefined_value();
5473 bool* has_caught =
NULL) {
5474 for (; it->IsFound(); it->Next()) {
5475 switch (it->state()) {
5476 case LookupIterator::NOT_FOUND:
5477 case LookupIterator::TRANSITION:
5479 case LookupIterator::ACCESS_CHECK:
5482 case LookupIterator::INTERCEPTOR:
5483 case LookupIterator::JSPROXY:
5484 return it->isolate()->factory()->undefined_value();
5487 if (!accessors->IsAccessorInfo()) {
5488 return it->isolate()->factory()->undefined_value();
5491 it->GetReceiver(), it->name(), it->GetHolder<
JSObject>(),
5494 if (!maybe_result.ToHandle(&result)) {
5495 result =
handle(it->isolate()->pending_exception(), it->isolate());
5496 it->isolate()->clear_pending_exception();
5497 if (has_caught !=
NULL) *has_caught =
true;
5502 case LookupIterator::DATA:
5503 return it->GetDataValue();
5507 return it->isolate()->factory()->undefined_value();
5521 DCHECK(args.length() == 2);
5532 SaveContext save(isolate);
5533 if (isolate->debug()->in_debug_scope()) {
5534 isolate->set_context(*isolate->debug()->debugger_entry()->GetContext());
5540 if (
name->AsArrayIndex(&index)) {
5544 isolate, element_or_char,
5546 details->set(0, *element_or_char);
5549 return *isolate->factory()->NewJSArrayWithElements(details);
5552 LookupIterator it(obj,
name, LookupIterator::HIDDEN);
5553 bool has_caught =
false;
5555 if (!it.IsFound())
return isolate->heap()->undefined_value();
5559 maybe_pair = it.GetAccessors();
5564 bool has_js_accessors = !maybe_pair.
is_null() && maybe_pair->IsAccessorPair();
5566 isolate->factory()->NewFixedArray(has_js_accessors ? 6 : 3);
5567 details->set(0, *value);
5569 PropertyDetails d = it.state() == LookupIterator::INTERCEPTOR
5571 : it.property_details();
5572 details->set(1, d.AsSmi());
5574 2, isolate->heap()->ToBoolean(it.state() == LookupIterator::INTERCEPTOR));
5575 if (has_js_accessors) {
5576 AccessorPair* accessors = AccessorPair::cast(*maybe_pair);
5577 details->set(3, isolate->heap()->ToBoolean(has_caught));
5582 return *isolate->factory()->NewJSArrayWithElements(details);
5589 DCHECK(args.length() == 2);
5594 LookupIterator it(obj,
name);
5602 SealHandleScope shs(isolate);
5603 DCHECK(args.length() == 1);
5612 SealHandleScope shs(isolate);
5613 DCHECK(args.length() == 1);
5615 return Smi::FromInt(
static_cast<int>(details.attributes()));
5622 SealHandleScope shs(isolate);
5623 DCHECK(args.length() == 1);
5635 DCHECK(args.length() == 2);
5652 DCHECK(args.length() == 2);
5671 SealHandleScope shs(isolate);
5672 DCHECK(args.length() == 1);
5675 return isolate->heap()->true_value();
5681 DCHECK(args.length() == 1);
5687 StackFrame::Id
id = isolate->debug()->break_frame_id();
5688 if (
id == StackFrame::NO_ID) {
5693 for (JavaScriptFrameIterator it(isolate,
id); !it.done(); it.Advance()) {
5695 it.frame()->Summarize(&frames);
5696 for (
int i = frames.length() - 1;
i >= 0;
i--) {
5698 if (!frames[
i].
function()->IsFromNativeScript()) n++;
5711 if (frame->is_optimized()) {
5713 frame, inlined_jsframe_index, isolate);
5792 SaveContext* save = isolate->save_context();
5793 while (save !=
NULL && !save->IsBelowFrame(frame)) {
5794 save = save->prev();
5805 for (; !it->done(); it->Advance()) {
5807 it->frame()->Summarize(&frames);
5808 for (
int i = frames.length() - 1;
i >= 0;
i--) {
5810 if (frames[
i].
function()->IsFromNativeScript())
continue;
5811 if (++count == index)
return i;
5837 DCHECK(args.length() == 2);
5842 Heap* heap = isolate->heap();
5845 StackFrame::Id
id = isolate->debug()->break_frame_id();
5846 if (
id == StackFrame::NO_ID) {
5848 return heap->undefined_value();
5851 JavaScriptFrameIterator it(isolate,
id);
5854 if (inlined_jsframe_index == -1)
return heap->undefined_value();
5856 FrameInspector frame_inspector(it.frame(), inlined_jsframe_index, isolate);
5857 bool is_optimized = it.frame()->is_optimized();
5879 int local_count = scope_info->LocalCount();
5880 for (
int slot = 0; slot < scope_info->LocalCount(); ++slot) {
5883 if (scope_info->LocalIsSynthetic(slot)) local_count--;
5887 isolate->factory()->NewFixedArray(local_count * 2);
5892 for (;
i < scope_info->StackLocalCount(); ++
i) {
5894 if (scope_info->LocalIsSynthetic(
i))
continue;
5895 locals->set(local * 2, scope_info->LocalName(
i));
5899 if (local < local_count) {
5903 for (;
i < scope_info->LocalCount(); ++
i) {
5904 if (scope_info->LocalIsSynthetic(
i))
continue;
5909 locals->set(local * 2, *
name);
5911 scope_info,
name, &
mode, &init_flag, &maybe_assigned_flag);
5912 Object* value = context->get(context_slot_index);
5913 locals->set(local * 2 + 1, value);
5920 bool at_return =
false;
5921 if (!is_optimized && index == 0) {
5922 at_return = isolate->debug()->IsBreakAtReturn(it.frame());
5927 Handle<Object> return_value = isolate->factory()->undefined_value();
5931 while (!it2.done()) {
5932 if (it2.
frame()->is_internal()) {
5933 internal_frame_sp = it2.
frame()->sp();
5935 if (it2.
frame()->is_java_script()) {
5936 if (it2.
frame()->id() == it.frame()->id()) {
5941 if (internal_frame_sp !=
NULL) {
5950 internal_frame_sp =
NULL;
5960 if ((inlined_jsframe_index == 0) && it.frame()->has_adapted_arguments()) {
5961 it.AdvanceToArgumentsFrame();
5967 int argument_count = scope_info->ParameterCount();
5974 2 * (argument_count + local_count) + (at_return ? 1 : 0);
6007 if (*save->context() == *isolate->debug()->debug_context()) {
6012 flags |= inlined_jsframe_index << 2;
6020 for (
int i = 0;
i < argument_count;
i++) {
6022 if (i < scope_info->ParameterCount()) {
6023 details->set(details_index++, scope_info->ParameterName(
i));
6025 details->set(details_index++, heap->undefined_value());
6031 details->set(details_index++, frame_inspector.
GetParameter(
i));
6033 details->set(details_index++, heap->undefined_value());
6038 for (
int i = 0;
i < local_count * 2;
i++) {
6039 details->set(details_index++, locals->get(
i));
6044 details->set(details_index++, *return_value);
6051 if (!receiver->IsJSObject() && shared->strict_mode() ==
SLOPPY &&
6052 !function->IsBuiltin()) {
6060 if (receiver->IsUndefined()) {
6061 receiver =
handle(function->global_proxy());
6066 .ToHandle(&receiver)) {
6068 return heap->undefined_value();
6075 return *isolate->factory()->NewJSArrayWithElements(details);
6085 &maybe_assigned_flag) != -1;
6099 for (
int i = 0;
i < scope_info->ParameterCount(); ++
i) {
6107 : isolate->
heap()->undefined_value(),
6109 DCHECK(!value->IsTheHole());
6117 for (
int i = 0;
i < scope_info->StackLocalCount(); ++
i) {
6118 if (scope_info->LocalIsSynthetic(
i))
continue;
6121 if (value->IsTheHole())
continue;
6136 int inlined_jsframe_index) {
6137 if (inlined_jsframe_index != 0 || frame->is_optimized()) {
6148 for (
int i = 0;
i < scope_info->ParameterCount(); ++
i) {
6161 for (
int i = 0;
i < scope_info->StackLocalCount(); ++
i) {
6162 if (scope_info->LocalIsSynthetic(
i))
continue;
6166 target,
handle(scope_info->StackLocalName(
i),
6167 isolate)).ToHandleChecked();
6180 if (!scope_info->HasContext())
return target;
6184 Handle<Context> function_context(frame_context->declaration_context());
6192 if (function_context->closure() == *
function) {
6193 if (function_context->has_extension() &&
6194 !function_context->IsNativeContext()) {
6201 for (
int i = 0;
i <
keys->length();
i++) {
6209 isolate, target, key, value,
SLOPPY),
6221 FrameInspector frame_inspector(frame, inlined_jsframe_index, isolate);
6225 isolate->
factory()->NewJSObject(isolate->object_function());
6227 isolate, local_scope,
6241 for (
int i = 0;
i < scope_info->ContextLocalCount();
i++) {
6248 scope_info, next_name, &
mode, &init_flag, &maybe_assigned_flag);
6249 context->set(context_index, *new_value);
6259 int inlined_jsframe_index,
6262 if (inlined_jsframe_index != 0 || frame->is_optimized()) {
6271 bool default_result =
false;
6274 for (
int i = 0;
i < scope_info->ParameterCount(); ++
i) {
6279 default_result =
true;
6284 for (
int i = 0;
i < scope_info->StackLocalCount(); ++
i) {
6292 if (scope_info->HasContext()) {
6295 Handle<Context> function_context(frame_context->declaration_context());
6297 variable_name, new_value)) {
6302 if (function_context->closure() == *
function) {
6303 if (function_context->has_extension() &&
6304 !function_context->IsNativeContext()) {
6320 return default_result;
6328 DCHECK(context->IsFunctionContext());
6336 isolate->
factory()->NewJSObject(isolate->object_function());
6346 if (context->has_extension()) {
6353 for (
int i = 0;
i <
keys->length();
i++) {
6362 closure_scope, key, value,
NONE),
6367 return closure_scope;
6375 DCHECK(context->IsFunctionContext());
6388 if (context->has_extension()) {
6408 DCHECK(context->IsCatchContext());
6413 isolate->
factory()->NewJSObject(isolate->object_function());
6415 catch_scope,
name, thrown_object,
NONE),
6424 DCHECK(context->IsCatchContext());
6438 DCHECK(context->IsBlockContext());
6444 isolate->
factory()->NewJSObject(isolate->object_function());
6460 DCHECK(context->IsModuleContext());
6466 isolate->
factory()->NewJSObject(isolate->object_function());
6474 return module_scope;
6495 int inlined_jsframe_index,
bool ignore_nested_scopes =
false)
6506 if (shared_info->script() == isolate->
heap()->undefined_value()) {
6525 if (!ignore_nested_scopes) {
6539 ignore_nested_scopes = break_location_iterator.
IsExit();
6542 if (ignore_nested_scopes) {
6543 if (scope_info->HasContext()) {
6592 if (function->IsBuiltin()) {
6631 switch (scope_info->scope_type()) {
6633 DCHECK(
context_->IsFunctionContext() || !scope_info->HasContext());
6658 if (
context_->IsFunctionContext()) {
6709 variable_name, new_value);
6717 variable_name, new_value);
6732 }
else if (
context_->IsBlockContext()) {
6734 }
else if (
context_->IsFunctionContext()) {
6766 function_->shared()->scope_info()->Print();
6771 if (extension->IsJSContextExtensionObject()) {
6772 extension->Print(os);
6795 if (extension->IsJSContextExtensionObject()) {
6796 extension->Print(os);
6819 if (scope !=
NULL) {
6820 int source_position = shared_info->code()->SourcePosition(
frame_->pc());
6840 DCHECK(args.length() == 2);
6848 JavaScriptFrameIterator it(isolate,
id);
6866 DCHECK(args.length() == 2);
6874 JavaScriptFrameIterator frame_it(isolate,
id);
6882 if (!isolate->debug()->EnsureDebugInfo(shared, fun)) {
6883 return isolate->heap()->undefined_value();
6897 while (!break_location_iterator.
Done()) {
6899 if (break_location_iterator.
pc() > frame->pc()) {
6902 StackFrame::Id break_frame_id = isolate->debug()->break_frame_id();
6905 if (break_frame_id == StackFrame::NO_ID) {
6909 JavaScriptFrameIterator additional_frame_it(isolate, break_frame_id);
6912 accept = additional_frame_it.frame()->id() == id;
6926 break_location_iterator.
Next();
6953 return isolate->
factory()->NewJSArrayWithElements(details);
6968 DCHECK(args.length() == 4);
6978 JavaScriptFrameIterator frame_it(isolate,
id);
6984 for (; !it.
Done() && n < index; it.
Next()) {
6988 return isolate->heap()->undefined_value();
7008 DCHECK(args.length() == 3 || args.length() == 4);
7015 bool ignore_nested_scopes =
false;
7016 if (args.length() == 4) {
7018 ignore_nested_scopes =
flag;
7023 JavaScriptFrameIterator frame_it(isolate,
id);
7027 ScopeIterator it(isolate, frame, inlined_jsframe_index, ignore_nested_scopes);
7032 result.
Add(details);
7036 for (
int i = 0;
i < result.length(); ++
i) {
7037 array->set(
i, *result[
i]);
7039 return *isolate->factory()->NewJSArrayWithElements(array);
7045 DCHECK(args.length() == 1);
7062 DCHECK(args.length() == 2);
7071 for (; !it.
Done() && n < index; it.
Next()) {
7075 return isolate->heap()->undefined_value();
7088 for (
int n = 0; !it->
Done() && n < index; it->Next()) {
7109 DCHECK(args.length() == 6);
7117 if (args[0]->IsNumber()) {
7126 JavaScriptFrameIterator frame_it(isolate,
id);
7137 return isolate->heap()->ToBoolean(res);
7143 DCHECK(args.length() == 0);
7147 StackFrameLocator locator(isolate);
7153 return isolate->heap()->undefined_value();
7159 DCHECK(args.length() == 1);
7165 for (
ThreadState* thread = isolate->thread_manager()->FirstThreadStateInUse();
7166 thread !=
NULL; thread = thread->Next()) {
7188 DCHECK(args.length() == 2);
7202 isolate->heap()->true_value());
7208 ThreadState* thread = isolate->thread_manager()->FirstThreadStateInUse();
7209 while (index != n && thread !=
NULL) {
7210 thread = thread->
Next();
7213 if (thread ==
NULL) {
7214 return isolate->heap()->undefined_value();
7219 isolate->heap()->false_value());
7225 return *isolate->factory()->NewJSArrayWithElements(details);
7233 DCHECK(args.length() == 1);
7235 isolate->debug()->set_disable_break(disable_break);
7236 return isolate->heap()->undefined_value();
7247 DCHECK(args.length() == 2);
7253 return isolate->ThrowIllegalOperation();
7262 if (break_locations->IsUndefined())
return isolate->heap()->undefined_value();
7264 return *isolate->factory()->NewJSArrayWithElements(
7275 DCHECK(args.length() == 3);
7278 RUNTIME_ASSERT(source_position >= function->shared()->start_position() &&
7279 source_position <= function->shared()->end_position());
7284 function, break_point_object_arg, &source_position));
7299 DCHECK(args.length() == 4);
7307 return isolate->ThrowIllegalOperation();
7317 if (!isolate->debug()->SetBreakPointForScript(script, break_point_object_arg,
7318 &source_position, alignment)) {
7319 return isolate->heap()->undefined_value();
7330 DCHECK(args.length() == 1);
7334 isolate->debug()->ClearBreakPoint(break_point_object_arg);
7336 return isolate->heap()->undefined_value();
7345 DCHECK(args.length() == 2);
7353 isolate->debug()->ChangeBreakOnException(type, enable);
7354 return isolate->heap()->undefined_value();
7362 DCHECK(args.length() == 1);
7366 bool result = isolate->debug()->IsBreakOnException(type);
7378 DCHECK(args.length() == 4);
7382 if (!args[1]->IsNumber() || !args[2]->IsNumber()) {
7383 return isolate->Throw(isolate->heap()->illegal_argument_string());
7388 StackFrame::Id frame_id;
7389 if (wrapped_frame_id == 0) {
7390 frame_id = StackFrame::NO_ID;
7400 return isolate->Throw(isolate->heap()->illegal_argument_string());
7403 if (frame_id != StackFrame::NO_ID && step_action !=
StepNext &&
7405 return isolate->ThrowIllegalOperation();
7410 if (step_count < 1) {
7411 return isolate->Throw(isolate->heap()->illegal_argument_string());
7415 isolate->debug()->ClearStepping();
7418 isolate->debug()->PrepareStep(
static_cast<StepAction>(step_action),
7419 step_count, frame_id);
7420 return isolate->heap()->undefined_value();
7427 DCHECK(args.length() == 0);
7428 isolate->debug()->ClearStepping();
7429 return isolate->heap()->undefined_value();
7439 if (!function->shared()->is_function())
return target;
7441 target, isolate->
factory()->arguments_string());
7443 if (
maybe.value)
return target;
7450 target, arguments_str, arguments,
NONE),
7462 if (context_extension->IsJSObject()) {
7465 context = isolate->
factory()->NewWithContext(closure, context, extension);
7477 isolate, result, Execution::Call(isolate, eval_fun, receiver, 0,
NULL),
7482 if (result->IsJSGlobalProxy()) {
7496 isolate->
factory()->NewJSObject(isolate->object_function());
7498 new_map->set_prototype(*isolate->
factory()->null_value());
7514 DCHECK(args.length() == 6);
7525 DisableBreak disable_break_scope(isolate->debug(), disable_break);
7529 JavaScriptFrameIterator it(isolate,
id);
7531 FrameInspector frame_inspector(frame, inlined_jsframe_index, isolate);
7538 SaveContext savex(isolate);
7539 isolate->set_context(*(save->context()));
7545 isolate, materialized,
7550 isolate, materialized,
7575 while (!function_context->IsFunctionContext() &&
7576 !function_context.is_identical_to(outer_context)) {
7577 inner_context = function_context;
7578 function_context =
Handle<Context>(function_context->previous(), isolate);
7581 Handle<Context> materialized_context = isolate->factory()->NewWithContext(
7582 function, function_context, materialized);
7584 if (inner_context.
is_null()) {
7586 eval_context = materialized_context;
7588 inner_context->set_previous(*materialized_context);
7593 DebugEvaluate(isolate, eval_context, context_extension, receiver, source);
7596 if (!inner_context.
is_null()) inner_context->set_previous(*function_context);
7603 frame, inlined_jsframe_index);
7614 DCHECK(args.length() == 4);
7623 DisableBreak disable_break_scope(isolate->debug(), disable_break);
7626 SaveContext save(isolate);
7627 SaveContext* top = &save;
7628 while (top !=
NULL && *top->context() == *isolate->debug()->debug_context()) {
7632 isolate->set_context(*top->context());
7642 DebugEvaluate(isolate, context, context_extension, receiver, source));
7649 DCHECK(args.length() == 0);
7655 for (
int i = 0;
i < instances->length();
i++) {
7663 instances->set(
i, *wrapper);
7668 isolate->factory()->NewJSObject(isolate->array_function());
7676 Object* instance_filter,
int max_references,
7680 SealHandleScope shs(isolate);
7687 while (((heap_obj = iterator->next()) !=
NULL) &&
7688 (max_references == 0 || count < max_references)) {
7690 if (heap_obj->IsJSObject()) {
7693 JSObject* obj = JSObject::cast(heap_obj);
7694 if (obj->IsJSContextExtensionObject() ||
7695 obj->
map()->constructor() == arguments_function) {
7703 if (!instance_filter->IsUndefined()) {
7706 if (iter.GetCurrent() == instance_filter) {
7716 if (instances !=
NULL && count < instances_size) {
7717 instances->
set(count, obj);
7730 if (count == 1 && last == target) {
7745 DCHECK(args.length() == 3);
7751 instance_filter->IsJSObject());
7758 JSFunction::cast(isolate->sloppy_arguments_map()->constructor()));
7764 Heap* heap = isolate->heap();
7767 HeapIterator heap_iterator(heap);
7769 max_references,
NULL, 0, *arguments_function);
7777 HeapIterator heap_iterator(heap);
7779 max_references, *instances, count,
7780 *arguments_function);
7795 int instances_size) {
7801 while (((heap_obj = iterator->next()) !=
NULL) &&
7802 (max_references == 0 || count < max_references)) {
7804 if (heap_obj->IsJSObject()) {
7805 JSObject* obj = JSObject::cast(heap_obj);
7806 if (obj->
map()->constructor() == constructor) {
7809 if (instances !=
NULL && count < instances_size) {
7810 instances->
set(count, obj);
7827 DCHECK(args.length() == 2);
7839 Heap* heap = isolate->heap();
7842 HeapIterator heap_iterator(heap);
7852 HeapIterator heap_iterator2(heap);
7869 DCHECK(args.length() == 1);
7878 DCHECK(args.length() == 2);
7886 int compilation_state = script->compilation_state();
7888 script->set_source(*source);
7890 return isolate->heap()->undefined_value();
7897 DCHECK(args.length() == 1);
7901 return isolate->heap()->exception();
7904 func->code()->Print(os);
7907 return isolate->heap()->undefined_value();
7914 DCHECK(args.length() == 1);
7918 return isolate->heap()->exception();
7921 func->shared()->construct_stub()->Print(os);
7924 return isolate->heap()->undefined_value();
7929 SealHandleScope shs(isolate);
7930 DCHECK(args.length() == 1);
7933 return f->shared()->inferred_name();
7942 int buffer_size = buffer->
length();
7944 obj = iterator->next()) {
7946 if (!obj->IsSharedFunctionInfo()) {
7950 if (shared->script() != script) {
7953 if (counter < buffer_size) {
7954 buffer->
set(counter, shared);
7967 CHECK(isolate->debug()->live_edit_enabled());
7968 DCHECK(args.length() == 1);
7977 array = isolate->factory()->NewFixedArray(
kBufferSize);
7979 Heap* heap = isolate->heap();
7981 HeapIterator heap_iterator(heap);
7987 array = isolate->factory()->NewFixedArray(number);
7988 HeapIterator heap_iterator(heap);
7994 Handle<JSArray> result = isolate->factory()->NewJSArrayWithElements(array);
8012 CHECK(isolate->debug()->live_edit_enabled());
8013 DCHECK(args.length() == 2);
8032 CHECK(isolate->debug()->live_edit_enabled());
8033 DCHECK(args.length() == 3);
8039 Handle<Script> original_script(Script::cast(original_script_value->value()));
8042 original_script, new_source, old_script_name);
8044 if (old_script->IsScript()) {
8048 return isolate->heap()->null_value();
8055 CHECK(isolate->debug()->live_edit_enabled());
8056 DCHECK(args.length() == 1);
8061 return isolate->heap()->undefined_value();
8068 CHECK(isolate->debug()->live_edit_enabled());
8069 DCHECK(args.length() == 2);
8075 return isolate->heap()->undefined_value();
8082 CHECK(isolate->debug()->live_edit_enabled());
8083 DCHECK(args.length() == 2);
8087 if (function_object->IsJSValue()) {
8089 if (script_object->IsJSValue()) {
8090 RUNTIME_ASSERT(JSValue::cast(*script_object)->value()->IsScript());
8091 Script* script = Script::cast(JSValue::cast(*script_object)->value());
8094 RUNTIME_ASSERT(function_wrapper->value()->IsSharedFunctionInfo());
8101 return isolate->heap()->undefined_value();
8109 CHECK(isolate->debug()->live_edit_enabled());
8110 DCHECK(args.length() == 3);
8121 return isolate->heap()->undefined_value();
8132 CHECK(isolate->debug()->live_edit_enabled());
8133 DCHECK(args.length() == 2);
8139 return isolate->heap()->undefined_value();
8149 CHECK(isolate->debug()->live_edit_enabled());
8150 DCHECK(args.length() == 2);
8155 int array_length = Smi::cast(shared_array->length())->value();
8156 for (
int i = 0;
i < array_length;
i++) {
8160 element->IsJSValue() &&
8173 CHECK(isolate->debug()->live_edit_enabled());
8174 DCHECK(args.length() == 2);
8186 CHECK(isolate->debug()->live_edit_enabled());
8187 DCHECK(args.length() == 2);
8192 Heap* heap = isolate->heap();
8195 StackFrame::Id
id = isolate->debug()->break_frame_id();
8196 if (
id == StackFrame::NO_ID) {
8198 return heap->undefined_value();
8201 JavaScriptFrameIterator it(isolate,
id);
8203 if (inlined_jsframe_index == -1)
return heap->undefined_value();
8207 if (error_message) {
8208 return *(isolate->factory()->InternalizeUtf8String(error_message));
8210 return heap->true_value();
8218 CHECK(isolate->debug()->live_edit_enabled());
8219 DCHECK(args.length() == 2);
8225 if (code->kind() != Code::FUNCTION &&
8226 code->kind() != Code::OPTIMIZED_FUNCTION) {
8227 return isolate->heap()->undefined_value();
8233 while (!it.
done()) {
8234 int statement_position =
static_cast<int>(it.
rinfo()->
data());
8236 if (source_position <= statement_position &&
8237 statement_position - source_position < distance) {
8239 static_cast<int>(it.
rinfo()->
pc() - code->instruction_start());
8240 distance = statement_position - source_position;
8242 if (distance == 0)
break;
8256 DCHECK(args.length() == 2);
8261 if (without_debugger) {
8262 maybe_result = Execution::Call(isolate,
function,
8265 DebugScope debug_scope(isolate->debug());
8266 maybe_result = Execution::Call(isolate,
function,
8278 SealHandleScope shs(isolate);
8279 DCHECK(args.length() == 1);
8281 return isolate->heap()->undefined_value();
8287 SealHandleScope shs(isolate);
8288 DCHECK(args.length() == 0);
8289 int usage =
static_cast<int>(isolate->heap()->SizeOfObjects());
8291 return *isolate->factory()->NewNumberFromInt(usage);
8308 Factory* factory = script_name->GetIsolate()->factory();
8309 Heap* heap = script_name->GetHeap();
8310 HeapIterator iterator(heap);
8312 while (script.
is_null() && ((obj = iterator.next()) !=
NULL)) {
8314 if (obj->IsScript()) {
8315 if (Script::cast(obj)->
name()->IsString()) {
8316 if (String::cast(Script::cast(obj)->
name())->
Equals(*script_name)) {
8324 if (script.
is_null())
return factory->undefined_value();
8337 DCHECK(args.length() == 1);
8353 DCHECK(args.length() == 2);
8357 if (!isolate->bootstrapper()->IsActive()) {
8359 isolate->CaptureAndSetDetailedStackTrace(error_object);
8361 isolate->CaptureAndSetSimpleStackTrace(error_object, caller);
8363 return isolate->heap()->undefined_value();
8370 DCHECK(args.length() == 0);
8374 return *isolate->factory()->NewStringFromAsciiChecked(version_string);
8381 DCHECK(args.length() == 1);
8384 return generator->function();
8391 DCHECK(args.length() == 1);
8394 return generator->context();
8401 DCHECK(args.length() == 1);
8404 return generator->receiver();
8411 DCHECK(args.length() == 1);
8420 DCHECK(args.length() == 1);
8423 if (generator->is_suspended()) {
8424 Handle<Code> code(generator->function()->code(), isolate);
8425 int offset = generator->continuation();
8433 return isolate->heap()->undefined_value();
8439 DCHECK(args.length() == 2);
8443 FieldIndex field_index =
8444 FieldIndex::ForLoadByFieldIndex(object->map(), index->value());
8445 if (field_index.is_inobject()) {
8447 object->map()->inobject_properties());
8450 object->properties()->length());
8452 Handle<Object> raw_value(object->RawFastPropertyAt(field_index), isolate);
8460 DCHECK(args.length() == 1);
8464 if (!js_object->map()->is_deprecated())
return Smi::FromInt(0);
8475 SealHandleScope shs(isolate);
8483 int finger_index = cache->finger_index();
8484 Object* o = cache->get(finger_index);
8487 return cache->get(finger_index + 1);
8494 cache->set_finger_index(
i);
8495 return cache->get(
i + 1);
8499 int size = cache->size();
8500 DCHECK(size <= cache->length());
8502 for (
int i =
size - 2;
i > finger_index;
i -= 2) {
8505 cache->set_finger_index(
i);
8506 return cache->get(
i + 1);
8526 Execution::Call(isolate, factory, receiver,
arraysize(argv), argv));
8530 if (FLAG_verify_heap) {
8531 cache_handle->JSFunctionResultCacheVerify();
8536 int finger_index = cache_handle->finger_index();
8537 int size = cache_handle->size();
8542 if (size < cache_handle->length()) {
8547 if (index == cache_handle->length()) {
8554 DCHECK(index < cache_handle->length());
8556 cache_handle->set(index, *key_handle);
8557 cache_handle->set(index + 1, *value);
8558 cache_handle->set_finger_index(index);
8561 if (FLAG_verify_heap) {
8562 cache_handle->JSFunctionResultCacheVerify();
8571 SealHandleScope shs(isolate);
8572 DCHECK(args.length() == 1);
8579 SealHandleScope shs(isolate);
8580 DCHECK(args.length() == 1);
8582 return message->script();
8591 DCHECK(args.length() == 0);
8592 #define COUNT_ENTRY(Name, argc, ressize) +1
8597 Factory* factory = isolate->factory();
8600 bool inline_runtime_functions =
false;
8601 #define ADD_ENTRY(Name, argc, ressize) \
8603 HandleScope inner(isolate); \
8604 Handle<String> name; \
8606 if (inline_runtime_functions) { \
8607 name = factory->NewStringFromStaticChars("_" #Name); \
8609 name = factory->NewStringFromStaticChars(#Name); \
8611 Handle<FixedArray> pair_elements = factory->NewFixedArray(2); \
8612 pair_elements->set(0, *name); \
8613 pair_elements->set(1, Smi::FromInt(argc)); \
8614 Handle<JSArray> pair = factory->NewJSArrayWithElements(pair_elements); \
8615 elements->set(index++, *pair); \
8617 inline_runtime_functions =
false;
8620 inline_runtime_functions =
true;
8636 #define TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION(Type, type, TYPE, ctype, size) \
8637 RUNTIME_FUNCTION(Runtime_HasExternal##Type##Elements) { \
8638 CONVERT_ARG_CHECKED(JSObject, obj, 0); \
8639 return isolate->heap()->ToBoolean(obj->HasExternal##Type##Elements()); \
8644 #undef TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION
8647 #define FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION(Type, type, TYPE, ctype, s) \
8648 RUNTIME_FUNCTION(Runtime_HasFixed##Type##Elements) { \
8649 CONVERT_ARG_CHECKED(JSObject, obj, 0); \
8650 return isolate->heap()->ToBoolean(obj->HasFixed##Type##Elements()); \
8655 #undef FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION
8659 SealHandleScope shs(isolate);
8660 DCHECK(args.length() == 1);
8662 return isolate->heap()->ToBoolean(obj->IsJSGlobalProxy());
8667 SealHandleScope shs(isolate);
8668 DCHECK(args.length() == 1);
8670 if (!args[0]->IsJSReceiver())
return isolate->heap()->false_value();
8672 DCHECK(!obj->IsJSGlobalProxy() || !obj->map()->is_observed());
8673 return isolate->heap()->ToBoolean(obj->map()->is_observed());
8679 DCHECK(args.length() == 1);
8682 if (obj->IsJSProxy())
return isolate->heap()->undefined_value();
8685 DCHECK(obj->IsJSObject());
8687 return isolate->heap()->undefined_value();
8693 DCHECK(args.length() == 1);
8695 isolate->EnqueueMicrotask(microtask);
8696 return isolate->heap()->undefined_value();
8702 DCHECK(args.length() == 0);
8703 isolate->RunMicrotasks();
8704 return isolate->heap()->undefined_value();
8709 SealHandleScope shs(isolate);
8710 DCHECK(args.length() == 0);
8711 return isolate->heap()->observation_state();
8717 return context1->security_token() == context2->security_token();
8723 DCHECK(args.length() == 3);
8728 Handle<Context> observer_context(observer->context()->native_context());
8732 return isolate->heap()->ToBoolean(
8740 DCHECK(args.length() == 1);
8743 Handle<Context> creation_context(object->GetCreationContext(), isolate);
8744 return isolate->heap()->ToBoolean(
8751 DCHECK(args.length() == 1);
8755 return context->native_object_observe();
8761 DCHECK(args.length() == 1);
8765 return context->native_object_get_notifier();
8771 DCHECK(args.length() == 1);
8775 return context->native_object_notifier_perform_change();
8783 Factory* factory = isolate->
factory();
8786 bool can_use_type_feedback =
true;
8787 if (caller_args->length() == 1) {
8789 if (argument_one->IsSmi()) {
8793 can_use_type_feedback =
false;
8794 }
else if (value != 0) {
8799 can_use_type_feedback =
false;
8804 if (!site.
is_null() && can_use_type_feedback) {
8809 site->SetElementsKind(to_kind);
8815 Handle<Map> initial_map(constructor->initial_map(), isolate);
8816 if (to_kind != initial_map->elements_kind()) {
8824 allocation_site = site;
8828 initial_map,
NOT_TENURED,
true, allocation_site));
8833 ElementsKind kind = constructor->initial_map()->elements_kind();
8846 (old_kind != array->GetElementsKind() || !can_use_type_feedback)) {
8850 site->SetDoNotInlineCall();
8864 bool no_caller_args = args.length() == 2;
8865 DCHECK(no_caller_args || args.length() == 4);
8866 int parameters_start = no_caller_args ? 0 : 1;
8868 no_caller_args ? &empty_args :
reinterpret_cast<Arguments*
>(args[0]);
8872 if (!no_caller_args) {
8874 DCHECK(arg_count == caller_args->length());
8879 if (!type_info.is_null() &&
8880 *type_info != isolate->heap()->undefined_value()) {
8882 DCHECK(!site->SitePointsToLiteral());
8892 bool no_caller_args = args.length() == 1;
8893 DCHECK(no_caller_args || args.length() == 3);
8894 int parameters_start = no_caller_args ? 0 : 1;
8896 no_caller_args ? &empty_args :
reinterpret_cast<Arguments*
>(args[0]);
8899 if (!no_caller_args) {
8901 DCHECK(arg_count == caller_args->length());
8911 DCHECK(args.length() == 1);
8914 !array->HasFixedTypedArrayElements());
8921 SealHandleScope shs(isolate);
8922 DCHECK(args.length() == 0);
8931 SealHandleScope scope(isolate);
8932 DCHECK(args.length() == 2);
8935 if (!args[0]->IsJSReceiver() || !args[1]->IsObject()) {
8936 Object* error = isolate->ThrowIllegalOperation();
8937 return MakePair(error, isolate->heap()->undefined_value());
8941 if (cache_type->IsMap()) {
8950 return MakePair(object->map()->instance_descriptors()->GetEnumCache(),
8962 SealHandleScope shs(isolate);
8963 DCHECK(args.length() == 2);
8967 if (cache_type->IsMap()) {
8968 length = Map::cast(*cache_type)->EnumLength();
8970 DCHECK(cache_type->IsSmi());
8971 length = array->length();
8984 SealHandleScope scope(isolate);
8985 DCHECK(args.length() == 4);
8989 if (!args[0]->IsJSReceiver() || !args[1]->IsFixedArray() ||
8990 !args[2]->IsObject() || !args[3]->ToInt32(&index)) {
8991 Object* error = isolate->ThrowIllegalOperation();
8992 return MakePair(error, isolate->heap()->undefined_value());
8998 bool slow_check_needed =
false;
8999 if (cache_type->IsMap()) {
9000 if (object->map() != Map::cast(*cache_type)) {
9002 slow_check_needed =
true;
9006 slow_check_needed = Smi::cast(*cache_type)->value() == 1;
9009 isolate->heap()->ToBoolean(slow_check_needed));
9021 RUNTIME_FUNCTION(RuntimeReference_##name) { \
9026 U(IsStringWrapperSafeForDefaultValueOf)
9027 U(DebugBreakInOptimizedCode)
9033 SealHandleScope shs(isolate);
9034 DCHECK(args.length() == 1);
9036 return isolate->heap()->ToBoolean(obj->IsSmi());
9041 SealHandleScope shs(isolate);
9042 DCHECK(args.length() == 1);
9044 return isolate->heap()->ToBoolean(obj->IsSmi() &&
9045 Smi::cast(obj)->value() >= 0);
9050 SealHandleScope shs(isolate);
9051 DCHECK(args.length() == 1);
9053 return isolate->heap()->ToBoolean(obj->IsJSArray());
9058 SealHandleScope shs(isolate);
9059 DCHECK(args.length() == 1);
9061 return isolate->heap()->ToBoolean(obj->IsJSRegExp());
9066 SealHandleScope shs(isolate);
9067 DCHECK(args.length() == 0);
9068 JavaScriptFrameIterator it(isolate);
9075 SealHandleScope shs(isolate);
9076 return __RT_impl_Runtime_Call(args, isolate);
9081 SealHandleScope shs(isolate);
9082 DCHECK(args.length() == 0);
9083 JavaScriptFrameIterator it(isolate);
9090 SealHandleScope shs(isolate);
9091 return __RT_impl_Runtime_GetArgumentsProperty(args, isolate);
9096 SealHandleScope shs(isolate);
9097 DCHECK(args.length() == 1);
9099 if (!obj->IsJSValue())
return obj;
9100 return JSValue::cast(obj)->value();
9105 SealHandleScope shs(isolate);
9106 DCHECK(args.length() == 2);
9109 if (!obj->IsJSValue())
return value;
9110 JSValue::cast(obj)->set_value(value);
9116 SealHandleScope shs(isolate);
9117 DCHECK(args.length() == 2);
9120 if (!obj->IsJSDate()) {
9124 NewTypeError(
"not_date_object", HandleVector<Object>(
NULL, 0)));
9126 JSDate* date = JSDate::cast(obj);
9127 if (index == 0)
return date->value();
9133 SealHandleScope shs(isolate);
9134 DCHECK(args.length() == 2);
9137 return isolate->heap()->ToBoolean(obj1 == obj2);
9142 SealHandleScope shs(isolate);
9143 DCHECK(args.length() == 1);
9145 if (!obj->IsHeapObject())
return isolate->heap()->false_value();
9146 if (obj->IsNull())
return isolate->heap()->true_value();
9147 if (obj->IsUndetectableObject())
return isolate->heap()->false_value();
9148 Map*
map = HeapObject::cast(obj)->map();
9149 bool is_non_callable_spec_object =
9152 return isolate->heap()->ToBoolean(is_non_callable_spec_object);
9157 SealHandleScope shs(isolate);
9158 DCHECK(args.length() == 1);
9160 return isolate->heap()->ToBoolean(obj->IsJSFunction());
9165 SealHandleScope shs(isolate);
9166 DCHECK(args.length() == 1);
9168 return isolate->heap()->ToBoolean(obj->IsUndetectableObject());
9173 SealHandleScope shs(isolate);
9174 DCHECK(args.length() == 1);
9176 return isolate->heap()->ToBoolean(obj->IsSpecObject());
9181 SealHandleScope shs(isolate);
9182 DCHECK(args.length() == 1);
9183 return isolate->heap()->false_value();
9188 SealHandleScope shs(isolate);
9189 DCHECK(args.length() == 1);
9190 return isolate->heap()->undefined_value();
9195 SealHandleScope shs(isolate);
9196 DCHECK(args.length() == 2);
9197 return isolate->heap()->undefined_value();
9214 SealHandleScope shs(isolate);
9215 DCHECK(args.length() == 1);
9217 if (!obj->IsJSReceiver())
return isolate->heap()->null_value();
9218 return JSReceiver::cast(obj)->class_name();
9224 DCHECK(args.length() == 2);
9226 args[0] = isolate->native_context()->jsfunction_result_caches()->get(
id);
9227 return __RT_impl_Runtime_GetFromCache(args, isolate);
9232 SealHandleScope shs(isolate);
9240 #define F(name, number_of_args, result_size) \
9242 Runtime::k##name, Runtime::RUNTIME, #name, FUNCTION_ADDR(Runtime_##name), \
9243 number_of_args, result_size \
9248 #define I(name, number_of_args, result_size) \
9250 Runtime::kInline##name, Runtime::INLINE, "_" #name, \
9251 FUNCTION_ADDR(RuntimeReference_##name), number_of_args, result_size \
9256 #define IO(name, number_of_args, result_size) \
9258 Runtime::kInlineOptimized##name, Runtime::INLINE_OPTIMIZED, "_" #name, \
9259 FUNCTION_ADDR(Runtime_##name), number_of_args, result_size \
9275 DCHECK(dict->NumberOfElements() == 0);
9277 for (
int i = 0;
i < kNumFunctions; ++
i) {
9281 dict, isolate->
factory()->InternalizeUtf8String(
name),
9285 CHECK(new_dict.is_identical_to(dict));
9292 int entry = heap->intrinsic_function_names()->FindEntry(
name);
9294 Object* smi_index = heap->intrinsic_function_names()->ValueAt(entry);
9295 int function_index = Smi::cast(smi_index)->value();
A stack-allocated class that governs a number of local handles.
An object reference managed by the v8 garbage collector.
A JavaScript value representing a 32-bit signed integer.
Isolate represents an isolated instance of the V8 engine.
A JavaScript value representing a 32-bit unsigned integer.
static Local< Context > ToLocal(v8::internal::Handle< v8::internal::Context > obj)
static v8::internal::Handle< To > OpenHandle(v8::Local< From > handle)
static const char * GetVersion()
Get the version string.
static double TimeCurrentMillis()
Object * GetComponent(AccessorComponent component)
static Handle< Object > FunctionSetPrototype(Handle< JSFunction > object, Handle< Object > value)
static Handle< AccessorInfo > MakeModuleExport(Handle< String > name, int index, PropertyAttributes attributes)
static Handle< Object > FunctionGetArguments(Handle< JSFunction > object)
void ExitScope(Handle< AllocationSite > site, Handle< JSObject > object)
Handle< AllocationSite > EnterNewScope()
void ExitScope(Handle< AllocationSite > scope_site, Handle< JSObject > object)
Handle< AllocationSite > EnterNewScope()
static AllocationSiteMode GetMode(ElementsKind boilerplate_elements_kind)
A simple visitor visits every element of Array's.
Handle< FixedArray > storage_
void visit(uint32_t i, Handle< Object > elm)
bool exceeds_array_limit()
void set_storage(FixedArray *storage)
ArrayConcatVisitor(Isolate *isolate, Handle< FixedArray > storage, bool fast_elements)
void increase_index_offset(uint32_t delta)
Handle< JSArray > ToArray()
bool exceeds_array_limit_
void FindBreakLocationFromAddress(Address pc)
bool IsStepInLocation(Isolate *isolate)
Code * builtin(Name name)
void SetContext(Handle< Context > context)
FunctionLiteral * function() const
static Handle< FixedArray > GetElements(Handle< FixedArray > value)
static LiteralType GetLiteralType(Handle< FixedArray > value)
@ OBJECT_LITERAL_SLOW_ELEMENTS
@ OBJECT_LITERAL_FAST_ELEMENTS
static MUST_USE_RESULT MaybeHandle< JSFunction > GetFunctionFromEval(Handle< String > source, Handle< Context > context, StrictMode strict_mode, ParseRestriction restriction, int scope_position)
static bool EnsureCompiled(Handle< JSFunction > function, ClearExceptionFlag flag)
static Context * cast(Object *context)
Context * native_context()
Context * global_context()
GlobalObject * global_object()
Context * declaration_context()
static const int64_t kMaxTimeInMs
int64_t ToUTC(int64_t time_ms)
static const int64_t kMaxTimeBeforeUTCInMs
static bool Parse(Vector< Char > str, FixedArray *output, UnicodeCache *cache)
bool EnsureDebugInfo(Handle< SharedFunctionInfo > shared, Handle< JSFunction > function)
void HandleStepIn(Handle< JSFunction > function, Handle< Object > holder, Address fp, bool is_constructor)
static Handle< DebugInfo > GetDebugInfo(Handle< SharedFunctionInfo > shared)
static Handle< Object > GetSourceBreakLocations(Handle< SharedFunctionInfo > shared, BreakPositionAlignment position_aligment)
void FloodWithOneShot(Handle< JSFunction > function)
Handle< Context > debug_context()
JSFunction * GetFunction()
Object * GetExpression(int index)
Object * GetParameter(int index)
static DeoptimizedFrameInfo * DebuggerInspectableFrame(JavaScriptFrame *frame, int jsframe_index, Isolate *isolate)
static void DeleteDebuggerInspectableFrame(DeoptimizedFrameInfo *info, Isolate *isolate)
static MUST_USE_RESULT Handle< SeededNumberDictionary > New(Isolate *isolate, int at_least_space_for, PretenureFlag pretenure=NOT_TENURED)
Object * ValueAt(int entry)
static MUST_USE_RESULT Handle< NameDictionary > Add(Handle< NameDictionary > dictionary, Handle< Name > key, Handle< Object > value, PropertyDetails details)
PropertyDetails DetailsAt(int entry)
virtual bool HasElement(Handle< Object > receiver, Handle< JSObject > holder, uint32_t key, Handle< FixedArrayBase > backing_store)=0
void set(int index, Object *value)
static MUST_USE_RESULT MaybeHandle< FixedArray > UnionOfKeys(Handle< FixedArray > first, Handle< FixedArray > second)
static const int kMaxLength
bool is_the_hole(int index)
void set(int index, double value)
double get_scalar(int index)
static const int kMaxLength
void SetArgumentsFrame(JavaScriptFrame *frame)
bool has_adapted_arguments_
Object * GetParameter(int index)
DISALLOW_COPY_AND_ASSIGN(FrameInspector)
DeoptimizedFrameInfo * deoptimized_frame_
Object * GetExpression(int index)
FrameInspector(JavaScriptFrame *frame, int inlined_jsframe_index, Isolate *isolate)
static void Destroy(Object **location)
Handle< Object > Create(Object *value)
Handle< T > CloseAndEscape(Handle< T > handle_value)
static Handle< T > cast(Handle< S > that)
static Handle< T > null()
static const int kNotFound
static Object ** RawField(HeapObject *obj, int offset)
Isolate * GetIsolate() const
static const int kHeaderSize
bool InNewSpace(Object *object)
static const int kMakeHeapIterableMask
Object * ToBoolean(bool condition)
static const int kNoGCFlags
void CollectAllGarbage(int flags, const char *gc_reason=NULL, const GCCallbackFlags gc_callback_flags=kNoGCCallbackFlags)
void ReportFailedAccessCheck(Handle< JSObject > receiver, v8::AccessType type)
Object * ThrowIllegalOperation()
Object * Throw(Object *exception, MessageLocation *location=NULL)
JSObject * global_proxy()
bool MayNamedAccess(Handle< JSObject > receiver, Handle< Object > key, v8::AccessType type)
GlobalHandles * global_handles()
bool has_pending_exception()
static void SetContent(Handle< JSArray > array, Handle< FixedArrayBase > storage)
static Object * GetField(Object *date, Smi *index)
static const int kEntriesIndex
static const int kFactoryIndex
static const int kEntrySize
static const int kLiteralNativeContextIndex
static const int kBoundFunctionIndex
static const int kBoundThisIndex
static const int kBoundArgumentsStartIndex
static Handle< JSFunction > CloneClosure(Handle< JSFunction > function)
static Context * NativeContextFromLiterals(FixedArray *literals)
static const int kGeneratorClosed
static const int kGeneratorExecuting
static void SetMapAndElements(Handle< JSObject > object, Handle< Map > map, Handle< FixedArrayBase > elements)
static void ResetElements(Handle< JSObject > object)
static MUST_USE_RESULT MaybeHandle< AccessorPair > GetOwnElementAccessorPair(Handle< JSObject > object, uint32_t index)
static void MigrateSlowToFast(Handle< JSObject > object, int unused_property_fields)
static MUST_USE_RESULT MaybeHandle< Object > SetAccessor(Handle< JSObject > object, Handle< AccessorInfo > info)
static MUST_USE_RESULT MaybeHandle< Object > GetElementWithInterceptor(Handle< JSObject > object, Handle< Object > receiver, uint32_t index)
static void SetObserved(Handle< JSObject > object)
static MUST_USE_RESULT MaybeHandle< Object > Freeze(Handle< JSObject > object)
static void NormalizeProperties(Handle< JSObject > object, PropertyNormalizationMode mode, int expected_additional_properties)
static void EnsureCanContainHeapObjectElements(Handle< JSObject > obj)
static MUST_USE_RESULT MaybeHandle< Object > GetAccessor(Handle< JSObject > object, Handle< Name > name, AccessorComponent component)
static MUST_USE_RESULT MaybeHandle< Object > SetFastElement(Handle< JSObject > object, uint32_t index, Handle< Object > value, StrictMode strict_mode, bool check_prototype)
static void TransitionElementsKind(Handle< JSObject > object, ElementsKind to_kind)
static MUST_USE_RESULT Maybe< bool > HasRealNamedProperty(Handle< JSObject > object, Handle< Name > key)
static MUST_USE_RESULT MaybeHandle< Object > SetOwnElement(Handle< JSObject > object, uint32_t index, Handle< Object > value, StrictMode strict_mode)
static const int kInitialMaxFastElementArray
static Handle< Object > FastPropertyAt(Handle< JSObject > object, Representation representation, FieldIndex index)
bool ReferencesObject(Object *obj)
static MUST_USE_RESULT MaybeHandle< Object > SetElement(Handle< JSObject > object, uint32_t index, Handle< Object > value, PropertyAttributes attributes, StrictMode strict_mode, bool check_prototype=true, SetPropertyMode set_mode=SET_PROPERTY)
static void MigrateToMap(Handle< JSObject > object, Handle< Map > new_map)
static MUST_USE_RESULT MaybeHandle< JSObject > GetKeysForIndexedInterceptor(Handle< JSObject > object, Handle< JSReceiver > receiver)
static Handle< Object > GetDataProperty(Handle< JSObject > object, Handle< Name > key)
static const uint32_t kMaxElementCount
static bool TryMigrateInstance(Handle< JSObject > instance)
static Handle< Map > GetElementsTransitionMap(Handle< JSObject > object, ElementsKind to_kind)
static MUST_USE_RESULT MaybeHandle< Object > SetPrototype(Handle< JSObject > object, Handle< Object > value, bool from_javascript)
static MUST_USE_RESULT MaybeHandle< Object > PreventExtensions(Handle< JSObject > object)
static Handle< Object > SetHiddenProperty(Handle< JSObject > object, Handle< Name > key, Handle< Object > value)
static MUST_USE_RESULT MaybeHandle< JSObject > DeepWalk(Handle< JSObject > object, AllocationSiteCreationContext *site_context)
static void AddProperty(Handle< JSObject > object, Handle< Name > key, Handle< Object > value, PropertyAttributes attributes)
static void EnqueueChangeRecord(Handle< JSObject > object, const char *type, Handle< Name > name, Handle< Object > old_value)
static void ValidateElements(Handle< JSObject > object)
static MaybeHandle< Object > DefineAccessor(Handle< JSObject > object, Handle< Name > name, Handle< Object > getter, Handle< Object > setter, PropertyAttributes attributes)
static MUST_USE_RESULT MaybeHandle< JSObject > DeepCopy(Handle< JSObject > object, AllocationSiteUsageContext *site_context, DeepCopyHints hints=kNoHints)
static bool HasHiddenProperties(Handle< JSObject > object)
static MUST_USE_RESULT MaybeHandle< JSObject > GetKeysForNamedInterceptor(Handle< JSObject > object, Handle< JSReceiver > receiver)
static Handle< SeededNumberDictionary > NormalizeElements(Handle< JSObject > object)
static MUST_USE_RESULT MaybeHandle< Object > SetOwnPropertyIgnoreAttributes(Handle< JSObject > object, Handle< Name > key, Handle< Object > value, PropertyAttributes attributes, ExecutableAccessorInfoHandling handling=DEFAULT_HANDLING)
static Handle< Object > PrepareElementsForSort(Handle< JSObject > object, uint32_t limit)
static void Fix(Handle< JSProxy > proxy)
static MUST_USE_RESULT Maybe< bool > HasOwnElement(Handle< JSReceiver > object, uint32_t index)
static MUST_USE_RESULT Maybe< PropertyAttributes > GetPropertyAttributes(Handle< JSReceiver > object, Handle< Name > name)
static MUST_USE_RESULT Maybe< bool > HasElement(Handle< JSReceiver > object, uint32_t index)
static MUST_USE_RESULT Maybe< PropertyAttributes > GetOwnPropertyAttributes(Handle< JSReceiver > object, Handle< Name > name)
static MUST_USE_RESULT MaybeHandle< Object > DeleteElement(Handle< JSReceiver > object, uint32_t index, DeleteMode mode=NORMAL_DELETION)
static MUST_USE_RESULT Maybe< bool > HasOwnProperty(Handle< JSReceiver >, Handle< Name > name)
static MUST_USE_RESULT MaybeHandle< FixedArray > GetKeys(Handle< JSReceiver > object, KeyCollectionType type)
static MUST_USE_RESULT Maybe< PropertyAttributes > GetOwnElementAttribute(Handle< JSReceiver > object, uint32_t index)
static MUST_USE_RESULT Maybe< bool > HasProperty(Handle< JSReceiver > object, Handle< Name > name)
static MUST_USE_RESULT MaybeHandle< Object > DeleteProperty(Handle< JSReceiver > object, Handle< Name > name, DeleteMode mode=NORMAL_DELETION)
void SetParameterValue(int index, Object *value) const
void RestoreOperandStack(FixedArray *store, int stack_handler_index)
Object * receiver() const
bool IsConstructor() const
virtual void GetFunctions(List< JSFunction * > *functions)
bool has_adapted_arguments() const
static void PrintTop(Isolate *isolate, FILE *file, bool print_args, bool print_line_number)
Address GetParameterSlot(int index) const
int GetArgumentsLength() const
int ComputeOperandsCount() const
Object * GetParameter(int index) const
JSFunction * function() const
void SaveOperandStack(FixedArray *store, int *stack_handler_index) const
int ComputeParametersCount() const
int Lookup(Handle< Map > map, Handle< Name > name)
void Update(Handle< Map > map, Handle< Name > name, int field_offset)
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
void Sort(int(*cmp)(const T *x, const T *y))
static const char * RestartFrame(JavaScriptFrame *frame)
static Handle< JSArray > CheckAndDropActivations(Handle< JSArray > shared_info_array, bool do_drop)
static MUST_USE_RESULT MaybeHandle< JSArray > GatherCompileInfo(Handle< Script > script, Handle< String > source)
static void ReplaceRefToNestedFunction(Handle< JSValue > parent_function_shared, Handle< JSValue > orig_function_shared, Handle< JSValue > subst_function_shared)
static void ReplaceFunctionCode(Handle< JSArray > new_compile_info_array, Handle< JSArray > shared_info_array)
static Handle< Object > ChangeScriptSource(Handle< Script > original_script, Handle< String > new_source, Handle< Object > old_script_name)
static void WrapSharedFunctionInfos(Handle< JSArray > array)
static void PatchFunctionPositions(Handle< JSArray > shared_info_array, Handle< JSArray > position_change_array)
static void FunctionSourceUpdated(Handle< JSArray > shared_info_array)
static Handle< JSArray > CompareStrings(Handle< String > s1, Handle< String > s2)
static void SetFunctionScript(Handle< JSValue > function_wrapper, Handle< Object > script_handle)
static Handle< Map > Create(Isolate *isolate, int inobject_properties)
ElementsKind elements_kind()
static Handle< Map > AsElementsKind(Handle< Map > map, ElementsKind kind)
static bool IsValidElementsTransition(ElementsKind from_kind, ElementsKind to_kind)
InstanceType instance_type()
static Handle< Map > Copy(Handle< Map > map)
static Object *& Object_at(Address addr)
static ModuleInfo * cast(Object *description)
int FindEntry(Handle< Name > key)
static MUST_USE_RESULT MaybeHandle< Object > GetPropertyOrElement(Handle< Object > object, Handle< Name > key)
static MaybeHandle< JSReceiver > ToObject(Isolate *isolate, Handle< Object > object)
static MUST_USE_RESULT MaybeHandle< Object > GetElement(Isolate *isolate, Handle< Object > object, uint32_t index)
static MUST_USE_RESULT MaybeHandle< Object > GetProperty(LookupIterator *it)
@ CERTAINLY_NOT_STORE_FROM_KEYED
void ShortPrint(FILE *out=stdout)
bool ToArrayIndex(uint32_t *index)
static Handle< Object > WrapForRead(Isolate *isolate, Handle< Object > object, Representation representation)
static MUST_USE_RESULT MaybeHandle< Object > GetPropertyWithAccessor(Handle< Object > receiver, Handle< Name > name, Handle< JSObject > holder, Handle< Object > structure)
static MUST_USE_RESULT MaybeHandle< Object > SetProperty(Handle< Object > object, Handle< Name > key, Handle< Object > value, StrictMode strict_mode, StoreFromKeyed store_mode=MAY_BE_STORE_FROM_KEYED)
static const int kMaxRegularHeapObjectSize
A class to uniformly access the prototype of any Object and walk its prototype chain.
void AdvanceIgnoringProxies()
bool IsAtEnd(WhereToEnd where_to_end=END_AT_NULL) const
Object * GetCurrent() const
static int ModeMask(Mode mode)
static const int kNoPosition
static Representation Double()
static Representation None()
static const int kNotFound
static const Function * FunctionForId(FunctionId id)
static void InitializeIntrinsicFunctionNames(Isolate *isolate, Handle< NameDictionary > dict)
static MUST_USE_RESULT MaybeHandle< Object > HasObjectProperty(Isolate *isolate, Handle< JSReceiver > object, Handle< Object > key)
static MUST_USE_RESULT MaybeHandle< Object > SetObjectProperty(Isolate *isolate, Handle< Object > object, Handle< Object > key, Handle< Object > value, StrictMode strict_mode)
static const Function * FunctionForEntry(Address ref)
static MUST_USE_RESULT MaybeHandle< Object > GetObjectProperty(Isolate *isolate, Handle< Object > object, Handle< Object > key)
static MUST_USE_RESULT MaybeHandle< Object > GetElementOrCharAt(Isolate *isolate, Handle< Object > object, uint32_t index)
static MUST_USE_RESULT MaybeHandle< Object > CreateArrayLiteralBoilerplate(Isolate *isolate, Handle< FixedArray > literals, Handle< FixedArray > elements)
static const Function * FunctionForName(Handle< String > name)
static MUST_USE_RESULT MaybeHandle< Object > DefineObjectProperty(Handle< JSObject > object, Handle< Object > key, Handle< Object > value, PropertyAttributes attr)
static MUST_USE_RESULT MaybeHandle< Object > DeleteObjectProperty(Isolate *isolate, Handle< JSReceiver > object, Handle< Object > key, JSReceiver::DeleteMode mode)
static int ContextSlotIndex(Handle< ScopeInfo > scope_info, Handle< String > name, VariableMode *mode, InitializationFlag *init_flag, MaybeAssignedFlag *maybe_assigned_flag)
static bool CopyContextLocalsToScopeObject(Handle< ScopeInfo > scope_info, Handle< Context > context, Handle< JSObject > scope_object)
static ScopeInfo * Empty(Isolate *isolate)
void RetrieveScopeChain(Scope *scope, Handle< SharedFunctionInfo > shared_info)
MaybeHandle< JSObject > ScopeObject()
int inlined_jsframe_index_
bool SetVariableValue(Handle< String > variable_name, Handle< Object > new_value)
Handle< Context > context_
Handle< ScopeInfo > CurrentScopeInfo()
List< Handle< ScopeInfo > > nested_scope_chain_
ScopeIterator(Isolate *isolate, JavaScriptFrame *frame, int inlined_jsframe_index, bool ignore_nested_scopes=false)
Handle< Context > CurrentContext()
ScopeIterator(Isolate *isolate, Handle< JSFunction > function)
Handle< JSFunction > function_
DISALLOW_IMPLICIT_CONSTRUCTORS(ScopeIterator)
static bool Analyze(CompilationInfo *info)
void GetNestedScopeChain(List< Handle< ScopeInfo > > *chain, int statement_position)
@ COMPILATION_STATE_INITIAL
static Handle< JSObject > GetWrapper(Handle< Script > script)
static MUST_USE_RESULT Handle< SeededNumberDictionary > AtNumberPut(Handle< SeededNumberDictionary > dictionary, uint32_t key, Handle< Object > value)
static bool IsInstance(Handle< JSArray > array)
static const int kMaxValue
static Smi * FromInt(int value)
static bool IsValid(intptr_t value)
StackFrame * frame() const
Object * GetExpression(int index) const
void SetExpression(int index, Object *value)
Vector< const uint8_t > ToOneByteVector()
Vector< const uc16 > ToUC16Vector()
static Handle< String > Flatten(Handle< String > string, PretenureFlag pretenure=NOT_TENURED)
bool Equals(String *other)
static ThreadId Current()
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf map
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in only print modified registers Trace simulator debug messages Implied by trace sim abort randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot A filename with extra code to be included in the A file to write the raw snapshot bytes to(mksnapshot only)") DEFINE_STRING(raw_context_file
enable harmony numeric enable harmony object literal extensions Optimize object size
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in name
enable harmony numeric literals(0o77, 0b11)") DEFINE_BOOL(harmony_object_literals
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long mode(MIPS only)") DEFINE_BOOL(enable_always_align_csp
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in only print modified registers Trace simulator debug messages Implied by trace sim abort randomize hashes to avoid predictable hash Fixed seed to use to hash property keys(0 means random)" "(with snapshots this option cannot override the baked-in seed)") DEFINE_BOOL(profile_deserialization
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction pairs(ARM only)") DEFINE_BOOL(enable_unaligned_accesses
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi space(in MBytes)
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate)
#define ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, dst, call)
#define ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, value)
#define THROW_NEW_ERROR_RETURN_FAILURE(isolate, call)
#define RETURN_FAILURE_ON_EXCEPTION(isolate, call)
#define ASSIGN_RETURN_ON_EXCEPTION(isolate, dst, call, T)
#define RETURN_ON_EXCEPTION(isolate, call, T)
#define THROW_NEW_ERROR(isolate, call, T)
#define LOG(isolate, Call)
#define DCHECK_GE(v1, v2)
#define DCHECK(condition)
#define DCHECK_LT(v1, v2)
#define DCHECK_EQ(v1, v2)
static const size_t kBufferSize
bool Equals(Node *a, Node *b)
Vector< const char > CStrVector(const char *data)
RUNTIME_FUNCTION_RETURN_PAIR(Runtime_ResolvePossiblyDirectEval)
static void UpdateStackLocalsFromMaterializedObject(Isolate *isolate, Handle< JSObject > target, Handle< JSFunction > function, JavaScriptFrame *frame, int inlined_jsframe_index)
static MUST_USE_RESULT MaybeHandle< JSObject > MaterializeStackLocalsWithFrameInspector(Isolate *isolate, Handle< JSObject > target, Handle< JSFunction > function, FrameInspector *frame_inspector)
bool IsFastHoleyElementsKind(ElementsKind kind)
static const int kFrameDetailsAtReturnIndex
static int OwnPrototypeChainLength(JSObject *obj)
T * NewArray(size_t size)
static int DebugReferencedBy(HeapIterator *iterator, JSObject *target, Object *instance_filter, int max_references, FixedArray *instances, int instances_size, JSFunction *arguments_function)
static bool IterateElements(Isolate *isolate, Handle< JSArray > receiver, ArrayConcatVisitor *visitor)
A helper function that visits elements of a JSArray in numerical order.
static const int kScopeDetailsObjectIndex
static const int kFrameDetailsConstructCallIndex
static const int kFrameDetailsSourcePositionIndex
static const int kFrameDetailsFlagsIndex
static MUST_USE_RESULT MaybeHandle< JSObject > MaterializeModuleScope(Isolate *isolate, Handle< Context > context)
@ IMMUTABLE_CHECK_INITIALIZED
@ IMMUTABLE_CHECK_INITIALIZED_HARMONY
@ MUTABLE_CHECK_INITIALIZED
@ IMMUTABLE_IS_INITIALIZED_HARMONY
@ IMMUTABLE_IS_INITIALIZED
static bool SetClosureVariableValue(Isolate *isolate, Handle< Context > context, Handle< String > variable_name, Handle< Object > new_value)
static StackFrame::Id UnwrapFrameId(int wrapped)
static LifetimePosition Min(LifetimePosition a, LifetimePosition b)
bool IsFastSmiOrObjectElementsKind(ElementsKind kind)
static Object * DeclareGlobals(Isolate *isolate, Handle< GlobalObject > global, Handle< String > name, Handle< Object > value, PropertyAttributes attr, bool is_var, bool is_const, bool is_function)
static MUST_USE_RESULT MaybeHandle< Name > ToName(Isolate *isolate, Handle< Object > key)
static const int kFrameDetailsReceiverIndex
static MUST_USE_RESULT MaybeHandle< JSObject > MaterializeLocalContext(Isolate *isolate, Handle< JSObject > target, Handle< JSFunction > function, JavaScriptFrame *frame)
static int DebugConstructedBy(HeapIterator *iterator, JSFunction *constructor, int max_references, FixedArray *instances, int instances_size)
bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind, ElementsKind to_kind)
static ObjectPair LoadLookupSlotHelper(Arguments args, Isolate *isolate, bool throw_error)
static MUST_USE_RESULT MaybeHandle< Object > GetOwnProperty(Isolate *isolate, Handle< JSObject > obj, Handle< Name > name)
static Handle< Map > ComputeObjectLiteralMap(Handle< Context > context, Handle< FixedArray > constant_properties, bool *is_result_from_cache)
static const int kScopeDetailsSize
static void InstallBuiltin(Isolate *isolate, Handle< JSObject > holder, const char *name, Builtins::Name builtin_name)
static MUST_USE_RESULT MaybeHandle< JSObject > MaterializeCatchScope(Isolate *isolate, Handle< Context > context)
static MUST_USE_RESULT MaybeHandle< AllocationSite > GetLiteralAllocationSite(Isolate *isolate, Handle< FixedArray > literals, int literals_index, Handle< FixedArray > elements)
static MaybeHandle< JSObject > CreateArrayLiteralImpl(Isolate *isolate, Handle< FixedArray > literals, int literals_index, Handle< FixedArray > elements, int flags)
static const int kThreadDetailsSize
double DoubleToInteger(double x)
static const int kThreadDetailsThreadIdIndex
ElementsKind GetPackedElementsKind(ElementsKind holey_kind)
static int FindSharedFunctionInfosForScript(HeapIterator *iterator, Script *script, FixedArray *buffer)
static bool SetContextLocalValue(Isolate *isolate, Handle< ScopeInfo > scope_info, Handle< Context > context, Handle< String > variable_name, Handle< Object > new_value)
OStream & endl(OStream &os)
static Handle< Object > Runtime_GetScriptFromScriptName(Handle< String > script_name)
int ToNumber(Register reg)
static MUST_USE_RESULT MaybeHandle< Object > CreateObjectLiteralBoilerplate(Isolate *isolate, Handle< FixedArray > literals, Handle< FixedArray > constant_properties, bool should_have_fast_elements, bool has_function_literal)
static Object * ComputeReceiverForNonGlobal(Isolate *isolate, JSObject *holder)
@ OBJECT_TEMPLATE_INFO_TYPE
@ LAST_NONCALLABLE_SPEC_OBJECT_TYPE
@ FIRST_NONCALLABLE_SPEC_OBJECT_TYPE
@ FUNCTION_TEMPLATE_INFO_TYPE
@ EXTERNAL_UINT16_ELEMENTS
@ EXTERNAL_INT16_ELEMENTS
@ EXTERNAL_UINT8_ELEMENTS
@ EXTERNAL_INT32_ELEMENTS
@ FAST_HOLEY_DOUBLE_ELEMENTS
@ SLOPPY_ARGUMENTS_ELEMENTS
@ EXTERNAL_FLOAT32_ELEMENTS
@ EXTERNAL_FLOAT64_ELEMENTS
@ FAST_HOLEY_SMI_ELEMENTS
@ EXTERNAL_UINT32_ELEMENTS
@ EXTERNAL_UINT8_CLAMPED_ELEMENTS
bool IsFastDoubleElementsKind(ElementsKind kind)
Handle< T > handle(T *t, Isolate *isolate)
static void IterateExternalArrayElements(Isolate *isolate, Handle< JSObject > receiver, bool elements_are_ints, bool elements_are_guaranteed_smis, ArrayConcatVisitor *visitor)
static MUST_USE_RESULT MaybeHandle< Object > CreateLiteralBoilerplate(Isolate *isolate, Handle< FixedArray > literals, Handle< FixedArray > constant_properties)
static Handle< Object > InstantiateAccessorComponent(Isolate *isolate, Handle< Object > component)
bool IsImmutableVariableMode(VariableMode mode)
static Object * HasOwnPropertyImplementation(Isolate *isolate, Handle< JSObject > object, Handle< Name > key)
bool IsFastPackedElementsKind(ElementsKind kind)
static Object * ArrayConstructorCommon(Isolate *isolate, Handle< JSFunction > constructor, Handle< AllocationSite > site, Arguments *caller_args)
static const int kScopeDetailsTypeIndex
ElementsKind GetHoleyElementsKind(ElementsKind packed_kind)
static SaveContext * FindSavedContextForFrame(Isolate *isolate, JavaScriptFrame *frame)
static MUST_USE_RESULT MaybeHandle< Object > TransitionElements(Handle< Object > object, ElementsKind to_kind, Isolate *isolate)
static const int kFrameDetailsFunctionIndex
int32_t NumberToInt32(Object *number)
bool IsFastElementsKind(ElementsKind kind)
static bool IsValidAccessor(Handle< Object > obj)
static bool ContextsHaveSameOrigin(Handle< Context > context1, Handle< Context > context2)
void PrintF(const char *format,...)
static MUST_USE_RESULT MaybeHandle< JSObject > MaterializeBlockScope(Isolate *isolate, Handle< Context > context)
Vector< Handle< Object > > HandleVector(v8::internal::Handle< T > *elms, int length)
int32_t DoubleToInt32(double x)
static Handle< Object > GetCharAt(Handle< String > string, uint32_t index)
static Object * StoreToSuper(Isolate *isolate, Handle< JSObject > home_object, Handle< Object > receiver, Handle< Name > name, Handle< Object > value, StrictMode strict_mode)
static SmartArrayPointer< Handle< Object > > GetCallerArguments(Isolate *isolate, int prefix_argc, int *total_argc)
static void CollectElementIndices(Handle< JSObject > object, uint32_t range, List< uint32_t > *indices)
uint32_t NumberToUint32(Object *number)
kFeedbackVectorOffset flag
static bool ParameterIsShadowedByContextLocal(Handle< ScopeInfo > info, Handle< String > parameter_name)
static Object * ThrowRedeclarationError(Isolate *isolate, Handle< String > name)
static bool IsPositionAlignmentCodeCorrect(int alignment)
static const int kFrameDetailsArgumentCountIndex
STATIC_ASSERT(sizeof(CPURegister)==sizeof(Register))
static bool SetLocalVariableValue(Isolate *isolate, JavaScriptFrame *frame, int inlined_jsframe_index, Handle< String > variable_name, Handle< Object > new_value)
static Object * Runtime_NewObjectHelper(Isolate *isolate, Handle< Object > constructor, Handle< AllocationSite > site)
const char * DoubleToCString(double v, Vector< char > buffer)
PropertyDescriptorIndices
static int FindIndexedNonNativeFrame(JavaScriptFrameIterator *it, int index)
static const int kThreadDetailsCurrentThreadIndex
static uint32_t EstimateElementCount(Handle< JSArray > array)
static Smi * WrapFrameId(StackFrame::Id id)
static bool CheckExecutionState(Isolate *isolate, int break_id)
bool IsFastSmiElementsKind(ElementsKind kind)
static bool SetScopeVariableValue(ScopeIterator *it, int index, Handle< String > variable_name, Handle< Object > new_value)
static MUST_USE_RESULT MaybeHandle< JSObject > MaterializeLocalScope(Isolate *isolate, JavaScriptFrame *frame, int inlined_jsframe_index)
static MaybeHandle< Object > DebugEvaluate(Isolate *isolate, Handle< Context > context, Handle< Object > context_extension, Handle< Object > receiver, Handle< String > source)
static Handle< Object > DebugGetProperty(LookupIterator *it, bool *has_caught=NULL)
static MUST_USE_RESULT MaybeHandle< JSObject > MaterializeClosure(Isolate *isolate, Handle< Context > context)
static Handle< JSObject > NewJSObjectWithNullProto(Isolate *isolate)
bool IsAligned(T value, U alignment)
static const int kFrameDetailsFirstDynamicIndex
static Handle< JSObject > NewStrictArguments(Isolate *isolate, Handle< JSFunction > callee, Object **parameters, int argument_count)
static MUST_USE_RESULT MaybeHandle< JSObject > MaterializeScopeDetails(Isolate *isolate, ScopeIterator *it)
static void PrintTransition(Isolate *isolate, Object *result)
static int compareUInt32(const uint32_t *ap, const uint32_t *bp)
static int StackSize(Isolate *isolate)
static ObjectPair MakePair(Object *x, Object *y)
static Handle< Object > GetPrototypeSkipHiddenPrototypes(Isolate *isolate, Handle< Object > receiver)
@ DONT_INITIALIZE_ARRAY_ELEMENTS
bool IsFastObjectElementsKind(ElementsKind kind)
static MUST_USE_RESULT MaybeHandle< JSObject > MaterializeArgumentsObject(Isolate *isolate, Handle< JSObject > target, Handle< JSFunction > function)
static const int kFrameDetailsFrameIdIndex
static Handle< JSObject > NewSloppyArguments(Isolate *isolate, Handle< JSFunction > callee, Object **parameters, int argument_count)
static const int kFrameDetailsLocalCountIndex
static const Runtime::Function kIntrinsicFunctions[]
MaybeHandle< Object > ArrayConstructInitializeElements(Handle< JSArray > array, Arguments *args)
static bool SetCatchVariableValue(Isolate *isolate, Handle< Context > context, Handle< String > variable_name, Handle< Object > new_value)
@ KEEP_INOBJECT_PROPERTIES
Debugger support for the V8 JavaScript engine.
#define CONVERT_BOOLEAN_ARG_CHECKED(name, index)
#define CONVERT_ARG_CHECKED(Type, name, index)
#define RUNTIME_ASSERT(value)
#define CONVERT_ARG_HANDLE_CHECKED(Type, name, index)
#define CONVERT_NUMBER_CHECKED(type, name, Type, obj)
#define RUNTIME_ASSERT_HANDLIFIED(value, T)
#define CONVERT_DOUBLE_ARG_CHECKED(name, index)
#define CONVERT_NUMBER_ARG_HANDLE_CHECKED(name, index)
#define CONVERT_INT32_ARG_CHECKED(name, index)
#define CONVERT_PROPERTY_DETAILS_CHECKED(name, index)
#define CONVERT_STRICT_MODE_ARG_CHECKED(name, index)
#define CONVERT_SMI_ARG_CHECKED(name, index)
#define TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION(Type, type, TYPE, ctype, size)
#define IO(name, number_of_args, result_size)
#define FIXED_TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION(Type, type, TYPE, ctype, s)
#define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size)
#define RUNTIME_FUNCTION_LIST_RETURN_OBJECT(F)
#define RUNTIME_FUNCTION_LIST_RETURN_PAIR(F)
#define INLINE_OPTIMIZED_FUNCTION_LIST(F)
#define RUNTIME_FUNCTION_LIST(F)
#define INLINE_FUNCTION_LIST(F)
A simple Maybe type, representing an object which may or may not have a value.