Lines Matching refs:isolate

46 #include "isolate-inl.h"
68 if (!(value)) return isolate->ThrowIllegalOperation();
139 MUST_USE_RESULT static MaybeObject* DeepCopyBoilerplate(Isolate* isolate,
141 StackLimitCheck check(isolate);
142 if (check.HasOverflowed()) return isolate->StackOverflow();
144 Heap* heap = isolate->heap();
158 { MaybeObject* maybe_result = DeepCopyBoilerplate(isolate, js_object);
169 { MaybeObject* maybe_result = DeepCopyBoilerplate(isolate, js_object);
195 { MaybeObject* maybe_result = DeepCopyBoilerplate(isolate, js_object);
215 isolate->counters()->cow_arrays_created_runtime()->Increment();
229 { MaybeObject* maybe_result = DeepCopyBoilerplate(isolate,
248 { MaybeObject* maybe_result = DeepCopyBoilerplate(isolate,
282 Isolate* isolate = context->GetIsolate();
309 isolate->factory()->NewFixedArray(number_of_symbol_keys);
321 return isolate->factory()->ObjectLiteralMapFromCache(context, keys);
324 return isolate->factory()->CopyMap(
331 Isolate* isolate,
337 Isolate* isolate,
362 Handle<JSObject> boilerplate = isolate->factory()->NewJSObjectFromMap(map);
380 Handle<Object> key(constant_properties->get(index+0), isolate);
381 Handle<Object> value(constant_properties->get(index+1), isolate);
386 value = CreateLiteralBoilerplate(isolate, literals, array);
414 isolate->factory()->NewStringFromAscii(CStrVector(str));
440 Isolate* isolate) {
441 HandleScope scope(isolate);
442 if (!object->IsJSObject()) return isolate->ThrowIllegalOperation();
448 if (result.is_null()) return isolate->ThrowIllegalOperation();
451 return isolate->ThrowIllegalOperation();
459 Isolate* isolate,
466 Handle<JSArray>::cast(isolate->factory()->NewJSObject(constructor));
473 Context* global_context = isolate->context()->global_context();
485 copied_elements_values = isolate->factory()->CopyFixedDoubleArray(
492 isolate->heap()->fixed_cow_array_map());
506 isolate->factory()->CopyFixedArray(fixed_array_values);
515 CreateLiteralBoilerplate(isolate, literals, fa);
530 CHECK(!TransitionElements(object, FAST_ELEMENTS, isolate)->IsFailure());
539 Isolate* isolate,
546 return CreateObjectLiteralBoilerplate(isolate,
552 return CreateObjectLiteralBoilerplate(isolate,
559 isolate, literals, elements);
568 HandleScope scope(isolate);
578 Handle<Object> boilerplate(literals->get(literals_index), isolate);
579 if (*boilerplate == isolate->heap()->undefined_value()) {
580 boilerplate = CreateObjectLiteralBoilerplate(isolate,
589 return DeepCopyBoilerplate(isolate, JSObject::cast(*boilerplate));
594 HandleScope scope(isolate);
604 Handle<Object> boilerplate(literals->get(literals_index), isolate);
605 if (*boilerplate == isolate->heap()->undefined_value()) {
606 boilerplate = CreateObjectLiteralBoilerplate(isolate,
615 return isolate->heap()->CopyJSObject(JSObject::cast(*boilerplate));
620 HandleScope scope(isolate);
627 Handle<Object> boilerplate(literals->get(literals_index), isolate);
628 if (*boilerplate == isolate->heap()->undefined_value()) {
630 Runtime::CreateArrayLiteralBoilerplate(isolate, literals, elements);
635 return DeepCopyBoilerplate(isolate, JSObject::cast(*boilerplate));
640 HandleScope scope(isolate);
647 Handle<Object> boilerplate(literals->get(literals_index), isolate);
648 if (*boilerplate == isolate->heap()->undefined_value()) {
649 ASSERT(*elements != isolate->heap()->empty_fixed_array());
651 Runtime::CreateArrayLiteralBoilerplate(isolate, literals, elements);
657 isolate->heap()->fixed_cow_array_map()) {
658 isolate->counters()->cow_arrays_created_runtime()->Increment();
660 return isolate->heap()->CopyJSObject(JSObject::cast(*boilerplate));
669 prototype->IsJSReceiver() ? prototype : isolate->heap()->null_value();
670 return isolate->heap()->AllocateJSProxy(handler, used_prototype);
681 prototype->IsJSReceiver() ? prototype : isolate->heap()->null_value();
682 return isolate->heap()->AllocateJSFunctionProxy(
690 return isolate->heap()->ToBoolean(obj->IsJSProxy());
697 return isolate->heap()->ToBoolean(obj->IsJSFunctionProxy());
726 return isolate->heap()->undefined_value();
731 HandleScope scope(isolate);
734 Handle<ObjectHashSet> table = isolate->factory()->NewObjectHashSet(0);
741 HandleScope scope(isolate);
748 return isolate->heap()->undefined_symbol();
753 HandleScope scope(isolate);
758 return isolate->heap()->ToBoolean(table->Contains(*key));
763 HandleScope scope(isolate);
770 return isolate->heap()->undefined_symbol();
775 HandleScope scope(isolate);
778 Handle<ObjectHashTable> table = isolate->factory()->NewObjectHashTable(0);
785 HandleScope scope(isolate);
794 HandleScope scope(isolate);
807 HandleScope scope(isolate);
811 Handle<ObjectHashTable> table = isolate->factory()->NewObjectHashTable(0);
828 HandleScope scope(isolate);
844 if (!obj->IsJSObject()) return isolate->heap()->null_value();
858 !isolate->MayNamedAccess(JSObject::cast(obj),
859 isolate->heap()->Proto_symbol(),
861 isolate->ReportFailedAccessCheck(JSObject::cast(obj), v8::ACCESS_GET);
862 return isolate->heap()->undefined_value();
879 if (prototype->IsNull()) return isolate->heap()->false_value();
880 if (O == prototype) return isolate->heap()->true_value();
929 Isolate* isolate = obj->GetIsolate();
932 !isolate->MayNamedAccess(current, name, access_type)) {
969 isolate->ReportFailedAccessCheck(current, access_type);
1000 static MaybeObject* GetOwnProperty(Isolate* isolate,
1003 Heap* heap = isolate->heap();
1004 Handle<FixedArray> elms = isolate->factory()->NewFixedArray(DESCRIPTOR_SIZE);
1005 Handle<JSArray> desc = isolate->factory()->NewJSArrayWithElements(elms);
1006 LookupResult result(isolate);
1035 RETURN_IF_EMPTY_HANDLE(isolate, value);
1149 HandleScope scope(isolate);
1152 return GetOwnProperty(isolate, obj, name);
1168 if (proto->IsNull()) return isolate->heap()->false_value();
1172 return isolate->heap()->ToBoolean(obj->map()->is_extensible());
1177 HandleScope scope(isolate);
1189 HandleScope scope(isolate);
1192 return *isolate->factory()->CreateApiFunction(data);
1200 return isolate->heap()->ToBoolean(result);
1237 return isolate->heap()->ToBoolean(needs_access_checks);
1255 return isolate->heap()->undefined_value();
1259 static Failure* ThrowRedeclarationError(Isolate* isolate,
1262 HandleScope scope(isolate);
1264 isolate->factory()->NewStringFromAscii(CStrVector(type));
1267 isolate->factory()->NewTypeError("redeclaration", HandleVector(args, 2));
1268 return isolate->Throw(*error);
1274 HandleScope scope(isolate);
1276 isolate->context()->global());
1285 HandleScope scope(isolate);
1287 Handle<Object> value(pairs->get(i + 1), isolate);
1297 LookupResult lookup(isolate);
1318 isolate->factory()->NewFunctionFromSharedFunctionInfo(shared,
1324 LookupResult lookup(isolate);
1355 return isolate->Throw(*isolate->factory()->NewTypeError(
1366 isolate,
1371 isolate,
1379 ASSERT(!isolate->has_pending_exception());
1380 return isolate->heap()->undefined_value();
1385 HandleScope scope(isolate);
1397 Handle<Object> initial_value(args[3], isolate);
1412 return ThrowRedeclarationError(isolate, type, name);
1428 isolate,
1444 object = isolate->factory()->NewJSObject(
1445 isolate->context_extension_function());
1454 Handle<Object> value(isolate->heap()->undefined_value(), isolate);
1464 LookupResult lookup(isolate);
1467 return ThrowRedeclarationError(isolate, "const", name);
1471 isolate,
1475 return isolate->heap()->undefined_value();
1491 GlobalObject* global = isolate->context()->global();
1509 LookupResult lookup(isolate);
1515 HandleScope handle_scope(isolate);
1526 return isolate->heap()->undefined_value();
1534 global = isolate->context()->global();
1538 return isolate->heap()->undefined_value();
1551 GlobalObject* global = isolate->context()->global();
1563 LookupResult lookup(isolate);
1574 HandleScope handle_scope(isolate);
1575 Handle<GlobalObject> global(isolate->context()->global());
1582 isolate,
1616 HandleScope scope(isolate);
1619 Handle<Object> value(args[0], isolate);
1650 isolate->context()->global());
1653 isolate,
1678 LookupResult lookup(isolate);
1705 isolate,
1717 HandleScope scope(isolate);
1729 HandleScope scope(isolate);
1740 isolate->counters()->regexp_entry_runtime()->Increment();
1756 return isolate->ThrowIllegalOperation();
1760 isolate->heap()->AllocateFixedArrayWithHoles(elements_count);
1764 { MaybeObject* maybe_new_object = isolate->heap()->AllocateRaw(
1770 HandleScope scope(isolate);
1772 set_map(isolate->global_context()->regexp_result_map());
1775 array->set_properties(isolate->heap()->empty_fixed_array());
1792 if (!global->IsTrue()) global = isolate->heap()->false_value();
1795 if (!ignoreCase->IsTrue()) ignoreCase = isolate->heap()->false_value();
1798 if (!multiline->IsTrue()) multiline = isolate->heap()->false_value();
1825 Heap* heap = isolate->heap();
1855 HandleScope scope(isolate);
1860 prototype->set_elements(isolate->heap()->empty_fixed_array());
1865 static Handle<JSFunction> InstallBuiltin(Isolate* isolate,
1869 Handle<String> key = isolate->factory()->LookupAsciiSymbol(name);
1870 Handle<Code> code(isolate->builtins()->builtin(builtin_name));
1872 isolate->factory()->NewFunction(key,
1884 HandleScope scope(isolate);
1888 InstallBuiltin(isolate, holder, "pop", Builtins::kArrayPop);
1889 InstallBuiltin(isolate, holder, "push", Builtins::kArrayPush);
1890 InstallBuiltin(isolate, holder, "shift", Builtins::kArrayShift);
1891 InstallBuiltin(isolate, holder, "unshift", Builtins::kArrayUnshift);
1892 InstallBuiltin(isolate, holder, "slice", Builtins::kArraySlice);
1893 InstallBuiltin(isolate, holder, "splice", Builtins::kArraySplice);
1894 InstallBuiltin(isolate, holder, "concat", Builtins::kArrayConcat);
1905 HandleScope scope(isolate);
1916 return isolate->heap()->undefined_value();
1928 HandleScope scope(isolate);
1949 ASSERT(isolate->has_pending_exception());
1973 return isolate->heap()->undefined_value();
1981 return isolate->heap()->ToBoolean(
1991 return isolate->heap()->undefined_value();
2003 return isolate->heap()->undefined_value();
2008 HandleScope scope(isolate);
2012 Handle<Object> script = Handle<Object>(fun->shared()->script(), isolate);
2013 if (!script->IsScript()) return isolate->heap()->undefined_value();
2020 HandleScope scope(isolate);
2059 return isolate->heap()->undefined_value();
2070 return isolate->heap()->undefined_value();
2095 isolate->heap()->AllocateStringFromAscii(CStrVector("prototype"));
2149 return isolate->heap()->ToBoolean(f->shared()->IsApiFunction());
2158 return isolate->heap()->ToBoolean(f->IsBuiltin());
2163 HandleScope scope(isolate);
2194 target->shared()->set_script(isolate->heap()->undefined_value());
2205 isolate->factory()->NewFixedArray(number_of_literals, TENURED);
2214 target->set_next_function_link(isolate->heap()->undefined_value());
2216 if (isolate->logger()->is_logging() || CpuProfiler::is_profiling(isolate)) {
2217 isolate->logger()->LogExistingFunction(
2228 HandleScope scope(isolate);
2234 return isolate->heap()->undefined_value();
2238 MUST_USE_RESULT static MaybeObject* CharFromCode(Isolate* isolate,
2243 return isolate->heap()->LookupSingleCharacterStringFromCode(code);
2246 return isolate->heap()->empty_string();
2261 if (value < 0) return isolate->heap()->nan_value();
2279 return isolate->heap()->nan_value();
2289 return CharFromCode(isolate, args[0]);
2295 explicit FixedArrayBuilder(Isolate* isolate, int initial_capacity)
2296 : array_(isolate->factory()->NewFixedArrayWithHoles(initial_capacity)),
2404 array_builder_(heap->isolate(), estimated_part_count),
2456 return heap_->isolate()->factory()->empty_string();
2497 return heap_->isolate()->factory()->NewRawAsciiString(length);
2502 return heap_->isolate()->factory()->NewRawTwoByteString(length);
2732 Isolate* isolate = replacement->GetIsolate();
2741 isolate->factory()->NewSubString(replacement, from, to));
2814 void FindStringIndices(Isolate* isolate,
2824 StringSearch<PatternChar, SubjectChar> search(isolate, pattern);
2835 void FindStringIndicesDispatch(Isolate* isolate,
2856 FindStringIndices(isolate,
2863 FindStringIndices(isolate,
2872 FindStringIndices(isolate,
2878 FindStringIndices(isolate,
2891 Isolate* isolate,
2898 ZoneScope zone_space(isolate, DELETE_ON_EXIT);
2907 FindStringIndicesDispatch(isolate, *subject, pattern, &indices, 0xffffffff);
2919 isolate->factory()->NewRawAsciiString(result_len));
2922 isolate->factory()->NewRawTwoByteString(result_len));
2958 Isolate* isolate,
2966 HandleScope handles(isolate);
2987 ZoneScope zone(isolate, DELETE_ON_EXIT);
3002 isolate, subject_handle, regexp_handle, replacement_handle);
3005 isolate, subject_handle, regexp_handle, replacement_handle);
3014 ReplacementStringBuilder builder(isolate->heap(),
3032 HandleScope loop_scope(isolate);
3084 Isolate* isolate,
3090 HandleScope handles(isolate);
3101 isolate, subject_handle, regexp_handle, empty_string_handle);
3104 isolate, subject_handle, regexp_handle, empty_string_handle);
3131 return isolate->heap()->empty_string();
3136 isolate->factory()->NewRawAsciiString(new_length));
3139 isolate->factory()->NewRawTwoByteString(new_length));
3187 HandleScope loop_scope(isolate);
3207 return isolate->heap()->empty_string();
3219 isolate->heap()->CreateFillerObjectAt(end_of_string, delta);
3261 isolate, subject, regexp, last_match_info);
3264 isolate, subject, regexp, last_match_info);
3268 return StringReplaceRegExpWithString(isolate,
3276 Handle<String> Runtime::StringReplaceOneCharWithString(Isolate* isolate,
3288 StringReplaceOneCharWithString(isolate,
3294 if (*found) return isolate->factory()->NewConsString(new_first, second);
3298 StringReplaceOneCharWithString(isolate,
3304 if (*found) return isolate->factory()->NewConsString(first, new_second);
3309 int index = StringMatch(isolate, subject, search, 0);
3312 Handle<String> first = isolate->factory()->NewSubString(subject, 0, index);
3313 Handle<String> cons1 = isolate->factory()->NewConsString(first, replace);
3315 isolate->factory()->NewSubString(subject, index + 1, subject->length());
3316 return isolate->factory()->NewConsString(cons1, second);
3323 HandleScope scope(isolate);
3333 Runtime::StringReplaceOneCharWithString(isolate,
3340 return *Runtime::StringReplaceOneCharWithString(isolate,
3352 int Runtime::StringMatch(Isolate* isolate,
3377 return SearchString(isolate,
3382 return SearchString(isolate,
3389 return SearchString(isolate,
3394 return SearchString(isolate,
3402 HandleScope scope(isolate); // create a new handle scope
3414 Runtime::StringMatch(isolate, sub, pat, start_index);
3454 HandleScope scope(isolate); // create a new handle scope
3543 *isolate->runtime_state()->string_locale_compare_buf1();
3545 *isolate->runtime_state()->string_locale_compare_buf2();
3582 isolate->counters()->sub_string_runtime()->Increment();
3601 return isolate->heap()->null_value();
3605 ZoneScope zone_space(isolate, DELETE_ON_EXIT);
3625 Handle<FixedArray> elements = isolate->factory()->NewFixedArray(matches);
3626 Handle<String> substring = isolate->factory()->
3632 Handle<String> substring = isolate->factory()->
3636 Handle<JSArray> result = isolate->factory()->NewJSArrayWithElements(elements);
3663 static bool SearchStringMultiple(Isolate* isolate,
3673 StringSearch<PatternChar, SubjectChar> search(isolate, pattern);
3706 static bool SearchStringMultiple(Isolate* isolate,
3725 if (SearchStringMultiple(isolate,
3732 if (SearchStringMultiple(isolate,
3742 if (SearchStringMultiple(isolate,
3749 if (SearchStringMultiple(isolate,
3771 Isolate* isolate,
3783 OffsetsVector registers(required_registers, isolate);
3803 HandleScope loop_scope(isolate);
3805 builder->Add(*isolate->factory()->NewProperSubString(subject,
3809 builder->Add(*isolate->factory()->NewSubString(subject,
3846 Isolate* isolate,
3856 OffsetsVector registers(required_registers, isolate);
3875 OffsetsVector registers2(required_registers, isolate);
3890 HandleScope temp_scope(isolate);
3894 isolate->factory()->NewFixedArray(3 + capture_count);
3897 match = isolate->factory()->NewProperSubString(subject,
3901 match = isolate->factory()->NewSubString(subject,
3913 substring = isolate->factory()->NewProperSubString(subject,
3917 substring = isolate->factory()->NewSubString(subject, start, end);
3922 elements->set(i, isolate->heap()->undefined_value());
3927 builder->Add(*isolate->factory()->NewJSArrayWithElements(elements));
3981 HandleScope handles(isolate);
3997 result_elements = isolate->factory()->NewFixedArrayWithHoles(16);
4005 if (SearchStringMultiple(isolate, subject, pattern,
4009 return isolate->heap()->null_value();
4016 result = SearchRegExpNoCaptureMultiple(isolate,
4022 result = SearchRegExpMultiple(isolate,
4029 if (result == RegExpImpl::RE_FAILURE) return isolate->heap()->null_value();
4047 return isolate->heap()->
4055 return *isolate->factory()->nan_symbol();
4059 return *isolate->factory()->minus_infinity_symbol();
4061 return *isolate->factory()->infinity_symbol();
4065 isolate->heap()->AllocateStringFromAscii(CStrVector(str));
4077 return *isolate->factory()->nan_symbol();
4081 return *isolate->factory()->minus_infinity_symbol();
4083 return *isolate->factory()->infinity_symbol();
4090 isolate->heap()->AllocateStringFromAscii(CStrVector(str));
4102 return *isolate->factory()->nan_symbol();
4106 return *isolate->factory()->minus_infinity_symbol();
4108 return *isolate->factory()->infinity_symbol();
4115 isolate->heap()->AllocateStringFromAscii(CStrVector(str));
4127 return *isolate->factory()->nan_symbol();
4131 return *isolate->factory()->minus_infinity_symbol();
4133 return *isolate->factory()->infinity_symbol();
4140 isolate->heap()->AllocateStringFromAscii(CStrVector(str));
4158 MaybeObject* Runtime::GetElementOrCharAt(Isolate* isolate,
4183 MaybeObject* Runtime::GetObjectProperty(Isolate* isolate,
4186 HandleScope scope(isolate);
4191 isolate->factory()->NewTypeError("non_object_property_load",
4193 return isolate->Throw(*error);
4199 return GetElementOrCharAt(isolate, object, index);
4217 return GetElementOrCharAt(isolate, object, index);
4231 return Runtime::GetObjectProperty(isolate, object, key);
4260 KeyedLookupCache* keyed_lookup_cache = isolate->keyed_lookup_cache();
4265 ? isolate->heap()->undefined_value()
4270 LookupResult result(isolate);
4305 isolate);
4312 HandleScope scope(isolate);
4322 return Runtime::GetObjectProperty(isolate,
4341 HandleScope scope(isolate);
4356 return isolate->heap()->undefined_value();
4367 HandleScope scope(isolate);
4375 LookupResult result(isolate);
4385 return isolate->heap()->undefined_value();
4422 return Runtime::ForceSetObjectProperty(isolate,
4430 MaybeObject* Runtime::SetObjectProperty(Isolate* isolate,
4437 HandleScope scope(isolate);
4442 isolate->factory()->NewTypeError("non_object_property_store",
4444 return isolate->Throw(*error);
4510 MaybeObject* Runtime::ForceSetObjectProperty(Isolate* isolate,
4515 HandleScope scope(isolate);
4563 MaybeObject* Runtime::ForceDeleteObjectProperty(Isolate* isolate,
4566 HandleScope scope(isolate);
4578 return isolate->heap()->true_value();
4620 return Runtime::SetObjectProperty(isolate,
4633 return TransitionElements(object, FAST_DOUBLE_ELEMENTS, isolate);
4641 return TransitionElements(object, FAST_ELEMENTS, isolate);
4658 return isolate->heap()->undefined_value();
4737 static Object* HasLocalPropertyImplementation(Isolate* isolate,
4740 if (object->HasLocalProperty(*key)) return isolate->heap()->true_value();
4747 return HasLocalPropertyImplementation(isolate,
4751 return isolate->heap()->false_value();
4770 if (object->HasRealNamedProperty(key)) return isolate->heap()->true_value();
4775 return isolate->heap()->false_value();
4778 HandleScope scope(isolate);
4779 return HasLocalPropertyImplementation(isolate,
4786 return isolate->heap()->true_value();
4789 return isolate->heap()->false_value();
4800 if (isolate->has_pending_exception()) return Failure::Exception();
4801 return isolate->heap()->ToBoolean(result);
4812 if (isolate->has_pending_exception()) return Failure::Exception();
4813 return isolate->heap()->ToBoolean(result);
4830 return isolate->heap()->false_value();
4833 return isolate->heap()->true_value();
4838 return isolate->heap()->false_value();
4846 isolate->heap()->non_strict_arguments_elements_map()) {
4854 return isolate->heap()->ToBoolean(!details.IsDontEnum());
4860 return isolate->heap()->ToBoolean(att != ABSENT && (att & DONT_ENUM) == 0);
4865 HandleScope scope(isolate);
4887 HandleScope scope(isolate);
4919 HandleScope scope(isolate);
4922 return isolate->heap()->undefined_value();
4931 !isolate->MayNamedAccess(*obj,
4932 isolate->heap()->undefined_value(),
4934 isolate->ReportFailedAccessCheck(*obj, v8::ACCESS_KEYS);
4935 return *isolate->factory()->NewJSArray(0);
4950 !isolate->MayNamedAccess(*jsproto,
4951 isolate->heap()->undefined_value(),
4953 isolate->ReportFailedAccessCheck(*jsproto, v8::ACCESS_KEYS);
4954 return *isolate->factory()->NewJSArray(0);
4967 isolate->factory()->NewFixedArray(total_property_count);
4987 names = isolate->factory()->NewFixedArray(
4992 if (name == isolate->heap()->hidden_symbol()) {
4999 return *isolate->factory()->NewJSArrayWithElements(names);
5006 HandleScope scope(isolate);
5009 return isolate->heap()->undefined_value();
5014 Handle<FixedArray> names = isolate->factory()->NewFixedArray(n);
5016 return *isolate->factory()->NewJSArrayWithElements(names);
5023 HandleScope scope(isolate);
5041 HandleScope scope(isolate);
5049 return isolate->heap()->undefined_value();
5056 HandleScope scope(isolate);
5064 return isolate->heap()->undefined_value();
5071 HandleScope scope(isolate);
5077 !isolate->MayNamedAccess(*object, isolate->heap()->undefined_value(),
5079 isolate->ReportFailedAccessCheck(*object, v8::ACCESS_KEYS);
5080 return *isolate->factory()->NewJSArray(0);
5085 if (proto->IsNull()) return *isolate->factory()->NewJSArray(0);
5098 Handle<FixedArray> copy = isolate->factory()->NewFixedArray(length);
5105 HandleScope scope(isolate);
5106 Handle<Object> entry_handle(entry, isolate);
5108 isolate->factory()->NumberToString(entry_handle);
5112 return *isolate->factory()->NewJSArrayWithElements(copy);
5121 JavaScriptFrameIterator it(isolate);
5136 HandleScope scope(isolate);
5148 return isolate->initial_object_prototype()->GetElement(index);
5153 if (key->Equals(isolate->heap()->length_symbol())) return Smi::FromInt(n);
5154 if (key->Equals(isolate->heap()->callee_symbol())) {
5158 return isolate->Throw(*isolate->factory()->NewTypeError(
5165 return isolate->initial_object_prototype()->GetProperty(*key);
5201 if (obj->IsNumber()) return isolate->heap()->number_symbol();
5206 return isolate->heap()->undefined_symbol();
5211 return isolate->heap()->string_symbol();
5217 return isolate->heap()->boolean_symbol();
5221 ? isolate->heap()->null_symbol()
5222 : isolate->heap()->object_symbol();
5225 return isolate->heap()->undefined_symbol();
5228 return isolate->heap()->function_symbol();
5232 return isolate->heap()->object_symbol();
5275 return isolate->heap()->nan_value();
5282 return isolate->heap()->nan_value();
5289 if (d == 0) return isolate->heap()->minus_zero_value();
5309 return isolate->heap()->NumberFromDouble(
5310 StringToDouble(isolate->unicode_cache(), subject, ALLOW_HEX));
5337 maybe_object = isolate->heap()->AllocateRawAsciiString(length);
5339 maybe_object = isolate->heap()->AllocateRawTwoByteString(length);
5406 isolate->runtime_state()->string_input_buffer());
5420 isolate->context()->mark_out_of_memory();
5431 isolate->heap()->AllocateRawAsciiString(escaped_length);
5438 isolate->runtime_state()->string_input_buffer());
5539 isolate->heap()->AllocateRawAsciiString(unescaped_length) :
5540 isolate->heap()->AllocateRawTwoByteString(unescaped_length);
5627 MaybeObject* AllocateRawString(Isolate* isolate, int length);
5631 MaybeObject* AllocateRawString<SeqTwoByteString>(Isolate* isolate, int length) {
5632 return isolate->heap()->AllocateRawTwoByteString(length);
5637 MaybeObject* AllocateRawString<SeqAsciiString>(Isolate* isolate, int length) {
5638 return isolate->heap()->AllocateRawAsciiString(length);
5643 static MaybeObject* SlowQuoteJsonString(Isolate* isolate,
5658 MaybeObject* new_alloc = AllocateRawString<StringType>(isolate,
5692 Isolate* isolate,
5729 static MaybeObject* QuoteJsonString(Isolate* isolate,
5732 isolate->counters()->quote_json_char_count()->Increment(length);
5736 return SlowQuoteJsonString<Char, StringType, comma>(isolate, characters);
5739 MaybeObject* new_alloc = AllocateRawString<StringType>(isolate,
5745 if (!isolate->heap()->new_space()->Contains(new_object)) {
5750 return SlowQuoteJsonString<Char, StringType, comma>(isolate, characters);
5753 ASSERT(isolate->heap()->new_space()->Contains(new_string));
5758 write_cursor = WriteQuoteJsonString<Char, Char>(isolate,
5764 isolate->heap()->new_space()->
5786 return QuoteJsonString<uc16, SeqTwoByteString, false>(isolate,
5789 return QuoteJsonString<char, SeqAsciiString, false>(isolate,
5809 return QuoteJsonString<uc16, SeqTwoByteString, true>(isolate,
5812 return QuoteJsonString<char, SeqAsciiString, true>(isolate,
5819 static MaybeObject* QuoteJsonStringArray(Isolate* isolate,
5824 MaybeObject* new_alloc = AllocateRawString<StringType>(isolate,
5830 if (!isolate->heap()->new_space()->Contains(new_object)) {
5835 return isolate->heap()->undefined_value();
5839 ASSERT(isolate->heap()->new_space()->Contains(new_string));
5850 write_cursor = WriteQuoteJsonString<Char, uc16>(isolate,
5854 write_cursor = WriteQuoteJsonString<Char, char>(isolate,
5864 isolate->heap()->new_space()->
5876 if (!array->HasFastElements()) return isolate->heap()->undefined_value();
5884 if (!elt->IsString()) return isolate->heap()->undefined_value();
5886 if (!element->IsFlat()) return isolate->heap()->undefined_value();
5898 return isolate->heap()->undefined_value();
5902 return QuoteJsonStringArray<char, SeqAsciiString>(isolate,
5906 return QuoteJsonStringArray<uc16, SeqTwoByteString>(isolate,
5922 double value = StringToInt(isolate->unicode_cache(), s, radix);
5923 return isolate->heap()->NumberFromDouble(value);
5932 double value = StringToDouble(isolate->unicode_cache(),
5936 return isolate->heap()->NumberFromDouble(value);
5942 Isolate* isolate,
5960 ? isolate->heap()->AllocateRawAsciiString(length)
5961 : isolate->heap()->AllocateRawTwoByteString(length);
5970 isolate->runtime_state()->string_input_buffer());
6017 isolate->context()->mark_out_of_memory();
6175 Isolate* isolate,
6193 { MaybeObject* maybe_o = isolate->heap()->AllocateRawAsciiString(length);
6204 ConvertCaseHelper(isolate, s, length, length, mapping);
6210 ConvertCaseHelper(isolate,
6221 args, isolate, isolate->runtime_state()->to_lower_mapping());
6227 args, isolate, isolate->runtime_state()->to_upper_mapping());
6266 HandleScope handle_scope(isolate);
6277 isolate->heap()->string_split_cache(),
6282 isolate->factory()->NewJSArrayWithElements(
6296 ZoneScope scope(isolate, DELETE_ON_EXIT);
6303 FindStringIndicesDispatch(isolate, *subject, *pattern, &indices, limit);
6314 Handle<JSArray> result = isolate->factory()->NewJSArray(part_count);
6332 isolate->factory()->NewProperSubString(subject, part_start, part_end);
6339 StringSplitCache::Enter(isolate->heap(),
6340 isolate->heap()->string_split_cache(),
6387 HandleScope scope(isolate);
6401 isolate->heap()->AllocateUninitializedFixedArray(length);
6404 elements = Handle<FixedArray>(FixedArray::cast(obj), isolate);
6410 position = CopyCachedAsciiCharsToArray(isolate->heap(),
6416 isolate->heap()->undefined_value(),
6420 elements = isolate->factory()->NewFixedArray(length);
6433 return *isolate->factory()->NewJSArrayWithElements(elements);
6459 return isolate->heap()->NumberToString(number);
6470 return isolate->heap()->NumberToString(number, false);
6484 return isolate->heap()->NumberFromDouble(DoubleToInteger(number));
6503 return isolate->heap()->NumberFromDouble(double_value);
6512 return isolate->heap()->NumberFromUint32(number);
6526 return isolate->heap()->NumberFromInt32(DoubleToInt32(number));
6547 return isolate->heap()->nan_value();
6554 return isolate->heap()->AllocateHeapNumber(0);
6564 return isolate->heap()->NumberFromDouble(x + y);
6574 return isolate->heap()->NumberFromDouble(x - y);
6584 return isolate->heap()->NumberFromDouble(x * y);
6593 return isolate->heap()->NumberFromDouble(-x);
6601 return isolate->heap()->NumberFromDouble(9876543210.0);
6611 return isolate->heap()->NumberFromDouble(x / y);
6624 return isolate->heap()->NumberFromDouble(x);
6633 isolate->counters()->string_add_runtime()->Increment();
6634 return isolate->heap()->AllocateConsString(str1, str2);
6682 isolate->context()->mark_out_of_memory();
6696 return isolate->Throw(isolate->heap()->illegal_argument_symbol());
6704 return isolate->heap()->empty_string();
6730 return isolate->Throw(isolate->heap()->illegal_argument_symbol());
6734 return isolate->Throw(isolate->heap()->illegal_argument_symbol());
6738 return isolate->Throw(isolate->heap()->illegal_argument_symbol());
6744 return isolate->Throw(isolate->heap()->illegal_argument_symbol());
6756 return isolate->Throw(isolate->heap()->illegal_argument_symbol());
6759 isolate->context()->mark_out_of_memory();
6770 isolate->heap()->AllocateRawAsciiString(length);
6781 isolate->heap()->AllocateRawTwoByteString(length);
6799 isolate->context()->mark_out_of_memory();
6806 return isolate->Throw(isolate->heap()->illegal_argument_symbol());
6814 return isolate->heap()->empty_string();
6824 isolate->context()->mark_out_of_memory();
6832 return isolate->Throw(isolate->heap()->illegal_argument_symbol());
6837 isolate->context()->mark_out_of_memory();
6845 isolate->heap()->AllocateRawTwoByteString(length);
6986 isolate->heap()->AllocateRawAsciiString(string_length);
6999 isolate->heap()->AllocateRawTwoByteString(string_length);
7020 return isolate->heap()->NumberFromInt32(x | y);
7030 return isolate->heap()->NumberFromInt32(x & y);
7040 return isolate->heap()->NumberFromInt32(x ^ y);
7049 return isolate->heap()->NumberFromInt32(~x);
7059 return isolate->heap()->NumberFromInt32(x << (y & 0x1f));
7069 return isolate->heap()->NumberFromUint32(x >> (y & 0x1f));
7079 return isolate->heap()->NumberFromInt32(ArithmeticShiftRight(x, y & 0x1f));
7282 isolate->counters()->string_compare_runtime()->Increment();
7298 { MaybeObject* maybe_obj = isolate->heap()->PrepareForCompare(x);
7301 { MaybeObject* maybe_obj = isolate->heap()->PrepareForCompare(y);
7306 : StringInputBufferCompare(isolate->runtime_state(), x, y);
7313 isolate->counters()->math_acos()->Increment();
7316 return isolate->transcendental_cache()->Get(TranscendentalCache::ACOS, x);
7323 isolate->counters()->math_asin()->Increment();
7326 return isolate->transcendental_cache()->Get(TranscendentalCache::ASIN, x);
7333 isolate->counters()->math_atan()->Increment();
7336 return isolate->transcendental_cache()->Get(TranscendentalCache::ATAN, x);
7346 isolate->counters()->math_atan2()->Increment();
7362 return isolate->heap()->AllocateHeapNumber(result);
7369 isolate->counters()->math_ceil()->Increment();
7372 return isolate->heap()->NumberFromDouble(ceiling(x));
7379 isolate->counters()->math_cos()->Increment();
7382 return isolate->transcendental_cache()->Get(TranscendentalCache::COS, x);
7389 isolate->counters()->math_exp()->Increment();
7392 return isolate->transcendental_cache()->Get(TranscendentalCache::EXP, x);
7399 isolate->counters()->math_floor()->Increment();
7402 return isolate->heap()->NumberFromDouble(floor(x));
7409 isolate->counters()->math_log()->Increment();
7412 return isolate->transcendental_cache()->Get(TranscendentalCache::LOG, x);
7420 isolate->counters()->math_pow()->Increment();
7428 return isolate->heap()->NumberFromDouble(power_double_int(x, y));
7445 if (isnan(result)) return isolate->heap()->nan_value();
7446 return isolate->heap()->AllocateHeapNumber(result);
7454 isolate->counters()->math_pow()->Increment();
7462 if (isnan(result)) return isolate->heap()->nan_value();
7463 return isolate->heap()->AllocateHeapNumber(result);
7471 isolate->counters()->math_round()->Increment();
7487 if (sign) return isolate->heap()->minus_zero_value();
7504 if (sign && value >= -0.5) return isolate->heap()->minus_zero_value();
7507 return isolate->heap()->AllocateHeapNumber(floor(value + 0.5));
7514 isolate->counters()->math_sin()->Increment();
7517 return isolate->transcendental_cache()->Get(TranscendentalCache::SIN, x);
7524 isolate->counters()->math_sqrt()->Increment();
7527 return isolate->heap()->AllocateHeapNumber(fast_sqrt(x));
7534 isolate->counters()->math_tan()->Increment();
7537 return isolate->transcendental_cache()->Get(TranscendentalCache::TAN, x);
7548 return Smi::FromInt(isolate->date_cache()->DaysFromYearMonth(year, month));
7553 HandleScope scope(isolate);
7560 DateCache* date_cache = isolate->date_cache();
7565 value = isolate->heap()->nan_value();
7570 value = isolate->heap()->nan_value();
7576 value = isolate->heap()->nan_value();
7580 isolate->heap()->AllocateHeapNumber(DoubleToInteger(time));
7590 HandleScope scope(isolate);
7598 isolate->factory()->NewArgumentsObject(callee, argument_count);
7605 isolate->factory()->NewFixedArray(mapped_count + 2, NOT_TENURED);
7607 isolate->heap()->non_strict_arguments_elements_map());
7611 isolate->factory()->CopyMapDropTransitions(old_map);
7619 Handle<Context> context(isolate->context());
7621 isolate->factory()->NewFixedArray(argument_count, NOT_TENURED);
7674 isolate->factory()->NewFixedArray(argument_count, NOT_TENURED);
7695 isolate->heap()->AllocateArgumentsObject(callee, length);
7702 { MaybeObject* maybe_obj = isolate->heap()->AllocateRawFixedArray(length);
7708 array->set_map_no_write_barrier(isolate->heap()->fixed_array_map());
7722 HandleScope scope(isolate);
7732 isolate->factory()->NewFunctionFromSharedFunctionInfo(shared,
7790 HandleScope scope(isolate);
7816 isolate->factory()->NewFixedArray(old_bindings->length() + argc);
7824 new_bindings = isolate->factory()->NewFixedArray(array_size);
7834 isolate->heap()->fixed_cow_array_map());
7838 Handle<String> length_symbol = isolate->factory()->length_symbol();
7848 HandleScope handles(isolate);
7855 ASSERT(bindings->map() == isolate->heap()->fixed_cow_array_map());
7856 return *isolate->factory()->NewJSArrayWithElements(bindings);
7859 return isolate->heap()->undefined_value();
7864 HandleScope scope(isolate);
7908 static void TrySettingInlineConstructStub(Isolate* isolate,
7910 Handle<Object> prototype = isolate->factory()->null_value();
7912 prototype = Handle<Object>(function->instance_prototype(), isolate);
7915 ConstructStubCompiler compiler(isolate);
7923 HandleScope scope(isolate);
7932 isolate->factory()->NewTypeError("not_constructor", arguments);
7933 return isolate->Throw(*type_error);
7943 isolate->factory()->NewTypeError("not_constructor", arguments);
7944 return isolate->Throw(*type_error);
7948 Debug* debug = isolate->debug();
7968 return isolate->context()->global();
7980 Handle<SharedFunctionInfo> shared(function->shared(), isolate);
7990 Handle<JSObject> result = isolate->factory()->NewJSObject(function);
7991 RETURN_IF_EMPTY_HANDLE(isolate, result);
7994 TrySettingInlineConstructStub(isolate, function);
7997 isolate->counters()->constructed_objects()->Increment();
7998 isolate->counters()->constructed_objects_runtime()->Increment();
8005 HandleScope scope(isolate);
8010 TrySettingInlineConstructStub(isolate, function);
8012 return isolate->heap()->undefined_value();
8017 HandleScope scope(isolate);
8042 HandleScope scope(isolate);
8057 isolate->DebuggerHasBreakPoints()) {
8063 isolate->DebuggerHasBreakPoints() ? "T" : "F");
8089 void VisitThread(Isolate* isolate, ThreadLocalTop* top) {
8092 for (JavaScriptFrameIterator it(isolate, top); !it.done(); it.Advance()) {
8109 static void MaterializeArgumentsObjectInFrame(Isolate* isolate,
8111 Handle<JSFunction> function(JSFunction::cast(frame->function()), isolate);
8114 if (frame->GetExpression(i) == isolate->heap()->arguments_marker()) {
8121 ASSERT(*arguments != isolate->heap()->null_value());
8122 ASSERT(*arguments != isolate->heap()->undefined_value());
8131 HandleScope scope(isolate);
8136 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate);
8137 ASSERT(isolate->heap()->IsAllocationAllowed());
8143 JavaScriptFrameIterator it(isolate);
8145 MaterializeArgumentsObjectInFrame(isolate, it.frame());
8151 Handle<JSFunction> function(JSFunction::cast(frame->function()), isolate);
8152 MaterializeArgumentsObjectInFrame(isolate, frame);
8161 return isolate->heap()->undefined_value();
8177 isolate->thread_manager()->IterateArchivedThreads(&activations_finder);
8191 return isolate->heap()->undefined_value();
8196 Deoptimizer* deoptimizer = Deoptimizer::Grab(isolate);
8198 return isolate->heap()->undefined_value();
8203 HandleScope scope(isolate);
8206 if (!function->IsOptimized()) return isolate->heap()->undefined_value();
8210 return isolate->heap()->undefined_value();
8216 return isolate->heap()->true_value();
8218 return isolate->heap()->false_value();
8224 HandleScope scope(isolate);
8228 if (!function->IsOptimizable()) return isolate->heap()->undefined_value();
8236 isolate->runtime_profiler()->AttemptOnStackReplacement(*function);
8241 return isolate->heap()->undefined_value();
8246 HandleScope scope(isolate);
8263 HandleScope scope(isolate);
8271 HandleScope scope(isolate);
8280 Handle<Code> unoptimized(function->shared()->code(), isolate);
8289 JavaScriptFrameIterator it(isolate);
8301 JavaScriptFrameIterator it(isolate);
8372 Handle<Code> replacement_code = isolate->builtins()->OnStackReplacement();
8396 RUNTIME_ASSERT(isolate->bootstrapper()->IsActive());
8397 return isolate->heap()->undefined_value();
8402 RUNTIME_ASSERT(isolate->bootstrapper()->IsActive());
8403 return isolate->heap()->nan_value();
8408 HandleScope scope(isolate);
8421 if (argv == NULL) return isolate->StackOverflow();
8444 HandleScope scope(isolate);
8461 if (argv == NULL) return isolate->StackOverflow();
8479 HandleScope scope(isolate);
8487 HandleScope scope(isolate);
8502 isolate->heap()->AllocateFunctionContext(length, function);
8506 isolate->set_context(Context::cast(result));
8523 HandleScope scope(isolate);
8526 isolate->factory()->NewTypeError("with_expression",
8528 return isolate->Throw(*result);
8540 function = isolate->context()->global_context()->closure();
8547 isolate->heap()->AllocateWithContext(function,
8548 isolate->context(),
8551 isolate->set_context(context);
8566 function = isolate->context()->global_context()->closure();
8572 isolate->heap()->AllocateCatchContext(function,
8573 isolate->context(),
8577 isolate->set_context(context);
8591 function = isolate->context()->global_context()->closure();
8597 isolate->heap()->AllocateBlockContext(function,
8598 isolate->context(),
8601 isolate->set_context(context);
8607 HandleScope scope(isolate);
8625 return isolate->heap()->true_value();
8630 return isolate->heap()->false_value();
8679 static Object* ComputeReceiverForNonGlobal(Isolate* isolate,
8682 Context* top = isolate->context();
8696 return isolate->heap()->the_hole_value();
8701 Isolate* isolate,
8703 HandleScope scope(isolate);
8707 return MakePair(isolate->ThrowIllegalOperation(), NULL);
8731 Handle<Object> receiver = isolate->factory()->the_hole_value();
8739 isolate->factory()->NewReferenceError("not_defined",
8741 return MakePair(isolate->Throw(*reference_error), NULL);
8750 return MakePair(Unhole(isolate->heap(), value, attributes), *receiver);
8766 : ComputeReceiverForNonGlobal(isolate, *object));
8777 isolate->factory()->NewReferenceError("not_defined",
8779 return MakePair(isolate->Throw(*reference_error), NULL);
8782 return MakePair(isolate->heap()->undefined_value(),
8783 isolate->heap()->undefined_value());
8789 return LoadContextSlotHelper(args, isolate, true);
8794 return LoadContextSlotHelper(args, isolate, false);
8799 HandleScope scope(isolate);
8802 Handle<Object> value(args[0], isolate);
8825 isolate->factory()->NewReferenceError("not_defined",
8827 return isolate->Throw(*error);
8836 isolate->factory()->NewTypeError("strict_cannot_assign",
8838 return isolate->Throw(*error);
8858 isolate->factory()->NewReferenceError(
8860 return isolate->Throw(*error);
8864 object = Handle<JSObject>(isolate->context()->global());
8871 isolate,
8876 isolate->factory()->NewTypeError(
8878 return isolate->Throw(*error);
8885 HandleScope scope(isolate);
8888 return isolate->Throw(args[0]);
8893 HandleScope scope(isolate);
8896 return isolate->ReThrow(args[0]);
8902 return isolate->PromoteScheduledException();
8907 HandleScope scope(isolate);
8910 Handle<Object> name(args[0], isolate);
8912 isolate->factory()->NewReferenceError("not_defined",
8914 return isolate->Throw(*reference_error);
8922 if (isolate->stack_guard()->IsStackOverflow()) {
8924 return isolate->StackOverflow();
8927 return Execution::HandleStackGuardInterrupt(isolate);
8933 return Execution::HandleStackGuardInterrupt(isolate);
8970 return isolate->heap()->undefined_value();
8989 JavaScriptFrameIterator it(isolate);
9015 isolate->PrintStack();
9016 return isolate->heap()->undefined_value();
9029 return isolate->heap()->NumberFromDouble(millis);
9034 HandleScope scope(isolate);
9056 isolate->unicode_cache());
9061 isolate->unicode_cache());
9067 return isolate->heap()->null_value();
9077 int64_t time = isolate->date_cache()->EquivalentTime(static_cast<int64_t>(x));
9079 return isolate->heap()->AllocateStringFromUtf8(CStrVector(zone));
9088 int64_t time = isolate->date_cache()->ToUTC(static_cast<int64_t>(x));
9090 return isolate->heap()->NumberFromDouble(static_cast<double>(time));
9097 if (!global->IsJSGlobalObject()) return isolate->heap()->null_value();
9103 HandleScope scope(isolate);
9117 ASSERT(isolate->has_pending_exception());
9124 bool CodeGenerationFromStringsAllowed(Isolate* isolate,
9129 isolate->allow_code_gen_callback();
9135 VMState state(isolate, EXTERNAL);
9142 HandleScope scope(isolate);
9147 Handle<Context> context(isolate->context()->global_context());
9152 !CodeGenerationFromStringsAllowed(isolate, context)) {
9153 return isolate->Throw(*isolate->factory()->NewError(
9162 isolate->factory()->NewFunctionFromSharedFunctionInfo(shared,
9169 static ObjectPair CompileGlobalEval(Isolate* isolate,
9174 Handle<Context> context = Handle<Context>(isolate->context());
9180 !CodeGenerationFromStringsAllowed(isolate, global_context)) {
9181 isolate->Throw(*isolate->factory()->NewError(
9190 Handle<Context>(isolate->context()),
9196 isolate->factory()->NewFunctionFromSharedFunctionInfo(
9205 HandleScope scope(isolate);
9213 if (*callee != isolate->global_context()->global_eval_fun() ||
9215 return MakePair(*callee, isolate->heap()->the_hole_value());
9220 return CompileGlobalEval(isolate,
9233 HandleScope scope(isolate);
9238 ? isolate->function_instance_map()
9239 : isolate->strict_mode_function_instance_map();
9257 Heap* heap = isolate->heap();
9281 if (elements->get(i) == element) return isolate->heap()->false_value();
9289 return isolate->heap()->true_value();
9306 ArrayConcatVisitor(Isolate* isolate,
9309 isolate_(isolate),
9311 isolate->global_handles()->Create(*storage))),
9470 static void IterateExternalArrayElements(Isolate* isolate,
9496 isolate->factory()->NewNumber(static_cast<ElementType>(val));
9503 HandleScope loop_scope(isolate);
9504 Handle<Object> e = isolate->factory()->NewNumber(array->get_scalar(j));
9645 static bool IterateElements(Isolate* isolate,
9658 HandleScope loop_scope(isolate);
9659 Handle<Object> element_value(elements->get(j), isolate);
9666 RETURN_IF_EMPTY_HANDLE_VALUE(isolate, element_value, false);
9690 RETURN_IF_EMPTY_HANDLE_VALUE(isolate, element, false);
9710 isolate, receiver, true, true, visitor);
9715 isolate, receiver, true, true, visitor);
9720 isolate, receiver, true, true, visitor);
9725 isolate, receiver, true, true, visitor);
9730 isolate, receiver, true, false, visitor);
9735 isolate, receiver, true, false, visitor);
9740 isolate, receiver, false, false, visitor);
9745 isolate, receiver, false, false, visitor);
9765 HandleScope handle_scope(isolate);
9827 storage = isolate->factory()->NewFixedArrayWithHoles(
9834 isolate->factory()->NewSeededNumberDictionary(at_least_space_for));
9837 ArrayConcatVisitor visitor(isolate, storage, fast_case);
9843 if (!IterateElements(isolate, array, &visitor)) {
9892 if (new_elements->map() == isolate->heap()->fixed_array_map() ||
9893 new_elements->map() == isolate->heap()->fixed_cow_array_map()) {
9896 isolate->heap()->fixed_double_array_map()) {
9901 maybe_new_map = to->GetElementsTransitionMap(isolate, elements_kind);
9939 HandleScope scope(isolate);
9959 return *isolate->factory()->NewJSArrayWithElements(keys);
9964 Handle<FixedArray> single_interval = isolate->factory()->NewFixedArray(2);
9972 isolate->factory()->NewNumber(static_cast<double>(min_length));
9974 return *isolate->factory()->NewJSArrayWithElements(single_interval);
10019 isolate->debugger()->SetEventListener(callback, data);
10021 return isolate->heap()->undefined_value();
10027 isolate->stack_guard()->DebugBreak();
10028 return isolate->heap()->undefined_value();
10063 maybe_value = heap->isolate()->pending_exception();
10064 heap->isolate()->clear_pending_exception();
10103 HandleScope scope(isolate);
10116 SaveContext save(isolate);
10117 if (isolate->debug()->InDebugger()) {
10118 isolate->set_context(*isolate->debug()->debugger_entry()->GetContext());
10132 Handle<FixedArray> details = isolate->factory()->NewFixedArray(2);
10135 Runtime::GetElementOrCharAt(isolate, obj, index);
10142 return *isolate->factory()->NewJSArrayWithElements(details);
10151 LookupResult result(isolate);
10161 isolate);
10169 DebugLookupResultValue(isolate->heap(), *obj, *name,
10173 Handle<Object> value(raw_value, isolate);
10180 isolate->factory()->NewFixedArray(hasJavaScriptAccessors ? 5 : 2);
10185 details->set(2, isolate->heap()->ToBoolean(caught_exception));
10190 return *isolate->factory()->NewJSArrayWithElements(details);
10197 return isolate->heap()->undefined_value();
10202 HandleScope scope(isolate);
10209 LookupResult result(isolate);
10212 return DebugLookupResultValue(isolate->heap(), *obj, *name, &result, NULL);
10214 return isolate->heap()->undefined_value();
10249 HandleScope scope(isolate);
10264 HandleScope scope(isolate);
10278 if (isolate->debug()->break_id() == 0 ||
10279 break_id != isolate->debug()->break_id()) {
10280 return isolate->Throw(
10281 isolate->heap()->illegal_execution_state_symbol());
10284 return isolate->heap()->true_value();
10289 HandleScope scope(isolate);
10295 RUNTIME_ARGUMENTS(isolate, args));
10301 StackFrame::Id id = isolate->debug()->break_frame_id();
10307 for (JavaScriptFrameIterator it(isolate, id); !it.done(); it.Advance()) {
10318 Isolate* isolate)
10319 : frame_(frame), deoptimized_frame_(NULL), isolate_(isolate) {
10323 frame, inlined_jsframe_index, isolate);
10403 static SaveContext* FindSavedContextForFrame(Isolate* isolate,
10405 SaveContext* save = isolate->save_context();
10432 HandleScope scope(isolate);
10438 RUNTIME_ARGUMENTS(isolate, args));
10442 Heap* heap = isolate->heap();
10445 StackFrame::Id id = isolate->debug()->break_frame_id();
10452 JavaScriptFrameIterator it(isolate, id);
10466 FrameInspector frame_inspector(it.frame(), inlined_jsframe_index, isolate);
10470 SaveContext* save = FindSavedContextForFrame(isolate, it.frame());
10473 Handle<Object> frame_id(WrapFrameId(it.frame()->id()), isolate);
10493 isolate->factory()->NewFixedArray(scope_info->LocalCount() * 2);
10520 at_return = isolate->debug()->IsBreakAtReturn(it.frame());
10525 Handle<Object> return_value = isolate->factory()->undefined_value();
10527 StackFrameIterator it2(isolate);
10542 isolate);
10575 Handle<FixedArray> details = isolate->factory()->NewFixedArray(details_size);
10608 if (*save->context() == *isolate->debug()->debug_context()) {
10651 Handle<Object> receiver(it.frame()->receiver(), isolate);
10665 isolate->factory()->ToObject(receiver, calling_frames_global_context);
10670 return *isolate->factory()->NewJSArrayWithElements(details);
10676 Isolate* isolate,
10688 isolate,
10691 Handle<Object>(context->get(context_index), isolate),
10704 Isolate* isolate,
10714 isolate->factory()->NewJSObject(isolate->object_function());
10720 frame_inspector->GetParameter(i) : isolate->heap()->undefined_value());
10723 isolate,
10735 isolate,
10749 isolate, scope_info, function_context, local_scope)) {
10769 isolate,
10786 Isolate* isolate,
10789 FrameInspector frame_inspector(frame, inlined_jsframe_index, isolate);
10790 return MaterializeLocalScopeWithFrameInspector(isolate,
10798 static Handle<JSObject> MaterializeClosure(Isolate* isolate,
10808 isolate->factory()->NewJSObject(isolate->object_function());
10812 isolate, scope_info, context, closure_scope)) {
10830 isolate,
10846 static Handle<JSObject> MaterializeCatchScope(Isolate* isolate,
10852 isolate->factory()->NewJSObject(isolate->object_function());
10854 isolate,
10864 Isolate* isolate,
10872 isolate->factory()->NewJSObject(isolate->object_function());
10876 isolate, scope_info, context, block_scope)) {
10887 Isolate* isolate,
10895 isolate->factory()->NewJSObject(isolate->object_function());
10899 isolate, scope_info, context, module_scope)) {
10923 ScopeIterator(Isolate* isolate,
10926 : isolate_(isolate),
10936 if (shared_info->script() == isolate->heap()->undefined_value()) {
10944 if (!isolate->debug()->EnsureDebugInfo(shared_info)) {
10969 ZoneScope zone_scope(isolate, DELETE_ON_EXIT);
11199 HandleScope scope(isolate);
11205 RUNTIME_ARGUMENTS(isolate, args));
11212 JavaScriptFrameIterator it(isolate, id);
11217 for (ScopeIterator it(isolate, frame, 0);
11241 HandleScope scope(isolate);
11247 RUNTIME_ARGUMENTS(isolate, args));
11256 JavaScriptFrameIterator frame_it(isolate, id);
11261 ScopeIterator it(isolate, frame, inlined_jsframe_index);
11266 return isolate->heap()->undefined_value();
11271 Handle<FixedArray> details = isolate->factory()->NewFixedArray(details_size);
11276 RETURN_IF_EMPTY_HANDLE(isolate, scope_object);
11279 return *isolate->factory()->NewJSArrayWithElements(details);
11284 HandleScope scope(isolate);
11291 for (ScopeIterator it(isolate, frame, 0);
11297 return isolate->heap()->undefined_value();
11302 HandleScope scope(isolate);
11308 RUNTIME_ARGUMENTS(isolate, args));
11315 isolate->thread_manager()->FirstThreadStateInUse();
11338 HandleScope scope(isolate);
11344 RUNTIME_ARGUMENTS(isolate, args));
11351 isolate->factory()->NewFixedArray(kThreadDetailsSize);
11357 isolate->heap()->true_value());
11364 isolate->thread_manager()->FirstThreadStateInUse();
11370 return isolate->heap()->undefined_value();
11375 isolate->heap()->false_value());
11381 return *isolate->factory()->NewJSArrayWithElements(details);
11388 HandleScope scope(isolate);
11391 isolate->debug()->set_disable_break(disable_break);
11392 return isolate->heap()->undefined_value();
11397 HandleScope scope(isolate);
11404 if (break_locations->IsUndefined()) return isolate->heap()->undefined_value();
11406 return *isolate->factory()->NewJSArrayWithElements(
11416 HandleScope scope(isolate);
11425 isolate->debug()->SetBreakPoint(shared, break_point_object_arg,
11432 Object* Runtime::FindSharedFunctionInfoInScript(Isolate* isolate,
11449 isolate->heap()->EnsureHeapIsIterable();
11497 return isolate->heap()->undefined_value();
11522 HandleScope scope(isolate);
11534 isolate, script, source_position);
11545 isolate->debug()->SetBreakPoint(shared, break_point_object_arg, &position);
11549 return isolate->heap()->undefined_value();
11556 HandleScope scope(isolate);
11561 isolate->debug()->ClearBreakPoint(break_point_object_arg);
11563 return isolate->heap()->undefined_value();
11571 HandleScope scope(isolate);
11581 isolate->debug()->ChangeBreakOnException(type, enable);
11582 return isolate->heap()->undefined_value();
11589 HandleScope scope(isolate);
11595 bool result = isolate->debug()->IsBreakOnException(type);
11606 HandleScope scope(isolate);
11611 RUNTIME_ARGUMENTS(isolate, args));
11615 return isolate->Throw(isolate->heap()->illegal_argument_symbol());
11625 return isolate->Throw(isolate->heap()->illegal_argument_symbol());
11631 return isolate->Throw(isolate->heap()->illegal_argument_symbol());
11635 isolate->debug()->ClearStepping();
11638 isolate->debug()->PrepareStep(static_cast<StepAction>(step_action),
11640 return isolate->heap()->undefined_value();
11646 HandleScope scope(isolate);
11648 isolate->debug()->ClearStepping();
11649 return isolate->heap()->undefined_value();
11655 static Handle<Context> CopyNestedScopeContextChain(Isolate* isolate,
11660 HandleScope scope(isolate);
11664 ScopeIterator it(isolate, frame, inlined_jsframe_index);
11685 isolate->factory()->NewCatchContext(function,
11692 MaterializeBlockScope(isolate, current);
11699 isolate->factory()->NewFunctionContext(Context::MIN_CONTEXT_SLOTS,
11709 isolate->factory()->NewWithContext(function, context, extension);
11719 static Handle<Object> GetArgumentsObject(Isolate* isolate,
11729 index = scope_info->StackSlotIndex(isolate->heap()->arguments_symbol());
11731 return Handle<Object>(frame->GetExpression(index), isolate);
11739 isolate->heap()->arguments_symbol(), &mode, &init_flag);
11741 return Handle<Object>(function_context->get(index), isolate);
11748 isolate->factory()->NewArgumentsObject(function, length);
11749 Handle<FixedArray> array = isolate->factory()->NewFixedArray(length);
11777 HandleScope scope(isolate);
11784 RUNTIME_ARGUMENTS(isolate, args));
11800 JavaScriptFrameIterator it(isolate, id);
11802 FrameInspector frame_inspector(frame, inlined_jsframe_index, isolate);
11808 SaveContext* save = FindSavedContextForFrame(isolate, frame);
11810 SaveContext savex(isolate);
11811 isolate->set_context(*(save->context()));
11820 isolate->factory()->NewFunction(isolate->factory()->empty_string(),
11821 isolate->factory()->undefined_value());
11831 isolate, frame, &frame_inspector);
11832 RETURN_IF_EMPTY_HANDLE(isolate, local_scope);
11837 isolate->factory()->NewFunctionContext(Context::MIN_CONTEXT_SLOTS,
11847 context = CopyNestedScopeContextChain(isolate,
11856 isolate->factory()->NewWithContext(go_between, context, extension);
11866 isolate->factory()->NewStringFromAscii(
11879 isolate->factory()->NewFunctionFromSharedFunctionInfo(shared, context);
11883 Handle<Object> receiver(frame->receiver(), isolate);
11889 Handle<Object> arguments = GetArgumentsObject(isolate,
11916 HandleScope scope(isolate);
11923 RUNTIME_ARGUMENTS(isolate, args));
11936 SaveContext save(isolate);
11938 while (top != NULL && *top->context() == *isolate->debug()->debug_context()) {
11942 isolate->set_context(*top->context());
11947 Handle<Context> context = isolate->global_context();
11954 context = isolate->factory()->NewWithContext(
11973 isolate->factory()->NewFunctionFromSharedFunctionInfo(shared,
11978 Handle<Object> receiver = isolate->global();
11983 isolate->debug()->ClearStepping();
11990 HandleScope scope(isolate);
11994 Handle<FixedArray> instances = isolate->debug()->GetLoadedScripts();
12010 isolate->factory()->NewJSObject(isolate->array_function());
12011 isolate->factory()->SetContent(Handle<JSArray>::cast(result), instances);
12094 isolate->heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask,
12112 isolate->context()->global_context()->arguments_boilerplate();
12125 { MaybeObject* maybe_object = isolate->heap()->AllocateFixedArray(count);
12140 MaybeObject* maybe_result = isolate->heap()->AllocateJSObject(
12141 isolate->context()->global_context()->array_function());
12186 isolate->heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask,
12205 { MaybeObject* maybe_object = isolate->heap()->AllocateFixedArray(count);
12221 { MaybeObject* maybe_result = isolate->heap()->AllocateJSObject(
12222 isolate->context()->global_context()->array_function());
12243 HandleScope scope(isolate);
12256 return isolate->heap()->undefined_value();
12263 return isolate->heap()->undefined_value();
12269 HandleScope scope(isolate);
12279 return isolate->heap()->undefined_value();
12285 HandleScope scope(isolate);
12295 return isolate->heap()->undefined_value();
12339 HandleScope scope(isolate);
12348 array = isolate->factory()->NewFixedArray(kBufferSize);
12351 isolate->heap()->EnsureHeapIsIterable();
12359 array = isolate->factory()->NewFixedArray(number);
12360 isolate->heap()->EnsureHeapIsIterable();
12368 Handle<JSArray> result = isolate->factory()->NewJSArrayWithElements(array);
12385 HandleScope scope(isolate);
12392 if (isolate->has_pending_exception()) {
12404 HandleScope scope(isolate);
12407 Handle<Object> old_script_name(args[2], isolate);
12420 return isolate->heap()->null_value();
12427 HandleScope scope(isolate);
12436 HandleScope scope(isolate);
12446 HandleScope scope(isolate);
12447 Handle<Object> function_object(args[0], isolate);
12448 Handle<Object> script_object(args[1], isolate);
12455 script_object = Handle<Object>(script, isolate);
12464 return isolate->heap()->undefined_value();
12472 HandleScope scope(isolate);
12481 return isolate->heap()->undefined_value();
12492 HandleScope scope(isolate);
12506 HandleScope scope(isolate);
12518 HandleScope scope(isolate);
12530 HandleScope scope(isolate);
12534 Handle<Code> code(function->code(), isolate);
12538 return isolate->heap()->undefined_value();
12567 HandleScope scope(isolate);
12575 result = Execution::Call(function, isolate->global(), 0, NULL,
12579 result = Execution::Call(function, isolate->global(), 0, NULL,
12597 return isolate->heap()->undefined_value();
12604 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, "%CollectGarbage");
12605 return isolate->heap()->undefined_value();
12611 int usage = static_cast<int>(isolate->heap()->SizeOfObjects());
12613 return *isolate->factory()->NewNumberFromInt(usage);
12622 return isolate->heap()->true_value();
12624 return isolate->heap()->false_value();
12634 return isolate->heap()->undefined_value();
12644 return isolate->heap()->ToBoolean(success);
12646 return isolate->heap()->undefined_value();
12667 return isolate->heap()->undefined_value();
12680 return isolate->heap()->undefined_value();
12694 return isolate->heap()->undefined_value();
12734 return isolate->heap()->undefined_value();
12756 return isolate->heap()->undefined_value();
12769 return isolate->heap()->undefined_value();
12783 return isolate->heap()->undefined_value();
12792 return isolate->heap()->undefined_value();
12794 return isolate->heap()->undefined_value();
12814 return isolate->heap()->undefined_value();
12824 return isolate->heap()->undefined_value();
12831 return isolate->heap()->undefined_value();
12873 HandleScope scope(isolate);
12936 HandleScope scope(isolate);
12937 Factory* factory = isolate->factory();
12944 StackFrameIterator iter(isolate);
12985 isolate->CaptureAndSetCurrentStackTraceFor(error_object);
12999 return isolate->heap()->AllocateStringFromAscii(CStrVector(version_string),
13008 isolate->PrintStack();
13049 HandleScope scope(isolate);
13058 Handle<Object> receiver(isolate->global_context()->global());
13112 HandleScope scope(isolate);
13115 return *isolate->factory()->NewJSMessageObject(
13120 isolate->factory()->undefined_value(),
13121 isolate->factory()->undefined_value(),
13122 isolate->factory()->undefined_value());
13162 Factory* factory = isolate->factory();
13205 return isolate->heap()->undefined_value();
13218 return isolate->heap()->ToBoolean(obj->Has##Name()); \
13243 return isolate->heap()->ToBoolean(obj1->map() == obj2->map());
13310 Isolate* isolate = Isolate::Current();
13313 if (isolate->heap()->new_space()->AddFreshPage()) {
13319 isolate->heap()->CollectGarbage(failure->allocation_space(),
13324 isolate->counters()->gc_last_resort_from_js()->Increment();
13325 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,