OLD | NEW |
---|---|
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
785 } | 785 } |
786 | 786 |
787 | 787 |
788 Local<FunctionTemplate> FunctionTemplate::New(InvocationCallback callback, | 788 Local<FunctionTemplate> FunctionTemplate::New(InvocationCallback callback, |
789 v8::Handle<Value> data, v8::Handle<Signature> signature) { | 789 v8::Handle<Value> data, v8::Handle<Signature> signature) { |
790 i::Isolate* isolate = i::Isolate::Current(); | 790 i::Isolate* isolate = i::Isolate::Current(); |
791 EnsureInitializedForIsolate(isolate, "v8::FunctionTemplate::New()"); | 791 EnsureInitializedForIsolate(isolate, "v8::FunctionTemplate::New()"); |
792 LOG_API(isolate, "FunctionTemplate::New"); | 792 LOG_API(isolate, "FunctionTemplate::New"); |
793 ENTER_V8; | 793 ENTER_V8; |
794 i::Handle<i::Struct> struct_obj = | 794 i::Handle<i::Struct> struct_obj = |
795 FACTORY->NewStruct(i::FUNCTION_TEMPLATE_INFO_TYPE); | 795 isolate->factory()->NewStruct(i::FUNCTION_TEMPLATE_INFO_TYPE); |
796 i::Handle<i::FunctionTemplateInfo> obj = | 796 i::Handle<i::FunctionTemplateInfo> obj = |
797 i::Handle<i::FunctionTemplateInfo>::cast(struct_obj); | 797 i::Handle<i::FunctionTemplateInfo>::cast(struct_obj); |
798 InitializeFunctionTemplate(obj); | 798 InitializeFunctionTemplate(obj); |
799 int next_serial_number = isolate->next_serial_number(); | 799 int next_serial_number = isolate->next_serial_number(); |
800 isolate->set_next_serial_number(next_serial_number + 1); | 800 isolate->set_next_serial_number(next_serial_number + 1); |
801 obj->set_serial_number(i::Smi::FromInt(next_serial_number)); | 801 obj->set_serial_number(i::Smi::FromInt(next_serial_number)); |
802 if (callback != 0) { | 802 if (callback != 0) { |
803 if (data.IsEmpty()) data = v8::Undefined(); | 803 if (data.IsEmpty()) data = v8::Undefined(); |
804 Utils::ToLocal(obj)->SetCallHandler(callback, data); | 804 Utils::ToLocal(obj)->SetCallHandler(callback, data); |
805 } | 805 } |
806 obj->set_undetectable(false); | 806 obj->set_undetectable(false); |
807 obj->set_needs_access_check(false); | 807 obj->set_needs_access_check(false); |
808 | 808 |
809 if (!signature.IsEmpty()) | 809 if (!signature.IsEmpty()) |
810 obj->set_signature(*Utils::OpenHandle(*signature)); | 810 obj->set_signature(*Utils::OpenHandle(*signature)); |
811 return Utils::ToLocal(obj); | 811 return Utils::ToLocal(obj); |
812 } | 812 } |
813 | 813 |
814 | 814 |
815 Local<Signature> Signature::New(Handle<FunctionTemplate> receiver, | 815 Local<Signature> Signature::New(Handle<FunctionTemplate> receiver, |
816 int argc, Handle<FunctionTemplate> argv[]) { | 816 int argc, Handle<FunctionTemplate> argv[]) { |
817 i::Isolate* isolate = i::Isolate::Current(); | 817 i::Isolate* isolate = i::Isolate::Current(); |
818 EnsureInitializedForIsolate(isolate, "v8::Signature::New()"); | 818 EnsureInitializedForIsolate(isolate, "v8::Signature::New()"); |
819 LOG_API(isolate, "Signature::New"); | 819 LOG_API(isolate, "Signature::New"); |
820 ENTER_V8; | 820 ENTER_V8; |
821 i::Handle<i::Struct> struct_obj = | 821 i::Handle<i::Struct> struct_obj = |
822 FACTORY->NewStruct(i::SIGNATURE_INFO_TYPE); | 822 isolate->factory()->NewStruct(i::SIGNATURE_INFO_TYPE); |
823 i::Handle<i::SignatureInfo> obj = | 823 i::Handle<i::SignatureInfo> obj = |
824 i::Handle<i::SignatureInfo>::cast(struct_obj); | 824 i::Handle<i::SignatureInfo>::cast(struct_obj); |
825 if (!receiver.IsEmpty()) obj->set_receiver(*Utils::OpenHandle(*receiver)); | 825 if (!receiver.IsEmpty()) obj->set_receiver(*Utils::OpenHandle(*receiver)); |
826 if (argc > 0) { | 826 if (argc > 0) { |
827 i::Handle<i::FixedArray> args = FACTORY->NewFixedArray(argc); | 827 i::Handle<i::FixedArray> args = isolate->factory()->NewFixedArray(argc); |
828 for (int i = 0; i < argc; i++) { | 828 for (int i = 0; i < argc; i++) { |
829 if (!argv[i].IsEmpty()) | 829 if (!argv[i].IsEmpty()) |
830 args->set(i, *Utils::OpenHandle(*argv[i])); | 830 args->set(i, *Utils::OpenHandle(*argv[i])); |
831 } | 831 } |
832 obj->set_args(*args); | 832 obj->set_args(*args); |
833 } | 833 } |
834 return Utils::ToLocal(obj); | 834 return Utils::ToLocal(obj); |
835 } | 835 } |
836 | 836 |
837 | 837 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
878 } while (false) | 878 } while (false) |
879 | 879 |
880 | 880 |
881 void FunctionTemplate::SetCallHandler(InvocationCallback callback, | 881 void FunctionTemplate::SetCallHandler(InvocationCallback callback, |
882 v8::Handle<Value> data) { | 882 v8::Handle<Value> data) { |
883 i::Isolate* isolate = i::Isolate::Current(); | 883 i::Isolate* isolate = i::Isolate::Current(); |
884 if (IsDeadCheck(isolate, "v8::FunctionTemplate::SetCallHandler()")) return; | 884 if (IsDeadCheck(isolate, "v8::FunctionTemplate::SetCallHandler()")) return; |
885 ENTER_V8; | 885 ENTER_V8; |
886 i::HandleScope scope(isolate); | 886 i::HandleScope scope(isolate); |
887 i::Handle<i::Struct> struct_obj = | 887 i::Handle<i::Struct> struct_obj = |
888 FACTORY->NewStruct(i::CALL_HANDLER_INFO_TYPE); | 888 isolate->factory()->NewStruct(i::CALL_HANDLER_INFO_TYPE); |
889 i::Handle<i::CallHandlerInfo> obj = | 889 i::Handle<i::CallHandlerInfo> obj = |
890 i::Handle<i::CallHandlerInfo>::cast(struct_obj); | 890 i::Handle<i::CallHandlerInfo>::cast(struct_obj); |
891 SET_FIELD_WRAPPED(obj, set_callback, callback); | 891 SET_FIELD_WRAPPED(obj, set_callback, callback); |
892 if (data.IsEmpty()) data = v8::Undefined(); | 892 if (data.IsEmpty()) data = v8::Undefined(); |
893 obj->set_data(*Utils::OpenHandle(*data)); | 893 obj->set_data(*Utils::OpenHandle(*data)); |
894 Utils::OpenHandle(this)->set_call_code(*obj); | 894 Utils::OpenHandle(this)->set_call_code(*obj); |
895 } | 895 } |
896 | 896 |
897 | 897 |
898 static i::Handle<i::AccessorInfo> MakeAccessorInfo( | 898 static i::Handle<i::AccessorInfo> MakeAccessorInfo( |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1074 Local<ObjectTemplate> ObjectTemplate::New( | 1074 Local<ObjectTemplate> ObjectTemplate::New( |
1075 v8::Handle<FunctionTemplate> constructor) { | 1075 v8::Handle<FunctionTemplate> constructor) { |
1076 i::Isolate* isolate = i::Isolate::Current(); | 1076 i::Isolate* isolate = i::Isolate::Current(); |
1077 if (IsDeadCheck(isolate, "v8::ObjectTemplate::New()")) { | 1077 if (IsDeadCheck(isolate, "v8::ObjectTemplate::New()")) { |
1078 return Local<ObjectTemplate>(); | 1078 return Local<ObjectTemplate>(); |
1079 } | 1079 } |
1080 EnsureInitializedForIsolate(isolate, "v8::ObjectTemplate::New()"); | 1080 EnsureInitializedForIsolate(isolate, "v8::ObjectTemplate::New()"); |
1081 LOG_API(isolate, "ObjectTemplate::New"); | 1081 LOG_API(isolate, "ObjectTemplate::New"); |
1082 ENTER_V8; | 1082 ENTER_V8; |
1083 i::Handle<i::Struct> struct_obj = | 1083 i::Handle<i::Struct> struct_obj = |
1084 FACTORY->NewStruct(i::OBJECT_TEMPLATE_INFO_TYPE); | 1084 isolate->factory()->NewStruct(i::OBJECT_TEMPLATE_INFO_TYPE); |
1085 i::Handle<i::ObjectTemplateInfo> obj = | 1085 i::Handle<i::ObjectTemplateInfo> obj = |
1086 i::Handle<i::ObjectTemplateInfo>::cast(struct_obj); | 1086 i::Handle<i::ObjectTemplateInfo>::cast(struct_obj); |
1087 InitializeTemplate(obj, Consts::OBJECT_TEMPLATE); | 1087 InitializeTemplate(obj, Consts::OBJECT_TEMPLATE); |
1088 if (!constructor.IsEmpty()) | 1088 if (!constructor.IsEmpty()) |
1089 obj->set_constructor(*Utils::OpenHandle(*constructor)); | 1089 obj->set_constructor(*Utils::OpenHandle(*constructor)); |
1090 obj->set_internal_field_count(i::Smi::FromInt(0)); | 1090 obj->set_internal_field_count(i::Smi::FromInt(0)); |
1091 return Utils::ToLocal(obj); | 1091 return Utils::ToLocal(obj); |
1092 } | 1092 } |
1093 | 1093 |
1094 | 1094 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1172 bool turned_on_by_default) { | 1172 bool turned_on_by_default) { |
1173 i::Isolate* isolate = i::Isolate::Current(); | 1173 i::Isolate* isolate = i::Isolate::Current(); |
1174 if (IsDeadCheck(isolate, "v8::ObjectTemplate::SetAccessCheckCallbacks()")) { | 1174 if (IsDeadCheck(isolate, "v8::ObjectTemplate::SetAccessCheckCallbacks()")) { |
1175 return; | 1175 return; |
1176 } | 1176 } |
1177 ENTER_V8; | 1177 ENTER_V8; |
1178 i::HandleScope scope(isolate); | 1178 i::HandleScope scope(isolate); |
1179 EnsureConstructor(this); | 1179 EnsureConstructor(this); |
1180 | 1180 |
1181 i::Handle<i::Struct> struct_info = | 1181 i::Handle<i::Struct> struct_info = |
1182 FACTORY->NewStruct(i::ACCESS_CHECK_INFO_TYPE); | 1182 isolate->factory()->NewStruct(i::ACCESS_CHECK_INFO_TYPE); |
1183 i::Handle<i::AccessCheckInfo> info = | 1183 i::Handle<i::AccessCheckInfo> info = |
1184 i::Handle<i::AccessCheckInfo>::cast(struct_info); | 1184 i::Handle<i::AccessCheckInfo>::cast(struct_info); |
1185 | 1185 |
1186 SET_FIELD_WRAPPED(info, set_named_callback, named_callback); | 1186 SET_FIELD_WRAPPED(info, set_named_callback, named_callback); |
1187 SET_FIELD_WRAPPED(info, set_indexed_callback, indexed_callback); | 1187 SET_FIELD_WRAPPED(info, set_indexed_callback, indexed_callback); |
1188 | 1188 |
1189 if (data.IsEmpty()) data = v8::Undefined(); | 1189 if (data.IsEmpty()) data = v8::Undefined(); |
1190 info->set_data(*Utils::OpenHandle(*data)); | 1190 info->set_data(*Utils::OpenHandle(*data)); |
1191 | 1191 |
1192 i::FunctionTemplateInfo* constructor = | 1192 i::FunctionTemplateInfo* constructor = |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1379 ON_BAILOUT(isolate, "v8::Script::Compile()", return Local<Script>()); | 1379 ON_BAILOUT(isolate, "v8::Script::Compile()", return Local<Script>()); |
1380 LOG_API(isolate, "Script::Compile"); | 1380 LOG_API(isolate, "Script::Compile"); |
1381 ENTER_V8; | 1381 ENTER_V8; |
1382 Local<Script> generic = New(source, origin, pre_data, script_data); | 1382 Local<Script> generic = New(source, origin, pre_data, script_data); |
1383 if (generic.IsEmpty()) | 1383 if (generic.IsEmpty()) |
1384 return generic; | 1384 return generic; |
1385 i::Handle<i::Object> obj = Utils::OpenHandle(*generic); | 1385 i::Handle<i::Object> obj = Utils::OpenHandle(*generic); |
1386 i::Handle<i::SharedFunctionInfo> function = | 1386 i::Handle<i::SharedFunctionInfo> function = |
1387 i::Handle<i::SharedFunctionInfo>(i::SharedFunctionInfo::cast(*obj)); | 1387 i::Handle<i::SharedFunctionInfo>(i::SharedFunctionInfo::cast(*obj)); |
1388 i::Handle<i::JSFunction> result = | 1388 i::Handle<i::JSFunction> result = |
1389 FACTORY->NewFunctionFromSharedFunctionInfo( | 1389 isolate->factory()->NewFunctionFromSharedFunctionInfo( |
1390 function, | 1390 function, |
1391 i::Isolate::Current()->global_context()); | 1391 i::Isolate::Current()->global_context()); |
1392 return Local<Script>(ToApi<Script>(result)); | 1392 return Local<Script>(ToApi<Script>(result)); |
1393 } | 1393 } |
1394 | 1394 |
1395 | 1395 |
1396 Local<Script> Script::Compile(v8::Handle<String> source, | 1396 Local<Script> Script::Compile(v8::Handle<String> source, |
1397 v8::Handle<Value> file_name, | 1397 v8::Handle<Value> file_name, |
1398 v8::Handle<String> script_data) { | 1398 v8::Handle<String> script_data) { |
1399 ScriptOrigin origin(file_name); | 1399 ScriptOrigin origin(file_name); |
1400 return Compile(source, &origin, 0, script_data); | 1400 return Compile(source, &origin, 0, script_data); |
1401 } | 1401 } |
1402 | 1402 |
1403 | 1403 |
1404 Local<Value> Script::Run() { | 1404 Local<Value> Script::Run() { |
1405 i::Isolate* isolate = i::Isolate::Current(); | 1405 i::Isolate* isolate = i::Isolate::Current(); |
1406 ON_BAILOUT(isolate, "v8::Script::Run()", return Local<Value>()); | 1406 ON_BAILOUT(isolate, "v8::Script::Run()", return Local<Value>()); |
1407 LOG_API(isolate, "Script::Run"); | 1407 LOG_API(isolate, "Script::Run"); |
1408 ENTER_V8; | 1408 ENTER_V8; |
1409 i::Object* raw_result = NULL; | 1409 i::Object* raw_result = NULL; |
1410 { | 1410 { |
1411 HandleScope scope; | 1411 HandleScope scope; |
1412 i::Handle<i::Object> obj = Utils::OpenHandle(this); | 1412 i::Handle<i::Object> obj = Utils::OpenHandle(this); |
1413 i::Handle<i::JSFunction> fun; | 1413 i::Handle<i::JSFunction> fun; |
1414 if (obj->IsSharedFunctionInfo()) { | 1414 if (obj->IsSharedFunctionInfo()) { |
1415 i::Handle<i::SharedFunctionInfo> | 1415 i::Handle<i::SharedFunctionInfo> |
1416 function_info(i::SharedFunctionInfo::cast(*obj)); | 1416 function_info(i::SharedFunctionInfo::cast(*obj)); |
1417 fun = FACTORY->NewFunctionFromSharedFunctionInfo( | 1417 fun = isolate->factory()->NewFunctionFromSharedFunctionInfo( |
1418 function_info, i::Isolate::Current()->global_context()); | 1418 function_info, i::Isolate::Current()->global_context()); |
1419 } else { | 1419 } else { |
1420 fun = i::Handle<i::JSFunction>(i::JSFunction::cast(*obj)); | 1420 fun = i::Handle<i::JSFunction>(i::JSFunction::cast(*obj)); |
1421 } | 1421 } |
1422 EXCEPTION_PREAMBLE(); | 1422 EXCEPTION_PREAMBLE(); |
1423 i::Handle<i::Object> receiver( | 1423 i::Handle<i::Object> receiver( |
1424 i::Isolate::Current()->context()->global_proxy()); | 1424 i::Isolate::Current()->context()->global_proxy()); |
1425 i::Handle<i::Object> result = | 1425 i::Handle<i::Object> result = |
1426 i::Execution::Call(fun, receiver, 0, NULL, &has_pending_exception); | 1426 i::Execution::Call(fun, receiver, 0, NULL, &has_pending_exception); |
1427 EXCEPTION_BAILOUT_CHECK(Local<Value>()); | 1427 EXCEPTION_BAILOUT_CHECK(Local<Value>()); |
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2334 i::Handle<i::Object> string_obj = | 2334 i::Handle<i::Object> string_obj = |
2335 i::Execution::ToString(obj, &has_pending_exception); | 2335 i::Execution::ToString(obj, &has_pending_exception); |
2336 EXCEPTION_BAILOUT_CHECK(Local<Uint32>()); | 2336 EXCEPTION_BAILOUT_CHECK(Local<Uint32>()); |
2337 i::Handle<i::String> str = i::Handle<i::String>::cast(string_obj); | 2337 i::Handle<i::String> str = i::Handle<i::String>::cast(string_obj); |
2338 uint32_t index; | 2338 uint32_t index; |
2339 if (str->AsArrayIndex(&index)) { | 2339 if (str->AsArrayIndex(&index)) { |
2340 i::Handle<i::Object> value; | 2340 i::Handle<i::Object> value; |
2341 if (index <= static_cast<uint32_t>(i::Smi::kMaxValue)) { | 2341 if (index <= static_cast<uint32_t>(i::Smi::kMaxValue)) { |
2342 value = i::Handle<i::Object>(i::Smi::FromInt(index)); | 2342 value = i::Handle<i::Object>(i::Smi::FromInt(index)); |
2343 } else { | 2343 } else { |
2344 value = FACTORY->NewNumber(index); | 2344 value = isolate->factory()->NewNumber(index); |
2345 } | 2345 } |
2346 return Utils::Uint32ToLocal(value); | 2346 return Utils::Uint32ToLocal(value); |
2347 } | 2347 } |
2348 return Local<Uint32>(); | 2348 return Local<Uint32>(); |
2349 } | 2349 } |
2350 | 2350 |
2351 | 2351 |
2352 int32_t Value::Int32Value() const { | 2352 int32_t Value::Int32Value() const { |
2353 i::Isolate* isolate = i::Isolate::Current(); | 2353 i::Isolate* isolate = i::Isolate::Current(); |
2354 if (IsDeadCheck(isolate, "v8::Value::Int32Value()")) return 0; | 2354 if (IsDeadCheck(isolate, "v8::Value::Int32Value()")) return 0; |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2597 while (!object->IsInstanceOf(tmpl_info)) { | 2597 while (!object->IsInstanceOf(tmpl_info)) { |
2598 i::Object* prototype = object->GetPrototype(); | 2598 i::Object* prototype = object->GetPrototype(); |
2599 if (!prototype->IsJSObject()) return Local<Object>(); | 2599 if (!prototype->IsJSObject()) return Local<Object>(); |
2600 object = i::JSObject::cast(prototype); | 2600 object = i::JSObject::cast(prototype); |
2601 } | 2601 } |
2602 return Utils::ToLocal(i::Handle<i::JSObject>(object)); | 2602 return Utils::ToLocal(i::Handle<i::JSObject>(object)); |
2603 } | 2603 } |
2604 | 2604 |
2605 | 2605 |
2606 Local<Array> v8::Object::GetPropertyNames() { | 2606 Local<Array> v8::Object::GetPropertyNames() { |
2607 ON_BAILOUT(i::Isolate::Current(), "v8::Object::GetPropertyNames()", | 2607 i::Isolate* isolate = i::Isolate::Current(); |
2608 ON_BAILOUT(isolate, "v8::Object::GetPropertyNames()", | |
2608 return Local<v8::Array>()); | 2609 return Local<v8::Array>()); |
2609 ENTER_V8; | 2610 ENTER_V8; |
2610 v8::HandleScope scope; | 2611 v8::HandleScope scope; |
2611 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2612 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
2612 i::Handle<i::FixedArray> value = | 2613 i::Handle<i::FixedArray> value = |
2613 i::GetKeysInFixedArrayFor(self, i::INCLUDE_PROTOS); | 2614 i::GetKeysInFixedArrayFor(self, i::INCLUDE_PROTOS); |
2614 // Because we use caching to speed up enumeration it is important | 2615 // Because we use caching to speed up enumeration it is important |
2615 // to never change the result of the basic enumeration function so | 2616 // to never change the result of the basic enumeration function so |
2616 // we clone the result. | 2617 // we clone the result. |
2617 i::Handle<i::FixedArray> elms = FACTORY->CopyFixedArray(value); | 2618 i::Handle<i::FixedArray> elms = isolate->factory()->CopyFixedArray(value); |
2618 i::Handle<i::JSArray> result = FACTORY->NewJSArrayWithElements(elms); | 2619 i::Handle<i::JSArray> result = isolate->factory()->NewJSArrayWithElements(elms ); |
Mads Ager (chromium)
2011/03/23 08:50:37
Line too long. Please run ./tools/presubmit.py bef
| |
2619 return scope.Close(Utils::ToLocal(result)); | 2620 return scope.Close(Utils::ToLocal(result)); |
2620 } | 2621 } |
2621 | 2622 |
2622 | 2623 |
2623 Local<String> v8::Object::ObjectProtoToString() { | 2624 Local<String> v8::Object::ObjectProtoToString() { |
2624 ON_BAILOUT(i::Isolate::Current(), "v8::Object::ObjectProtoToString()", | 2625 ON_BAILOUT(i::Isolate::Current(), "v8::Object::ObjectProtoToString()", |
2625 return Local<v8::String>()); | 2626 return Local<v8::String>()); |
2626 ENTER_V8; | 2627 ENTER_V8; |
2627 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2628 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
2628 | 2629 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2832 ON_BAILOUT(isolate, "v8::Object::TurnOnAccessCheck()", return); | 2833 ON_BAILOUT(isolate, "v8::Object::TurnOnAccessCheck()", return); |
2833 ENTER_V8; | 2834 ENTER_V8; |
2834 i::HandleScope scope(isolate); | 2835 i::HandleScope scope(isolate); |
2835 i::Handle<i::JSObject> obj = Utils::OpenHandle(this); | 2836 i::Handle<i::JSObject> obj = Utils::OpenHandle(this); |
2836 | 2837 |
2837 // When turning on access checks for a global object deoptimize all functions | 2838 // When turning on access checks for a global object deoptimize all functions |
2838 // as optimized code does not always handle access checks. | 2839 // as optimized code does not always handle access checks. |
2839 i::Deoptimizer::DeoptimizeGlobalObject(*obj); | 2840 i::Deoptimizer::DeoptimizeGlobalObject(*obj); |
2840 | 2841 |
2841 i::Handle<i::Map> new_map = | 2842 i::Handle<i::Map> new_map = |
2842 FACTORY->CopyMapDropTransitions(i::Handle<i::Map>(obj->map())); | 2843 isolate->factory()->CopyMapDropTransitions(i::Handle<i::Map>(obj->map())); |
2843 new_map->set_is_access_check_needed(true); | 2844 new_map->set_is_access_check_needed(true); |
2844 obj->set_map(*new_map); | 2845 obj->set_map(*new_map); |
2845 } | 2846 } |
2846 | 2847 |
2847 | 2848 |
2848 bool v8::Object::IsDirty() { | 2849 bool v8::Object::IsDirty() { |
2849 return Utils::OpenHandle(this)->IsDirty(); | 2850 return Utils::OpenHandle(this)->IsDirty(); |
2850 } | 2851 } |
2851 | 2852 |
2852 | 2853 |
(...skipping 18 matching lines...) Expand all Loading... | |
2871 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2872 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
2872 i::Handle<i::Object> hidden_props_obj(i::GetHiddenProperties(self, true)); | 2873 i::Handle<i::Object> hidden_props_obj(i::GetHiddenProperties(self, true)); |
2873 if (!hidden_props_obj->IsJSObject()) { | 2874 if (!hidden_props_obj->IsJSObject()) { |
2874 // We failed to create hidden properties. That's a detached | 2875 // We failed to create hidden properties. That's a detached |
2875 // global proxy. | 2876 // global proxy. |
2876 ASSERT(hidden_props_obj->IsUndefined()); | 2877 ASSERT(hidden_props_obj->IsUndefined()); |
2877 return 0; | 2878 return 0; |
2878 } | 2879 } |
2879 i::Handle<i::JSObject> hidden_props = | 2880 i::Handle<i::JSObject> hidden_props = |
2880 i::Handle<i::JSObject>::cast(hidden_props_obj); | 2881 i::Handle<i::JSObject>::cast(hidden_props_obj); |
2881 i::Handle<i::String> hash_symbol = FACTORY->identity_hash_symbol(); | 2882 i::Handle<i::String> hash_symbol = isolate->factory()->identity_hash_symbol(); |
2882 if (hidden_props->HasLocalProperty(*hash_symbol)) { | 2883 if (hidden_props->HasLocalProperty(*hash_symbol)) { |
2883 i::Handle<i::Object> hash = i::GetProperty(hidden_props, hash_symbol); | 2884 i::Handle<i::Object> hash = i::GetProperty(hidden_props, hash_symbol); |
2884 CHECK(!hash.is_null()); | 2885 CHECK(!hash.is_null()); |
2885 CHECK(hash->IsSmi()); | 2886 CHECK(hash->IsSmi()); |
2886 return i::Smi::cast(*hash)->value(); | 2887 return i::Smi::cast(*hash)->value(); |
2887 } | 2888 } |
2888 | 2889 |
2889 int hash_value; | 2890 int hash_value; |
2890 int attempts = 0; | 2891 int attempts = 0; |
2891 do { | 2892 do { |
(...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4238 } | 4239 } |
4239 | 4240 |
4240 | 4241 |
4241 Local<String> v8::String::NewSymbol(const char* data, int length) { | 4242 Local<String> v8::String::NewSymbol(const char* data, int length) { |
4242 i::Isolate* isolate = i::Isolate::Current(); | 4243 i::Isolate* isolate = i::Isolate::Current(); |
4243 EnsureInitializedForIsolate(isolate, "v8::String::NewSymbol()"); | 4244 EnsureInitializedForIsolate(isolate, "v8::String::NewSymbol()"); |
4244 LOG_API(isolate, "String::NewSymbol(char)"); | 4245 LOG_API(isolate, "String::NewSymbol(char)"); |
4245 ENTER_V8; | 4246 ENTER_V8; |
4246 if (length == -1) length = i::StrLength(data); | 4247 if (length == -1) length = i::StrLength(data); |
4247 i::Handle<i::String> result = | 4248 i::Handle<i::String> result = |
4248 FACTORY->LookupSymbol(i::Vector<const char>(data, length)); | 4249 isolate->factory()->LookupSymbol(i::Vector<const char>(data, length)); |
4249 return Utils::ToLocal(result); | 4250 return Utils::ToLocal(result); |
4250 } | 4251 } |
4251 | 4252 |
4252 | 4253 |
4253 Local<Number> v8::Number::New(double value) { | 4254 Local<Number> v8::Number::New(double value) { |
4254 i::Isolate* isolate = i::Isolate::Current(); | 4255 i::Isolate* isolate = i::Isolate::Current(); |
4255 EnsureInitializedForIsolate(isolate, "v8::Number::New()"); | 4256 EnsureInitializedForIsolate(isolate, "v8::Number::New()"); |
4256 if (isnan(value)) { | 4257 if (isnan(value)) { |
4257 // Introduce only canonical NaN value into the VM, to avoid signaling NaNs. | 4258 // Introduce only canonical NaN value into the VM, to avoid signaling NaNs. |
4258 value = i::OS::nan_value(); | 4259 value = i::OS::nan_value(); |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4697 | 4698 |
4698 Local<Value> Exception::RangeError(v8::Handle<v8::String> raw_message) { | 4699 Local<Value> Exception::RangeError(v8::Handle<v8::String> raw_message) { |
4699 i::Isolate* isolate = i::Isolate::Current(); | 4700 i::Isolate* isolate = i::Isolate::Current(); |
4700 LOG_API(isolate, "RangeError"); | 4701 LOG_API(isolate, "RangeError"); |
4701 ON_BAILOUT(isolate, "v8::Exception::RangeError()", return Local<Value>()); | 4702 ON_BAILOUT(isolate, "v8::Exception::RangeError()", return Local<Value>()); |
4702 ENTER_V8; | 4703 ENTER_V8; |
4703 i::Object* error; | 4704 i::Object* error; |
4704 { | 4705 { |
4705 i::HandleScope scope(isolate); | 4706 i::HandleScope scope(isolate); |
4706 i::Handle<i::String> message = Utils::OpenHandle(*raw_message); | 4707 i::Handle<i::String> message = Utils::OpenHandle(*raw_message); |
4707 i::Handle<i::Object> result = FACTORY->NewRangeError(message); | 4708 i::Handle<i::Object> result = isolate->factory()->NewRangeError(message); |
4708 error = *result; | 4709 error = *result; |
4709 } | 4710 } |
4710 i::Handle<i::Object> result(error); | 4711 i::Handle<i::Object> result(error); |
4711 return Utils::ToLocal(result); | 4712 return Utils::ToLocal(result); |
4712 } | 4713 } |
4713 | 4714 |
4714 Local<Value> Exception::ReferenceError(v8::Handle<v8::String> raw_message) { | 4715 Local<Value> Exception::ReferenceError(v8::Handle<v8::String> raw_message) { |
4715 i::Isolate* isolate = i::Isolate::Current(); | 4716 i::Isolate* isolate = i::Isolate::Current(); |
4716 LOG_API(isolate, "ReferenceError"); | 4717 LOG_API(isolate, "ReferenceError"); |
4717 ON_BAILOUT(isolate, "v8::Exception::ReferenceError()", return Local<Value>()); | 4718 ON_BAILOUT(isolate, "v8::Exception::ReferenceError()", return Local<Value>()); |
4718 ENTER_V8; | 4719 ENTER_V8; |
4719 i::Object* error; | 4720 i::Object* error; |
4720 { | 4721 { |
4721 i::HandleScope scope(isolate); | 4722 i::HandleScope scope(isolate); |
4722 i::Handle<i::String> message = Utils::OpenHandle(*raw_message); | 4723 i::Handle<i::String> message = Utils::OpenHandle(*raw_message); |
4723 i::Handle<i::Object> result = FACTORY->NewReferenceError(message); | 4724 i::Handle<i::Object> result = isolate->factory()->NewReferenceError(message) ; |
4724 error = *result; | 4725 error = *result; |
4725 } | 4726 } |
4726 i::Handle<i::Object> result(error); | 4727 i::Handle<i::Object> result(error); |
4727 return Utils::ToLocal(result); | 4728 return Utils::ToLocal(result); |
4728 } | 4729 } |
4729 | 4730 |
4730 Local<Value> Exception::SyntaxError(v8::Handle<v8::String> raw_message) { | 4731 Local<Value> Exception::SyntaxError(v8::Handle<v8::String> raw_message) { |
4731 i::Isolate* isolate = i::Isolate::Current(); | 4732 i::Isolate* isolate = i::Isolate::Current(); |
4732 LOG_API(isolate, "SyntaxError"); | 4733 LOG_API(isolate, "SyntaxError"); |
4733 ON_BAILOUT(isolate, "v8::Exception::SyntaxError()", return Local<Value>()); | 4734 ON_BAILOUT(isolate, "v8::Exception::SyntaxError()", return Local<Value>()); |
4734 ENTER_V8; | 4735 ENTER_V8; |
4735 i::Object* error; | 4736 i::Object* error; |
4736 { | 4737 { |
4737 i::HandleScope scope(isolate); | 4738 i::HandleScope scope(isolate); |
4738 i::Handle<i::String> message = Utils::OpenHandle(*raw_message); | 4739 i::Handle<i::String> message = Utils::OpenHandle(*raw_message); |
4739 i::Handle<i::Object> result = FACTORY->NewSyntaxError(message); | 4740 i::Handle<i::Object> result = isolate->factory()->NewSyntaxError(message); |
4740 error = *result; | 4741 error = *result; |
4741 } | 4742 } |
4742 i::Handle<i::Object> result(error); | 4743 i::Handle<i::Object> result(error); |
4743 return Utils::ToLocal(result); | 4744 return Utils::ToLocal(result); |
4744 } | 4745 } |
4745 | 4746 |
4746 Local<Value> Exception::TypeError(v8::Handle<v8::String> raw_message) { | 4747 Local<Value> Exception::TypeError(v8::Handle<v8::String> raw_message) { |
4747 i::Isolate* isolate = i::Isolate::Current(); | 4748 i::Isolate* isolate = i::Isolate::Current(); |
4748 LOG_API(isolate, "TypeError"); | 4749 LOG_API(isolate, "TypeError"); |
4749 ON_BAILOUT(isolate, "v8::Exception::TypeError()", return Local<Value>()); | 4750 ON_BAILOUT(isolate, "v8::Exception::TypeError()", return Local<Value>()); |
4750 ENTER_V8; | 4751 ENTER_V8; |
4751 i::Object* error; | 4752 i::Object* error; |
4752 { | 4753 { |
4753 i::HandleScope scope(isolate); | 4754 i::HandleScope scope(isolate); |
4754 i::Handle<i::String> message = Utils::OpenHandle(*raw_message); | 4755 i::Handle<i::String> message = Utils::OpenHandle(*raw_message); |
4755 i::Handle<i::Object> result = FACTORY->NewTypeError(message); | 4756 i::Handle<i::Object> result = isolate->factory()->NewTypeError(message); |
4756 error = *result; | 4757 error = *result; |
4757 } | 4758 } |
4758 i::Handle<i::Object> result(error); | 4759 i::Handle<i::Object> result(error); |
4759 return Utils::ToLocal(result); | 4760 return Utils::ToLocal(result); |
4760 } | 4761 } |
4761 | 4762 |
4762 Local<Value> Exception::Error(v8::Handle<v8::String> raw_message) { | 4763 Local<Value> Exception::Error(v8::Handle<v8::String> raw_message) { |
4763 i::Isolate* isolate = i::Isolate::Current(); | 4764 i::Isolate* isolate = i::Isolate::Current(); |
4764 LOG_API(isolate, "Error"); | 4765 LOG_API(isolate, "Error"); |
4765 ON_BAILOUT(isolate, "v8::Exception::Error()", return Local<Value>()); | 4766 ON_BAILOUT(isolate, "v8::Exception::Error()", return Local<Value>()); |
4766 ENTER_V8; | 4767 ENTER_V8; |
4767 i::Object* error; | 4768 i::Object* error; |
4768 { | 4769 { |
4769 i::HandleScope scope(isolate); | 4770 i::HandleScope scope(isolate); |
4770 i::Handle<i::String> message = Utils::OpenHandle(*raw_message); | 4771 i::Handle<i::String> message = Utils::OpenHandle(*raw_message); |
4771 i::Handle<i::Object> result = FACTORY->NewError(message); | 4772 i::Handle<i::Object> result = isolate->factory()->NewError(message); |
4772 error = *result; | 4773 error = *result; |
4773 } | 4774 } |
4774 i::Handle<i::Object> result(error); | 4775 i::Handle<i::Object> result(error); |
4775 return Utils::ToLocal(result); | 4776 return Utils::ToLocal(result); |
4776 } | 4777 } |
4777 | 4778 |
4778 | 4779 |
4779 // --- D e b u g S u p p o r t --- | 4780 // --- D e b u g S u p p o r t --- |
4780 | 4781 |
4781 #ifdef ENABLE_DEBUGGER_SUPPORT | 4782 #ifdef ENABLE_DEBUGGER_SUPPORT |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4939 v8::Handle<v8::Value> data) { | 4940 v8::Handle<v8::Value> data) { |
4940 i::Isolate* isolate = i::Isolate::Current(); | 4941 i::Isolate* isolate = i::Isolate::Current(); |
4941 if (!isolate->IsInitialized()) return Local<Value>(); | 4942 if (!isolate->IsInitialized()) return Local<Value>(); |
4942 ON_BAILOUT(isolate, "v8::Debug::Call()", return Local<Value>()); | 4943 ON_BAILOUT(isolate, "v8::Debug::Call()", return Local<Value>()); |
4943 ENTER_V8; | 4944 ENTER_V8; |
4944 i::Handle<i::Object> result; | 4945 i::Handle<i::Object> result; |
4945 EXCEPTION_PREAMBLE(); | 4946 EXCEPTION_PREAMBLE(); |
4946 if (data.IsEmpty()) { | 4947 if (data.IsEmpty()) { |
4947 result = | 4948 result = |
4948 i::Isolate::Current()->debugger()->Call(Utils::OpenHandle(*fun), | 4949 i::Isolate::Current()->debugger()->Call(Utils::OpenHandle(*fun), |
4949 FACTORY->undefined_value(), | 4950 isolate->factory()->undefined_va lue(), |
4950 &has_pending_exception); | 4951 &has_pending_exception); |
4951 } else { | 4952 } else { |
4952 result = i::Isolate::Current()->debugger()->Call(Utils::OpenHandle(*fun), | 4953 result = i::Isolate::Current()->debugger()->Call(Utils::OpenHandle(*fun), |
4953 Utils::OpenHandle(*data), | 4954 Utils::OpenHandle(*data), |
4954 &has_pending_exception); | 4955 &has_pending_exception); |
4955 } | 4956 } |
4956 EXCEPTION_BAILOUT_CHECK(Local<Value>()); | 4957 EXCEPTION_BAILOUT_CHECK(Local<Value>()); |
4957 return Utils::ToLocal(result); | 4958 return Utils::ToLocal(result); |
4958 } | 4959 } |
4959 | 4960 |
4960 | 4961 |
4961 Local<Value> Debug::GetMirror(v8::Handle<v8::Value> obj) { | 4962 Local<Value> Debug::GetMirror(v8::Handle<v8::Value> obj) { |
4962 i::Isolate* isolate = i::Isolate::Current(); | 4963 i::Isolate* isolate = i::Isolate::Current(); |
4963 if (!isolate->IsInitialized()) return Local<Value>(); | 4964 if (!isolate->IsInitialized()) return Local<Value>(); |
4964 ON_BAILOUT(isolate, "v8::Debug::GetMirror()", return Local<Value>()); | 4965 ON_BAILOUT(isolate, "v8::Debug::GetMirror()", return Local<Value>()); |
4965 ENTER_V8; | 4966 ENTER_V8; |
4966 v8::HandleScope scope; | 4967 v8::HandleScope scope; |
4967 i::Debug* isolate_debug = i::Isolate::Current()->debug(); | 4968 i::Debug* isolate_debug = i::Isolate::Current()->debug(); |
4968 isolate_debug->Load(); | 4969 isolate_debug->Load(); |
4969 i::Handle<i::JSObject> debug(isolate_debug->debug_context()->global()); | 4970 i::Handle<i::JSObject> debug(isolate_debug->debug_context()->global()); |
4970 i::Handle<i::String> name = FACTORY->LookupAsciiSymbol("MakeMirror"); | 4971 i::Handle<i::String> name = isolate->factory()->LookupAsciiSymbol("MakeMirror" ); |
4971 i::Handle<i::Object> fun_obj = i::GetProperty(debug, name); | 4972 i::Handle<i::Object> fun_obj = i::GetProperty(debug, name); |
4972 i::Handle<i::JSFunction> fun = i::Handle<i::JSFunction>::cast(fun_obj); | 4973 i::Handle<i::JSFunction> fun = i::Handle<i::JSFunction>::cast(fun_obj); |
4973 v8::Handle<v8::Function> v8_fun = Utils::ToLocal(fun); | 4974 v8::Handle<v8::Function> v8_fun = Utils::ToLocal(fun); |
4974 const int kArgc = 1; | 4975 const int kArgc = 1; |
4975 v8::Handle<v8::Value> argv[kArgc] = { obj }; | 4976 v8::Handle<v8::Value> argv[kArgc] = { obj }; |
4976 EXCEPTION_PREAMBLE(); | 4977 EXCEPTION_PREAMBLE(); |
4977 v8::Handle<v8::Value> result = v8_fun->Call(Utils::ToLocal(debug), | 4978 v8::Handle<v8::Value> result = v8_fun->Call(Utils::ToLocal(debug), |
4978 kArgc, | 4979 kArgc, |
4979 argv); | 4980 argv); |
4980 EXCEPTION_BAILOUT_CHECK(Local<Value>()); | 4981 EXCEPTION_BAILOUT_CHECK(Local<Value>()); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5015 isolate->factory()->LookupAsciiSymbol(entry->name_prefix()), | 5016 isolate->factory()->LookupAsciiSymbol(entry->name_prefix()), |
5016 isolate->factory()->LookupAsciiSymbol(entry->name())))); | 5017 isolate->factory()->LookupAsciiSymbol(entry->name())))); |
5017 } | 5018 } |
5018 } | 5019 } |
5019 | 5020 |
5020 | 5021 |
5021 Handle<String> CpuProfileNode::GetScriptResourceName() const { | 5022 Handle<String> CpuProfileNode::GetScriptResourceName() const { |
5022 i::Isolate* isolate = i::Isolate::Current(); | 5023 i::Isolate* isolate = i::Isolate::Current(); |
5023 IsDeadCheck(isolate, "v8::CpuProfileNode::GetScriptResourceName"); | 5024 IsDeadCheck(isolate, "v8::CpuProfileNode::GetScriptResourceName"); |
5024 const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this); | 5025 const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this); |
5025 return Handle<String>(ToApi<String>(FACTORY->LookupAsciiSymbol( | 5026 return Handle<String>(ToApi<String>(isolate->factory()->LookupAsciiSymbol( |
5026 node->entry()->resource_name()))); | 5027 node->entry()->resource_name()))); |
5027 } | 5028 } |
5028 | 5029 |
5029 | 5030 |
5030 int CpuProfileNode::GetLineNumber() const { | 5031 int CpuProfileNode::GetLineNumber() const { |
5031 i::Isolate* isolate = i::Isolate::Current(); | 5032 i::Isolate* isolate = i::Isolate::Current(); |
5032 IsDeadCheck(isolate, "v8::CpuProfileNode::GetLineNumber"); | 5033 IsDeadCheck(isolate, "v8::CpuProfileNode::GetLineNumber"); |
5033 return reinterpret_cast<const i::ProfileNode*>(this)->entry()->line_number(); | 5034 return reinterpret_cast<const i::ProfileNode*>(this)->entry()->line_number(); |
5034 } | 5035 } |
5035 | 5036 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5101 i::Isolate* isolate = i::Isolate::Current(); | 5102 i::Isolate* isolate = i::Isolate::Current(); |
5102 IsDeadCheck(isolate, "v8::CpuProfile::GetUid"); | 5103 IsDeadCheck(isolate, "v8::CpuProfile::GetUid"); |
5103 return reinterpret_cast<const i::CpuProfile*>(this)->uid(); | 5104 return reinterpret_cast<const i::CpuProfile*>(this)->uid(); |
5104 } | 5105 } |
5105 | 5106 |
5106 | 5107 |
5107 Handle<String> CpuProfile::GetTitle() const { | 5108 Handle<String> CpuProfile::GetTitle() const { |
5108 i::Isolate* isolate = i::Isolate::Current(); | 5109 i::Isolate* isolate = i::Isolate::Current(); |
5109 IsDeadCheck(isolate, "v8::CpuProfile::GetTitle"); | 5110 IsDeadCheck(isolate, "v8::CpuProfile::GetTitle"); |
5110 const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this); | 5111 const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this); |
5111 return Handle<String>(ToApi<String>(FACTORY->LookupAsciiSymbol( | 5112 return Handle<String>(ToApi<String>(isolate->factory()->LookupAsciiSymbol( |
5112 profile->title()))); | 5113 profile->title()))); |
5113 } | 5114 } |
5114 | 5115 |
5115 | 5116 |
5116 const CpuProfileNode* CpuProfile::GetBottomUpRoot() const { | 5117 const CpuProfileNode* CpuProfile::GetBottomUpRoot() const { |
5117 i::Isolate* isolate = i::Isolate::Current(); | 5118 i::Isolate* isolate = i::Isolate::Current(); |
5118 IsDeadCheck(isolate, "v8::CpuProfile::GetBottomUpRoot"); | 5119 IsDeadCheck(isolate, "v8::CpuProfile::GetBottomUpRoot"); |
5119 const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this); | 5120 const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this); |
5120 return reinterpret_cast<const CpuProfileNode*>(profile->bottom_up()->root()); | 5121 return reinterpret_cast<const CpuProfileNode*>(profile->bottom_up()->root()); |
5121 } | 5122 } |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5197 | 5198 |
5198 Handle<Value> HeapGraphEdge::GetName() const { | 5199 Handle<Value> HeapGraphEdge::GetName() const { |
5199 i::Isolate* isolate = i::Isolate::Current(); | 5200 i::Isolate* isolate = i::Isolate::Current(); |
5200 IsDeadCheck(isolate, "v8::HeapGraphEdge::GetName"); | 5201 IsDeadCheck(isolate, "v8::HeapGraphEdge::GetName"); |
5201 i::HeapGraphEdge* edge = ToInternal(this); | 5202 i::HeapGraphEdge* edge = ToInternal(this); |
5202 switch (edge->type()) { | 5203 switch (edge->type()) { |
5203 case i::HeapGraphEdge::kContextVariable: | 5204 case i::HeapGraphEdge::kContextVariable: |
5204 case i::HeapGraphEdge::kInternal: | 5205 case i::HeapGraphEdge::kInternal: |
5205 case i::HeapGraphEdge::kProperty: | 5206 case i::HeapGraphEdge::kProperty: |
5206 case i::HeapGraphEdge::kShortcut: | 5207 case i::HeapGraphEdge::kShortcut: |
5207 return Handle<String>(ToApi<String>(FACTORY->LookupAsciiSymbol( | 5208 return Handle<String>(ToApi<String>(isolate->factory()->LookupAsciiSymbol( |
5208 edge->name()))); | 5209 edge->name()))); |
5209 case i::HeapGraphEdge::kElement: | 5210 case i::HeapGraphEdge::kElement: |
5210 case i::HeapGraphEdge::kHidden: | 5211 case i::HeapGraphEdge::kHidden: |
5211 return Handle<Number>(ToApi<Number>(FACTORY->NewNumberFromInt( | 5212 return Handle<Number>(ToApi<Number>(isolate->factory()->NewNumberFromInt( |
5212 edge->index()))); | 5213 edge->index()))); |
5213 default: UNREACHABLE(); | 5214 default: UNREACHABLE(); |
5214 } | 5215 } |
5215 return ImplementationUtilities::Undefined(); | 5216 return ImplementationUtilities::Undefined(); |
5216 } | 5217 } |
5217 | 5218 |
5218 | 5219 |
5219 const HeapGraphNode* HeapGraphEdge::GetFromNode() const { | 5220 const HeapGraphNode* HeapGraphEdge::GetFromNode() const { |
5220 i::Isolate* isolate = i::Isolate::Current(); | 5221 i::Isolate* isolate = i::Isolate::Current(); |
5221 IsDeadCheck(isolate, "v8::HeapGraphEdge::GetFromNode"); | 5222 IsDeadCheck(isolate, "v8::HeapGraphEdge::GetFromNode"); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5269 HeapGraphNode::Type HeapGraphNode::GetType() const { | 5270 HeapGraphNode::Type HeapGraphNode::GetType() const { |
5270 i::Isolate* isolate = i::Isolate::Current(); | 5271 i::Isolate* isolate = i::Isolate::Current(); |
5271 IsDeadCheck(isolate, "v8::HeapGraphNode::GetType"); | 5272 IsDeadCheck(isolate, "v8::HeapGraphNode::GetType"); |
5272 return static_cast<HeapGraphNode::Type>(ToInternal(this)->type()); | 5273 return static_cast<HeapGraphNode::Type>(ToInternal(this)->type()); |
5273 } | 5274 } |
5274 | 5275 |
5275 | 5276 |
5276 Handle<String> HeapGraphNode::GetName() const { | 5277 Handle<String> HeapGraphNode::GetName() const { |
5277 i::Isolate* isolate = i::Isolate::Current(); | 5278 i::Isolate* isolate = i::Isolate::Current(); |
5278 IsDeadCheck(isolate, "v8::HeapGraphNode::GetName"); | 5279 IsDeadCheck(isolate, "v8::HeapGraphNode::GetName"); |
5279 return Handle<String>(ToApi<String>(FACTORY->LookupAsciiSymbol( | 5280 return Handle<String>(ToApi<String>(isolate->factory()->LookupAsciiSymbol( |
5280 ToInternal(this)->name()))); | 5281 ToInternal(this)->name()))); |
5281 } | 5282 } |
5282 | 5283 |
5283 | 5284 |
5284 uint64_t HeapGraphNode::GetId() const { | 5285 uint64_t HeapGraphNode::GetId() const { |
5285 i::Isolate* isolate = i::Isolate::Current(); | 5286 i::Isolate* isolate = i::Isolate::Current(); |
5286 IsDeadCheck(isolate, "v8::HeapGraphNode::GetId"); | 5287 IsDeadCheck(isolate, "v8::HeapGraphNode::GetId"); |
5287 ASSERT(ToInternal(this)->snapshot()->type() != i::HeapSnapshot::kAggregated); | 5288 ASSERT(ToInternal(this)->snapshot()->type() != i::HeapSnapshot::kAggregated); |
5288 return ToInternal(this)->id(); | 5289 return ToInternal(this)->id(); |
5289 } | 5290 } |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5411 unsigned HeapSnapshot::GetUid() const { | 5412 unsigned HeapSnapshot::GetUid() const { |
5412 i::Isolate* isolate = i::Isolate::Current(); | 5413 i::Isolate* isolate = i::Isolate::Current(); |
5413 IsDeadCheck(isolate, "v8::HeapSnapshot::GetUid"); | 5414 IsDeadCheck(isolate, "v8::HeapSnapshot::GetUid"); |
5414 return ToInternal(this)->uid(); | 5415 return ToInternal(this)->uid(); |
5415 } | 5416 } |
5416 | 5417 |
5417 | 5418 |
5418 Handle<String> HeapSnapshot::GetTitle() const { | 5419 Handle<String> HeapSnapshot::GetTitle() const { |
5419 i::Isolate* isolate = i::Isolate::Current(); | 5420 i::Isolate* isolate = i::Isolate::Current(); |
5420 IsDeadCheck(isolate, "v8::HeapSnapshot::GetTitle"); | 5421 IsDeadCheck(isolate, "v8::HeapSnapshot::GetTitle"); |
5421 return Handle<String>(ToApi<String>(FACTORY->LookupAsciiSymbol( | 5422 return Handle<String>(ToApi<String>(isolate->factory()->LookupAsciiSymbol( |
5422 ToInternal(this)->title()))); | 5423 ToInternal(this)->title()))); |
5423 } | 5424 } |
5424 | 5425 |
5425 | 5426 |
5426 const HeapGraphNode* HeapSnapshot::GetRoot() const { | 5427 const HeapGraphNode* HeapSnapshot::GetRoot() const { |
5427 i::Isolate* isolate = i::Isolate::Current(); | 5428 i::Isolate* isolate = i::Isolate::Current(); |
5428 IsDeadCheck(isolate, "v8::HeapSnapshot::GetHead"); | 5429 IsDeadCheck(isolate, "v8::HeapSnapshot::GetHead"); |
5429 return reinterpret_cast<const HeapGraphNode*>(ToInternal(this)->root()); | 5430 return reinterpret_cast<const HeapGraphNode*>(ToInternal(this)->root()); |
5430 } | 5431 } |
5431 | 5432 |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5654 | 5655 |
5655 | 5656 |
5656 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 5657 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
5657 HandleScopeImplementer* thread_local = | 5658 HandleScopeImplementer* thread_local = |
5658 reinterpret_cast<HandleScopeImplementer*>(storage); | 5659 reinterpret_cast<HandleScopeImplementer*>(storage); |
5659 thread_local->IterateThis(v); | 5660 thread_local->IterateThis(v); |
5660 return storage + ArchiveSpacePerThread(); | 5661 return storage + ArchiveSpacePerThread(); |
5661 } | 5662 } |
5662 | 5663 |
5663 } } // namespace v8::internal | 5664 } } // namespace v8::internal |
OLD | NEW |