OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1772 } | 1772 } |
1773 | 1773 |
1774 | 1774 |
1775 v8::Local<Value> v8::TryCatch::StackTrace() const { | 1775 v8::Local<Value> v8::TryCatch::StackTrace() const { |
1776 ASSERT(isolate_ == i::Isolate::Current()); | 1776 ASSERT(isolate_ == i::Isolate::Current()); |
1777 if (HasCaught()) { | 1777 if (HasCaught()) { |
1778 i::Object* raw_obj = reinterpret_cast<i::Object*>(exception_); | 1778 i::Object* raw_obj = reinterpret_cast<i::Object*>(exception_); |
1779 if (!raw_obj->IsJSObject()) return v8::Local<Value>(); | 1779 if (!raw_obj->IsJSObject()) return v8::Local<Value>(); |
1780 i::HandleScope scope(isolate_); | 1780 i::HandleScope scope(isolate_); |
1781 i::Handle<i::JSObject> obj(i::JSObject::cast(raw_obj), isolate_); | 1781 i::Handle<i::JSObject> obj(i::JSObject::cast(raw_obj), isolate_); |
1782 i::Handle<i::String> name = isolate_->factory()->stack_symbol(); | 1782 i::Handle<i::String> name = isolate_->factory()->stack_string(); |
1783 if (!obj->HasProperty(*name)) return v8::Local<Value>(); | 1783 if (!obj->HasProperty(*name)) return v8::Local<Value>(); |
1784 i::Handle<i::Object> value = i::GetProperty(obj, name); | 1784 i::Handle<i::Object> value = i::GetProperty(obj, name); |
1785 if (value.is_null()) return v8::Local<Value>(); | 1785 if (value.is_null()) return v8::Local<Value>(); |
1786 return v8::Utils::ToLocal(scope.CloseAndEscape(value)); | 1786 return v8::Utils::ToLocal(scope.CloseAndEscape(value)); |
1787 } else { | 1787 } else { |
1788 return v8::Local<Value>(); | 1788 return v8::Local<Value>(); |
1789 } | 1789 } |
1790 } | 1790 } |
1791 | 1791 |
1792 | 1792 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1883 return scope.Close(Utils::StackTraceToLocal(stackTrace)); | 1883 return scope.Close(Utils::StackTraceToLocal(stackTrace)); |
1884 } | 1884 } |
1885 | 1885 |
1886 | 1886 |
1887 static i::Handle<i::Object> CallV8HeapFunction(const char* name, | 1887 static i::Handle<i::Object> CallV8HeapFunction(const char* name, |
1888 i::Handle<i::Object> recv, | 1888 i::Handle<i::Object> recv, |
1889 int argc, | 1889 int argc, |
1890 i::Handle<i::Object> argv[], | 1890 i::Handle<i::Object> argv[], |
1891 bool* has_pending_exception) { | 1891 bool* has_pending_exception) { |
1892 i::Isolate* isolate = i::Isolate::Current(); | 1892 i::Isolate* isolate = i::Isolate::Current(); |
1893 i::Handle<i::String> fmt_str = isolate->factory()->LookupUtf8Symbol(name); | 1893 i::Handle<i::String> fmt_str = |
| 1894 isolate->factory()->InternalizeUtf8String(name); |
1894 i::Object* object_fun = | 1895 i::Object* object_fun = |
1895 isolate->js_builtins_object()->GetPropertyNoExceptionThrown(*fmt_str); | 1896 isolate->js_builtins_object()->GetPropertyNoExceptionThrown(*fmt_str); |
1896 i::Handle<i::JSFunction> fun = | 1897 i::Handle<i::JSFunction> fun = |
1897 i::Handle<i::JSFunction>(i::JSFunction::cast(object_fun)); | 1898 i::Handle<i::JSFunction>(i::JSFunction::cast(object_fun)); |
1898 i::Handle<i::Object> value = | 1899 i::Handle<i::Object> value = |
1899 i::Execution::Call(fun, recv, argc, argv, has_pending_exception); | 1900 i::Execution::Call(fun, recv, argc, argv, has_pending_exception); |
1900 return value; | 1901 return value; |
1901 } | 1902 } |
1902 | 1903 |
1903 | 1904 |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2276 return i::FastUI2D(i::FastD2UI(value)) == value; | 2277 return i::FastUI2D(i::FastD2UI(value)) == value; |
2277 } | 2278 } |
2278 return false; | 2279 return false; |
2279 } | 2280 } |
2280 | 2281 |
2281 | 2282 |
2282 bool Value::IsDate() const { | 2283 bool Value::IsDate() const { |
2283 i::Isolate* isolate = i::Isolate::Current(); | 2284 i::Isolate* isolate = i::Isolate::Current(); |
2284 if (IsDeadCheck(isolate, "v8::Value::IsDate()")) return false; | 2285 if (IsDeadCheck(isolate, "v8::Value::IsDate()")) return false; |
2285 i::Handle<i::Object> obj = Utils::OpenHandle(this); | 2286 i::Handle<i::Object> obj = Utils::OpenHandle(this); |
2286 return obj->HasSpecificClassOf(isolate->heap()->Date_symbol()); | 2287 return obj->HasSpecificClassOf(isolate->heap()->Date_string()); |
2287 } | 2288 } |
2288 | 2289 |
2289 | 2290 |
2290 bool Value::IsStringObject() const { | 2291 bool Value::IsStringObject() const { |
2291 i::Isolate* isolate = i::Isolate::Current(); | 2292 i::Isolate* isolate = i::Isolate::Current(); |
2292 if (IsDeadCheck(isolate, "v8::Value::IsStringObject()")) return false; | 2293 if (IsDeadCheck(isolate, "v8::Value::IsStringObject()")) return false; |
2293 i::Handle<i::Object> obj = Utils::OpenHandle(this); | 2294 i::Handle<i::Object> obj = Utils::OpenHandle(this); |
2294 return obj->HasSpecificClassOf(isolate->heap()->String_symbol()); | 2295 return obj->HasSpecificClassOf(isolate->heap()->String_string()); |
2295 } | 2296 } |
2296 | 2297 |
2297 | 2298 |
2298 bool Value::IsNumberObject() const { | 2299 bool Value::IsNumberObject() const { |
2299 i::Isolate* isolate = i::Isolate::Current(); | 2300 i::Isolate* isolate = i::Isolate::Current(); |
2300 if (IsDeadCheck(isolate, "v8::Value::IsNumberObject()")) return false; | 2301 if (IsDeadCheck(isolate, "v8::Value::IsNumberObject()")) return false; |
2301 i::Handle<i::Object> obj = Utils::OpenHandle(this); | 2302 i::Handle<i::Object> obj = Utils::OpenHandle(this); |
2302 return obj->HasSpecificClassOf(isolate->heap()->Number_symbol()); | 2303 return obj->HasSpecificClassOf(isolate->heap()->Number_string()); |
2303 } | 2304 } |
2304 | 2305 |
2305 | 2306 |
2306 static i::Object* LookupBuiltin(i::Isolate* isolate, | 2307 static i::Object* LookupBuiltin(i::Isolate* isolate, |
2307 const char* builtin_name) { | 2308 const char* builtin_name) { |
2308 i::Handle<i::String> symbol = | 2309 i::Handle<i::String> string = |
2309 isolate->factory()->LookupUtf8Symbol(builtin_name); | 2310 isolate->factory()->InternalizeUtf8String(builtin_name); |
2310 i::Handle<i::JSBuiltinsObject> builtins = isolate->js_builtins_object(); | 2311 i::Handle<i::JSBuiltinsObject> builtins = isolate->js_builtins_object(); |
2311 return builtins->GetPropertyNoExceptionThrown(*symbol); | 2312 return builtins->GetPropertyNoExceptionThrown(*string); |
2312 } | 2313 } |
2313 | 2314 |
2314 | 2315 |
2315 static bool CheckConstructor(i::Isolate* isolate, | 2316 static bool CheckConstructor(i::Isolate* isolate, |
2316 i::Handle<i::JSObject> obj, | 2317 i::Handle<i::JSObject> obj, |
2317 const char* class_name) { | 2318 const char* class_name) { |
2318 i::Object* constr = obj->map()->constructor(); | 2319 i::Object* constr = obj->map()->constructor(); |
2319 if (!constr->IsJSFunction()) return false; | 2320 if (!constr->IsJSFunction()) return false; |
2320 i::JSFunction* func = i::JSFunction::cast(constr); | 2321 i::JSFunction* func = i::JSFunction::cast(constr); |
2321 return func->shared()->native() && | 2322 return func->shared()->native() && |
(...skipping 17 matching lines...) Expand all Loading... |
2339 } else { | 2340 } else { |
2340 return false; | 2341 return false; |
2341 } | 2342 } |
2342 } | 2343 } |
2343 | 2344 |
2344 | 2345 |
2345 bool Value::IsBooleanObject() const { | 2346 bool Value::IsBooleanObject() const { |
2346 i::Isolate* isolate = i::Isolate::Current(); | 2347 i::Isolate* isolate = i::Isolate::Current(); |
2347 if (IsDeadCheck(isolate, "v8::Value::IsBooleanObject()")) return false; | 2348 if (IsDeadCheck(isolate, "v8::Value::IsBooleanObject()")) return false; |
2348 i::Handle<i::Object> obj = Utils::OpenHandle(this); | 2349 i::Handle<i::Object> obj = Utils::OpenHandle(this); |
2349 return obj->HasSpecificClassOf(isolate->heap()->Boolean_symbol()); | 2350 return obj->HasSpecificClassOf(isolate->heap()->Boolean_string()); |
2350 } | 2351 } |
2351 | 2352 |
2352 | 2353 |
2353 bool Value::IsRegExp() const { | 2354 bool Value::IsRegExp() const { |
2354 if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsRegExp()")) return false; | 2355 if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsRegExp()")) return false; |
2355 i::Handle<i::Object> obj = Utils::OpenHandle(this); | 2356 i::Handle<i::Object> obj = Utils::OpenHandle(this); |
2356 return obj->IsJSRegExp(); | 2357 return obj->IsJSRegExp(); |
2357 } | 2358 } |
2358 | 2359 |
2359 | 2360 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2531 ApiCheck(obj->IsJSArray(), | 2532 ApiCheck(obj->IsJSArray(), |
2532 "v8::Array::Cast()", | 2533 "v8::Array::Cast()", |
2533 "Could not convert to array"); | 2534 "Could not convert to array"); |
2534 } | 2535 } |
2535 | 2536 |
2536 | 2537 |
2537 void v8::Date::CheckCast(v8::Value* that) { | 2538 void v8::Date::CheckCast(v8::Value* that) { |
2538 i::Isolate* isolate = i::Isolate::Current(); | 2539 i::Isolate* isolate = i::Isolate::Current(); |
2539 if (IsDeadCheck(isolate, "v8::Date::Cast()")) return; | 2540 if (IsDeadCheck(isolate, "v8::Date::Cast()")) return; |
2540 i::Handle<i::Object> obj = Utils::OpenHandle(that); | 2541 i::Handle<i::Object> obj = Utils::OpenHandle(that); |
2541 ApiCheck(obj->HasSpecificClassOf(isolate->heap()->Date_symbol()), | 2542 ApiCheck(obj->HasSpecificClassOf(isolate->heap()->Date_string()), |
2542 "v8::Date::Cast()", | 2543 "v8::Date::Cast()", |
2543 "Could not convert to date"); | 2544 "Could not convert to date"); |
2544 } | 2545 } |
2545 | 2546 |
2546 | 2547 |
2547 void v8::StringObject::CheckCast(v8::Value* that) { | 2548 void v8::StringObject::CheckCast(v8::Value* that) { |
2548 i::Isolate* isolate = i::Isolate::Current(); | 2549 i::Isolate* isolate = i::Isolate::Current(); |
2549 if (IsDeadCheck(isolate, "v8::StringObject::Cast()")) return; | 2550 if (IsDeadCheck(isolate, "v8::StringObject::Cast()")) return; |
2550 i::Handle<i::Object> obj = Utils::OpenHandle(that); | 2551 i::Handle<i::Object> obj = Utils::OpenHandle(that); |
2551 ApiCheck(obj->HasSpecificClassOf(isolate->heap()->String_symbol()), | 2552 ApiCheck(obj->HasSpecificClassOf(isolate->heap()->String_string()), |
2552 "v8::StringObject::Cast()", | 2553 "v8::StringObject::Cast()", |
2553 "Could not convert to StringObject"); | 2554 "Could not convert to StringObject"); |
2554 } | 2555 } |
2555 | 2556 |
2556 | 2557 |
2557 void v8::NumberObject::CheckCast(v8::Value* that) { | 2558 void v8::NumberObject::CheckCast(v8::Value* that) { |
2558 i::Isolate* isolate = i::Isolate::Current(); | 2559 i::Isolate* isolate = i::Isolate::Current(); |
2559 if (IsDeadCheck(isolate, "v8::NumberObject::Cast()")) return; | 2560 if (IsDeadCheck(isolate, "v8::NumberObject::Cast()")) return; |
2560 i::Handle<i::Object> obj = Utils::OpenHandle(that); | 2561 i::Handle<i::Object> obj = Utils::OpenHandle(that); |
2561 ApiCheck(obj->HasSpecificClassOf(isolate->heap()->Number_symbol()), | 2562 ApiCheck(obj->HasSpecificClassOf(isolate->heap()->Number_string()), |
2562 "v8::NumberObject::Cast()", | 2563 "v8::NumberObject::Cast()", |
2563 "Could not convert to NumberObject"); | 2564 "Could not convert to NumberObject"); |
2564 } | 2565 } |
2565 | 2566 |
2566 | 2567 |
2567 void v8::BooleanObject::CheckCast(v8::Value* that) { | 2568 void v8::BooleanObject::CheckCast(v8::Value* that) { |
2568 i::Isolate* isolate = i::Isolate::Current(); | 2569 i::Isolate* isolate = i::Isolate::Current(); |
2569 if (IsDeadCheck(isolate, "v8::BooleanObject::Cast()")) return; | 2570 if (IsDeadCheck(isolate, "v8::BooleanObject::Cast()")) return; |
2570 i::Handle<i::Object> obj = Utils::OpenHandle(that); | 2571 i::Handle<i::Object> obj = Utils::OpenHandle(that); |
2571 ApiCheck(obj->HasSpecificClassOf(isolate->heap()->Boolean_symbol()), | 2572 ApiCheck(obj->HasSpecificClassOf(isolate->heap()->Boolean_string()), |
2572 "v8::BooleanObject::Cast()", | 2573 "v8::BooleanObject::Cast()", |
2573 "Could not convert to BooleanObject"); | 2574 "Could not convert to BooleanObject"); |
2574 } | 2575 } |
2575 | 2576 |
2576 | 2577 |
2577 void v8::RegExp::CheckCast(v8::Value* that) { | 2578 void v8::RegExp::CheckCast(v8::Value* that) { |
2578 if (IsDeadCheck(i::Isolate::Current(), "v8::RegExp::Cast()")) return; | 2579 if (IsDeadCheck(i::Isolate::Current(), "v8::RegExp::Cast()")) return; |
2579 i::Handle<i::Object> obj = Utils::OpenHandle(that); | 2580 i::Handle<i::Object> obj = Utils::OpenHandle(that); |
2580 ApiCheck(obj->IsJSRegExp(), | 2581 ApiCheck(obj->IsJSRegExp(), |
2581 "v8::RegExp::Cast()", | 2582 "v8::RegExp::Cast()", |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3351 | 3352 |
3352 bool v8::Object::SetHiddenValue(v8::Handle<v8::String> key, | 3353 bool v8::Object::SetHiddenValue(v8::Handle<v8::String> key, |
3353 v8::Handle<v8::Value> value) { | 3354 v8::Handle<v8::Value> value) { |
3354 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3355 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3355 ON_BAILOUT(isolate, "v8::Object::SetHiddenValue()", return false); | 3356 ON_BAILOUT(isolate, "v8::Object::SetHiddenValue()", return false); |
3356 if (value.IsEmpty()) return DeleteHiddenValue(key); | 3357 if (value.IsEmpty()) return DeleteHiddenValue(key); |
3357 ENTER_V8(isolate); | 3358 ENTER_V8(isolate); |
3358 i::HandleScope scope(isolate); | 3359 i::HandleScope scope(isolate); |
3359 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 3360 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
3360 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); | 3361 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); |
3361 i::Handle<i::String> key_symbol = FACTORY->LookupSymbol(key_obj); | 3362 i::Handle<i::String> key_string = FACTORY->InternalizeString(key_obj); |
3362 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); | 3363 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); |
3363 i::Handle<i::Object> result = | 3364 i::Handle<i::Object> result = |
3364 i::JSObject::SetHiddenProperty(self, key_symbol, value_obj); | 3365 i::JSObject::SetHiddenProperty(self, key_string, value_obj); |
3365 return *result == *self; | 3366 return *result == *self; |
3366 } | 3367 } |
3367 | 3368 |
3368 | 3369 |
3369 v8::Local<v8::Value> v8::Object::GetHiddenValue(v8::Handle<v8::String> key) { | 3370 v8::Local<v8::Value> v8::Object::GetHiddenValue(v8::Handle<v8::String> key) { |
3370 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3371 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3371 ON_BAILOUT(isolate, "v8::Object::GetHiddenValue()", | 3372 ON_BAILOUT(isolate, "v8::Object::GetHiddenValue()", |
3372 return Local<v8::Value>()); | 3373 return Local<v8::Value>()); |
3373 ENTER_V8(isolate); | 3374 ENTER_V8(isolate); |
3374 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 3375 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
3375 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); | 3376 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); |
3376 i::Handle<i::String> key_symbol = FACTORY->LookupSymbol(key_obj); | 3377 i::Handle<i::String> key_string = FACTORY->InternalizeString(key_obj); |
3377 i::Handle<i::Object> result(self->GetHiddenProperty(*key_symbol), isolate); | 3378 i::Handle<i::Object> result(self->GetHiddenProperty(*key_string), isolate); |
3378 if (result->IsUndefined()) return v8::Local<v8::Value>(); | 3379 if (result->IsUndefined()) return v8::Local<v8::Value>(); |
3379 return Utils::ToLocal(result); | 3380 return Utils::ToLocal(result); |
3380 } | 3381 } |
3381 | 3382 |
3382 | 3383 |
3383 bool v8::Object::DeleteHiddenValue(v8::Handle<v8::String> key) { | 3384 bool v8::Object::DeleteHiddenValue(v8::Handle<v8::String> key) { |
3384 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3385 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3385 ON_BAILOUT(isolate, "v8::DeleteHiddenValue()", return false); | 3386 ON_BAILOUT(isolate, "v8::DeleteHiddenValue()", return false); |
3386 ENTER_V8(isolate); | 3387 ENTER_V8(isolate); |
3387 i::HandleScope scope(isolate); | 3388 i::HandleScope scope(isolate); |
3388 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 3389 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
3389 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); | 3390 i::Handle<i::String> key_obj = Utils::OpenHandle(*key); |
3390 i::Handle<i::String> key_symbol = FACTORY->LookupSymbol(key_obj); | 3391 i::Handle<i::String> key_string = FACTORY->InternalizeString(key_obj); |
3391 self->DeleteHiddenProperty(*key_symbol); | 3392 self->DeleteHiddenProperty(*key_string); |
3392 return true; | 3393 return true; |
3393 } | 3394 } |
3394 | 3395 |
3395 | 3396 |
3396 namespace { | 3397 namespace { |
3397 | 3398 |
3398 static i::ElementsKind GetElementsKindFromExternalArrayType( | 3399 static i::ElementsKind GetElementsKindFromExternalArrayType( |
3399 ExternalArrayType array_type) { | 3400 ExternalArrayType array_type) { |
3400 switch (array_type) { | 3401 switch (array_type) { |
3401 case kExternalByteArray: | 3402 case kExternalByteArray: |
(...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4815 return ExternalValue(*Utils::OpenHandle(this)); | 4816 return ExternalValue(*Utils::OpenHandle(this)); |
4816 } | 4817 } |
4817 | 4818 |
4818 | 4819 |
4819 Local<String> v8::String::Empty() { | 4820 Local<String> v8::String::Empty() { |
4820 i::Isolate* isolate = i::Isolate::Current(); | 4821 i::Isolate* isolate = i::Isolate::Current(); |
4821 if (!EnsureInitializedForIsolate(isolate, "v8::String::Empty()")) { | 4822 if (!EnsureInitializedForIsolate(isolate, "v8::String::Empty()")) { |
4822 return v8::Local<String>(); | 4823 return v8::Local<String>(); |
4823 } | 4824 } |
4824 LOG_API(isolate, "String::Empty()"); | 4825 LOG_API(isolate, "String::Empty()"); |
4825 return Utils::ToLocal(isolate->factory()->empty_symbol()); | 4826 return Utils::ToLocal(isolate->factory()->empty_string()); |
4826 } | 4827 } |
4827 | 4828 |
4828 | 4829 |
4829 Local<String> v8::String::New(const char* data, int length) { | 4830 Local<String> v8::String::New(const char* data, int length) { |
4830 i::Isolate* isolate = i::Isolate::Current(); | 4831 i::Isolate* isolate = i::Isolate::Current(); |
4831 EnsureInitializedForIsolate(isolate, "v8::String::New()"); | 4832 EnsureInitializedForIsolate(isolate, "v8::String::New()"); |
4832 LOG_API(isolate, "String::New(char)"); | 4833 LOG_API(isolate, "String::New(char)"); |
4833 if (length == 0) return Empty(); | 4834 if (length == 0) return Empty(); |
4834 ENTER_V8(isolate); | 4835 ENTER_V8(isolate); |
4835 if (length == -1) length = i::StrLength(data); | 4836 if (length == -1) length = i::StrLength(data); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4940 } | 4941 } |
4941 ENTER_V8(isolate); | 4942 ENTER_V8(isolate); |
4942 if (isolate->string_tracker()->IsFreshUnusedString(obj)) { | 4943 if (isolate->string_tracker()->IsFreshUnusedString(obj)) { |
4943 return false; | 4944 return false; |
4944 } | 4945 } |
4945 if (isolate->heap()->IsInGCPostProcessing()) { | 4946 if (isolate->heap()->IsInGCPostProcessing()) { |
4946 return false; | 4947 return false; |
4947 } | 4948 } |
4948 CHECK(resource && resource->data()); | 4949 CHECK(resource && resource->data()); |
4949 bool result = obj->MakeExternal(resource); | 4950 bool result = obj->MakeExternal(resource); |
4950 if (result && !obj->IsSymbol()) { | 4951 if (result && !obj->IsInternalizedString()) { |
4951 isolate->heap()->external_string_table()->AddString(*obj); | 4952 isolate->heap()->external_string_table()->AddString(*obj); |
4952 } | 4953 } |
4953 return result; | 4954 return result; |
4954 } | 4955 } |
4955 | 4956 |
4956 | 4957 |
4957 Local<String> v8::String::NewExternal( | 4958 Local<String> v8::String::NewExternal( |
4958 v8::String::ExternalAsciiStringResource* resource) { | 4959 v8::String::ExternalAsciiStringResource* resource) { |
4959 i::Isolate* isolate = i::Isolate::Current(); | 4960 i::Isolate* isolate = i::Isolate::Current(); |
4960 EnsureInitializedForIsolate(isolate, "v8::String::NewExternal()"); | 4961 EnsureInitializedForIsolate(isolate, "v8::String::NewExternal()"); |
(...skipping 16 matching lines...) Expand all Loading... |
4977 } | 4978 } |
4978 ENTER_V8(isolate); | 4979 ENTER_V8(isolate); |
4979 if (isolate->string_tracker()->IsFreshUnusedString(obj)) { | 4980 if (isolate->string_tracker()->IsFreshUnusedString(obj)) { |
4980 return false; | 4981 return false; |
4981 } | 4982 } |
4982 if (isolate->heap()->IsInGCPostProcessing()) { | 4983 if (isolate->heap()->IsInGCPostProcessing()) { |
4983 return false; | 4984 return false; |
4984 } | 4985 } |
4985 CHECK(resource && resource->data()); | 4986 CHECK(resource && resource->data()); |
4986 bool result = obj->MakeExternal(resource); | 4987 bool result = obj->MakeExternal(resource); |
4987 if (result && !obj->IsSymbol()) { | 4988 if (result && !obj->IsInternalizedString()) { |
4988 isolate->heap()->external_string_table()->AddString(*obj); | 4989 isolate->heap()->external_string_table()->AddString(*obj); |
4989 } | 4990 } |
4990 return result; | 4991 return result; |
4991 } | 4992 } |
4992 | 4993 |
4993 | 4994 |
4994 bool v8::String::CanMakeExternal() { | 4995 bool v8::String::CanMakeExternal() { |
4995 if (!internal::FLAG_clever_optimizations) return false; | 4996 if (!internal::FLAG_clever_optimizations) return false; |
4996 i::Handle<i::String> obj = Utils::OpenHandle(this); | 4997 i::Handle<i::String> obj = Utils::OpenHandle(this); |
4997 i::Isolate* isolate = obj->GetIsolate(); | 4998 i::Isolate* isolate = obj->GetIsolate(); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5113 i::Isolate* isolate = i::Isolate::Current(); | 5114 i::Isolate* isolate = i::Isolate::Current(); |
5114 ON_BAILOUT(isolate, "v8::Date::DateTimeConfigurationChangeNotification()", | 5115 ON_BAILOUT(isolate, "v8::Date::DateTimeConfigurationChangeNotification()", |
5115 return); | 5116 return); |
5116 LOG_API(isolate, "Date::DateTimeConfigurationChangeNotification"); | 5117 LOG_API(isolate, "Date::DateTimeConfigurationChangeNotification"); |
5117 ENTER_V8(isolate); | 5118 ENTER_V8(isolate); |
5118 | 5119 |
5119 isolate->date_cache()->ResetDateCache(); | 5120 isolate->date_cache()->ResetDateCache(); |
5120 | 5121 |
5121 i::HandleScope scope(isolate); | 5122 i::HandleScope scope(isolate); |
5122 // Get the function ResetDateCache (defined in date.js). | 5123 // Get the function ResetDateCache (defined in date.js). |
5123 i::Handle<i::String> func_name_str = isolate->factory()->LookupOneByteSymbol( | 5124 i::Handle<i::String> func_name_str = |
5124 STATIC_ASCII_VECTOR("ResetDateCache")); | 5125 isolate->factory()->InternalizeOneByteString( |
| 5126 STATIC_ASCII_VECTOR("ResetDateCache")); |
5125 i::MaybeObject* result = | 5127 i::MaybeObject* result = |
5126 isolate->js_builtins_object()->GetProperty(*func_name_str); | 5128 isolate->js_builtins_object()->GetProperty(*func_name_str); |
5127 i::Object* object_func; | 5129 i::Object* object_func; |
5128 if (!result->ToObject(&object_func)) { | 5130 if (!result->ToObject(&object_func)) { |
5129 return; | 5131 return; |
5130 } | 5132 } |
5131 | 5133 |
5132 if (object_func->IsJSFunction()) { | 5134 if (object_func->IsJSFunction()) { |
5133 i::Handle<i::JSFunction> func = | 5135 i::Handle<i::JSFunction> func = |
5134 i::Handle<i::JSFunction>(i::JSFunction::cast(object_func)); | 5136 i::Handle<i::JSFunction>(i::JSFunction::cast(object_func)); |
5135 | 5137 |
5136 // Call ResetDateCache(0 but expect no exceptions: | 5138 // Call ResetDateCache(0 but expect no exceptions: |
5137 bool caught_exception = false; | 5139 bool caught_exception = false; |
5138 i::Execution::TryCall(func, | 5140 i::Execution::TryCall(func, |
5139 isolate->js_builtins_object(), | 5141 isolate->js_builtins_object(), |
5140 0, | 5142 0, |
5141 NULL, | 5143 NULL, |
5142 &caught_exception); | 5144 &caught_exception); |
5143 } | 5145 } |
5144 } | 5146 } |
5145 | 5147 |
5146 | 5148 |
5147 static i::Handle<i::String> RegExpFlagsToString(RegExp::Flags flags) { | 5149 static i::Handle<i::String> RegExpFlagsToString(RegExp::Flags flags) { |
5148 uint8_t flags_buf[3]; | 5150 uint8_t flags_buf[3]; |
5149 int num_flags = 0; | 5151 int num_flags = 0; |
5150 if ((flags & RegExp::kGlobal) != 0) flags_buf[num_flags++] = 'g'; | 5152 if ((flags & RegExp::kGlobal) != 0) flags_buf[num_flags++] = 'g'; |
5151 if ((flags & RegExp::kMultiline) != 0) flags_buf[num_flags++] = 'm'; | 5153 if ((flags & RegExp::kMultiline) != 0) flags_buf[num_flags++] = 'm'; |
5152 if ((flags & RegExp::kIgnoreCase) != 0) flags_buf[num_flags++] = 'i'; | 5154 if ((flags & RegExp::kIgnoreCase) != 0) flags_buf[num_flags++] = 'i'; |
5153 ASSERT(num_flags <= static_cast<int>(ARRAY_SIZE(flags_buf))); | 5155 ASSERT(num_flags <= static_cast<int>(ARRAY_SIZE(flags_buf))); |
5154 return FACTORY->LookupOneByteSymbol( | 5156 return FACTORY->InternalizeOneByteString( |
5155 i::Vector<const uint8_t>(flags_buf, num_flags)); | 5157 i::Vector<const uint8_t>(flags_buf, num_flags)); |
5156 } | 5158 } |
5157 | 5159 |
5158 | 5160 |
5159 Local<v8::RegExp> v8::RegExp::New(Handle<String> pattern, | 5161 Local<v8::RegExp> v8::RegExp::New(Handle<String> pattern, |
5160 Flags flags) { | 5162 Flags flags) { |
5161 i::Isolate* isolate = Utils::OpenHandle(*pattern)->GetIsolate(); | 5163 i::Isolate* isolate = Utils::OpenHandle(*pattern)->GetIsolate(); |
5162 EnsureInitializedForIsolate(isolate, "v8::RegExp::New()"); | 5164 EnsureInitializedForIsolate(isolate, "v8::RegExp::New()"); |
5163 LOG_API(isolate, "RegExp::New"); | 5165 LOG_API(isolate, "RegExp::New"); |
5164 ENTER_V8(isolate); | 5166 ENTER_V8(isolate); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5249 return Utils::ToLocal(result); | 5251 return Utils::ToLocal(result); |
5250 } | 5252 } |
5251 | 5253 |
5252 | 5254 |
5253 Local<String> v8::String::NewSymbol(const char* data, int length) { | 5255 Local<String> v8::String::NewSymbol(const char* data, int length) { |
5254 i::Isolate* isolate = i::Isolate::Current(); | 5256 i::Isolate* isolate = i::Isolate::Current(); |
5255 EnsureInitializedForIsolate(isolate, "v8::String::NewSymbol()"); | 5257 EnsureInitializedForIsolate(isolate, "v8::String::NewSymbol()"); |
5256 LOG_API(isolate, "String::NewSymbol(char)"); | 5258 LOG_API(isolate, "String::NewSymbol(char)"); |
5257 ENTER_V8(isolate); | 5259 ENTER_V8(isolate); |
5258 if (length == -1) length = i::StrLength(data); | 5260 if (length == -1) length = i::StrLength(data); |
5259 i::Handle<i::String> result = isolate->factory()->LookupUtf8Symbol( | 5261 i::Handle<i::String> result = isolate->factory()->InternalizeUtf8String( |
5260 i::Vector<const char>(data, length)); | 5262 i::Vector<const char>(data, length)); |
5261 return Utils::ToLocal(result); | 5263 return Utils::ToLocal(result); |
5262 } | 5264 } |
5263 | 5265 |
5264 | 5266 |
5265 Local<Number> v8::Number::New(double value) { | 5267 Local<Number> v8::Number::New(double value) { |
5266 i::Isolate* isolate = i::Isolate::Current(); | 5268 i::Isolate* isolate = i::Isolate::Current(); |
5267 EnsureInitializedForIsolate(isolate, "v8::Number::New()"); | 5269 EnsureInitializedForIsolate(isolate, "v8::Number::New()"); |
5268 if (isnan(value)) { | 5270 if (isnan(value)) { |
5269 // Introduce only canonical NaN value into the VM, to avoid signaling NaNs. | 5271 // Introduce only canonical NaN value into the VM, to avoid signaling NaNs. |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5944 | 5946 |
5945 Local<Value> Debug::GetMirror(v8::Handle<v8::Value> obj) { | 5947 Local<Value> Debug::GetMirror(v8::Handle<v8::Value> obj) { |
5946 i::Isolate* isolate = i::Isolate::Current(); | 5948 i::Isolate* isolate = i::Isolate::Current(); |
5947 if (!isolate->IsInitialized()) return Local<Value>(); | 5949 if (!isolate->IsInitialized()) return Local<Value>(); |
5948 ON_BAILOUT(isolate, "v8::Debug::GetMirror()", return Local<Value>()); | 5950 ON_BAILOUT(isolate, "v8::Debug::GetMirror()", return Local<Value>()); |
5949 ENTER_V8(isolate); | 5951 ENTER_V8(isolate); |
5950 v8::HandleScope scope; | 5952 v8::HandleScope scope; |
5951 i::Debug* isolate_debug = isolate->debug(); | 5953 i::Debug* isolate_debug = isolate->debug(); |
5952 isolate_debug->Load(); | 5954 isolate_debug->Load(); |
5953 i::Handle<i::JSObject> debug(isolate_debug->debug_context()->global_object()); | 5955 i::Handle<i::JSObject> debug(isolate_debug->debug_context()->global_object()); |
5954 i::Handle<i::String> name = isolate->factory()->LookupOneByteSymbol( | 5956 i::Handle<i::String> name = isolate->factory()->InternalizeOneByteString( |
5955 STATIC_ASCII_VECTOR("MakeMirror")); | 5957 STATIC_ASCII_VECTOR("MakeMirror")); |
5956 i::Handle<i::Object> fun_obj = i::GetProperty(debug, name); | 5958 i::Handle<i::Object> fun_obj = i::GetProperty(debug, name); |
5957 i::Handle<i::JSFunction> fun = i::Handle<i::JSFunction>::cast(fun_obj); | 5959 i::Handle<i::JSFunction> fun = i::Handle<i::JSFunction>::cast(fun_obj); |
5958 v8::Handle<v8::Function> v8_fun = Utils::ToLocal(fun); | 5960 v8::Handle<v8::Function> v8_fun = Utils::ToLocal(fun); |
5959 const int kArgc = 1; | 5961 const int kArgc = 1; |
5960 v8::Handle<v8::Value> argv[kArgc] = { obj }; | 5962 v8::Handle<v8::Value> argv[kArgc] = { obj }; |
5961 EXCEPTION_PREAMBLE(isolate); | 5963 EXCEPTION_PREAMBLE(isolate); |
5962 v8::Handle<v8::Value> result = v8_fun->Call(Utils::ToLocal(debug), | 5964 v8::Handle<v8::Value> result = v8_fun->Call(Utils::ToLocal(debug), |
5963 kArgc, | 5965 kArgc, |
5964 argv); | 5966 argv); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6007 #endif // ENABLE_DEBUGGER_SUPPORT | 6009 #endif // ENABLE_DEBUGGER_SUPPORT |
6008 | 6010 |
6009 | 6011 |
6010 Handle<String> CpuProfileNode::GetFunctionName() const { | 6012 Handle<String> CpuProfileNode::GetFunctionName() const { |
6011 i::Isolate* isolate = i::Isolate::Current(); | 6013 i::Isolate* isolate = i::Isolate::Current(); |
6012 IsDeadCheck(isolate, "v8::CpuProfileNode::GetFunctionName"); | 6014 IsDeadCheck(isolate, "v8::CpuProfileNode::GetFunctionName"); |
6013 const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this); | 6015 const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this); |
6014 const i::CodeEntry* entry = node->entry(); | 6016 const i::CodeEntry* entry = node->entry(); |
6015 if (!entry->has_name_prefix()) { | 6017 if (!entry->has_name_prefix()) { |
6016 return Handle<String>(ToApi<String>( | 6018 return Handle<String>(ToApi<String>( |
6017 isolate->factory()->LookupUtf8Symbol(entry->name()))); | 6019 isolate->factory()->InternalizeUtf8String(entry->name()))); |
6018 } else { | 6020 } else { |
6019 return Handle<String>(ToApi<String>(isolate->factory()->NewConsString( | 6021 return Handle<String>(ToApi<String>(isolate->factory()->NewConsString( |
6020 isolate->factory()->LookupUtf8Symbol(entry->name_prefix()), | 6022 isolate->factory()->InternalizeUtf8String(entry->name_prefix()), |
6021 isolate->factory()->LookupUtf8Symbol(entry->name())))); | 6023 isolate->factory()->InternalizeUtf8String(entry->name())))); |
6022 } | 6024 } |
6023 } | 6025 } |
6024 | 6026 |
6025 | 6027 |
6026 Handle<String> CpuProfileNode::GetScriptResourceName() const { | 6028 Handle<String> CpuProfileNode::GetScriptResourceName() const { |
6027 i::Isolate* isolate = i::Isolate::Current(); | 6029 i::Isolate* isolate = i::Isolate::Current(); |
6028 IsDeadCheck(isolate, "v8::CpuProfileNode::GetScriptResourceName"); | 6030 IsDeadCheck(isolate, "v8::CpuProfileNode::GetScriptResourceName"); |
6029 const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this); | 6031 const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this); |
6030 return Handle<String>(ToApi<String>(isolate->factory()->LookupUtf8Symbol( | 6032 return Handle<String>(ToApi<String>(isolate->factory()->InternalizeUtf8String( |
6031 node->entry()->resource_name()))); | 6033 node->entry()->resource_name()))); |
6032 } | 6034 } |
6033 | 6035 |
6034 | 6036 |
6035 int CpuProfileNode::GetLineNumber() const { | 6037 int CpuProfileNode::GetLineNumber() const { |
6036 i::Isolate* isolate = i::Isolate::Current(); | 6038 i::Isolate* isolate = i::Isolate::Current(); |
6037 IsDeadCheck(isolate, "v8::CpuProfileNode::GetLineNumber"); | 6039 IsDeadCheck(isolate, "v8::CpuProfileNode::GetLineNumber"); |
6038 return reinterpret_cast<const i::ProfileNode*>(this)->entry()->line_number(); | 6040 return reinterpret_cast<const i::ProfileNode*>(this)->entry()->line_number(); |
6039 } | 6041 } |
6040 | 6042 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6106 i::Isolate* isolate = i::Isolate::Current(); | 6108 i::Isolate* isolate = i::Isolate::Current(); |
6107 IsDeadCheck(isolate, "v8::CpuProfile::GetUid"); | 6109 IsDeadCheck(isolate, "v8::CpuProfile::GetUid"); |
6108 return reinterpret_cast<const i::CpuProfile*>(this)->uid(); | 6110 return reinterpret_cast<const i::CpuProfile*>(this)->uid(); |
6109 } | 6111 } |
6110 | 6112 |
6111 | 6113 |
6112 Handle<String> CpuProfile::GetTitle() const { | 6114 Handle<String> CpuProfile::GetTitle() const { |
6113 i::Isolate* isolate = i::Isolate::Current(); | 6115 i::Isolate* isolate = i::Isolate::Current(); |
6114 IsDeadCheck(isolate, "v8::CpuProfile::GetTitle"); | 6116 IsDeadCheck(isolate, "v8::CpuProfile::GetTitle"); |
6115 const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this); | 6117 const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this); |
6116 return Handle<String>(ToApi<String>(isolate->factory()->LookupUtf8Symbol( | 6118 return Handle<String>(ToApi<String>(isolate->factory()->InternalizeUtf8String( |
6117 profile->title()))); | 6119 profile->title()))); |
6118 } | 6120 } |
6119 | 6121 |
6120 | 6122 |
6121 const CpuProfileNode* CpuProfile::GetBottomUpRoot() const { | 6123 const CpuProfileNode* CpuProfile::GetBottomUpRoot() const { |
6122 i::Isolate* isolate = i::Isolate::Current(); | 6124 i::Isolate* isolate = i::Isolate::Current(); |
6123 IsDeadCheck(isolate, "v8::CpuProfile::GetBottomUpRoot"); | 6125 IsDeadCheck(isolate, "v8::CpuProfile::GetBottomUpRoot"); |
6124 const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this); | 6126 const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this); |
6125 return reinterpret_cast<const CpuProfileNode*>(profile->bottom_up()->root()); | 6127 return reinterpret_cast<const CpuProfileNode*>(profile->bottom_up()->root()); |
6126 } | 6128 } |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6203 | 6205 |
6204 Handle<Value> HeapGraphEdge::GetName() const { | 6206 Handle<Value> HeapGraphEdge::GetName() const { |
6205 i::Isolate* isolate = i::Isolate::Current(); | 6207 i::Isolate* isolate = i::Isolate::Current(); |
6206 IsDeadCheck(isolate, "v8::HeapGraphEdge::GetName"); | 6208 IsDeadCheck(isolate, "v8::HeapGraphEdge::GetName"); |
6207 i::HeapGraphEdge* edge = ToInternal(this); | 6209 i::HeapGraphEdge* edge = ToInternal(this); |
6208 switch (edge->type()) { | 6210 switch (edge->type()) { |
6209 case i::HeapGraphEdge::kContextVariable: | 6211 case i::HeapGraphEdge::kContextVariable: |
6210 case i::HeapGraphEdge::kInternal: | 6212 case i::HeapGraphEdge::kInternal: |
6211 case i::HeapGraphEdge::kProperty: | 6213 case i::HeapGraphEdge::kProperty: |
6212 case i::HeapGraphEdge::kShortcut: | 6214 case i::HeapGraphEdge::kShortcut: |
6213 return Handle<String>(ToApi<String>(isolate->factory()->LookupUtf8Symbol( | 6215 return Handle<String>(ToApi<String>( |
6214 edge->name()))); | 6216 isolate->factory()->InternalizeUtf8String(edge->name()))); |
6215 case i::HeapGraphEdge::kElement: | 6217 case i::HeapGraphEdge::kElement: |
6216 case i::HeapGraphEdge::kHidden: | 6218 case i::HeapGraphEdge::kHidden: |
6217 return Handle<Number>(ToApi<Number>(isolate->factory()->NewNumberFromInt( | 6219 return Handle<Number>(ToApi<Number>( |
6218 edge->index()))); | 6220 isolate->factory()->NewNumberFromInt(edge->index()))); |
6219 default: UNREACHABLE(); | 6221 default: UNREACHABLE(); |
6220 } | 6222 } |
6221 return v8::Undefined(); | 6223 return v8::Undefined(); |
6222 } | 6224 } |
6223 | 6225 |
6224 | 6226 |
6225 const HeapGraphNode* HeapGraphEdge::GetFromNode() const { | 6227 const HeapGraphNode* HeapGraphEdge::GetFromNode() const { |
6226 i::Isolate* isolate = i::Isolate::Current(); | 6228 i::Isolate* isolate = i::Isolate::Current(); |
6227 IsDeadCheck(isolate, "v8::HeapGraphEdge::GetFromNode"); | 6229 IsDeadCheck(isolate, "v8::HeapGraphEdge::GetFromNode"); |
6228 const i::HeapEntry* from = ToInternal(this)->from(); | 6230 const i::HeapEntry* from = ToInternal(this)->from(); |
(...skipping 18 matching lines...) Expand all Loading... |
6247 HeapGraphNode::Type HeapGraphNode::GetType() const { | 6249 HeapGraphNode::Type HeapGraphNode::GetType() const { |
6248 i::Isolate* isolate = i::Isolate::Current(); | 6250 i::Isolate* isolate = i::Isolate::Current(); |
6249 IsDeadCheck(isolate, "v8::HeapGraphNode::GetType"); | 6251 IsDeadCheck(isolate, "v8::HeapGraphNode::GetType"); |
6250 return static_cast<HeapGraphNode::Type>(ToInternal(this)->type()); | 6252 return static_cast<HeapGraphNode::Type>(ToInternal(this)->type()); |
6251 } | 6253 } |
6252 | 6254 |
6253 | 6255 |
6254 Handle<String> HeapGraphNode::GetName() const { | 6256 Handle<String> HeapGraphNode::GetName() const { |
6255 i::Isolate* isolate = i::Isolate::Current(); | 6257 i::Isolate* isolate = i::Isolate::Current(); |
6256 IsDeadCheck(isolate, "v8::HeapGraphNode::GetName"); | 6258 IsDeadCheck(isolate, "v8::HeapGraphNode::GetName"); |
6257 return Handle<String>(ToApi<String>(isolate->factory()->LookupUtf8Symbol( | 6259 return Handle<String>(ToApi<String>(isolate->factory()->InternalizeUtf8String( |
6258 ToInternal(this)->name()))); | 6260 ToInternal(this)->name()))); |
6259 } | 6261 } |
6260 | 6262 |
6261 | 6263 |
6262 SnapshotObjectId HeapGraphNode::GetId() const { | 6264 SnapshotObjectId HeapGraphNode::GetId() const { |
6263 i::Isolate* isolate = i::Isolate::Current(); | 6265 i::Isolate* isolate = i::Isolate::Current(); |
6264 IsDeadCheck(isolate, "v8::HeapGraphNode::GetId"); | 6266 IsDeadCheck(isolate, "v8::HeapGraphNode::GetId"); |
6265 return ToInternal(this)->id(); | 6267 return ToInternal(this)->id(); |
6266 } | 6268 } |
6267 | 6269 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6326 unsigned HeapSnapshot::GetUid() const { | 6328 unsigned HeapSnapshot::GetUid() const { |
6327 i::Isolate* isolate = i::Isolate::Current(); | 6329 i::Isolate* isolate = i::Isolate::Current(); |
6328 IsDeadCheck(isolate, "v8::HeapSnapshot::GetUid"); | 6330 IsDeadCheck(isolate, "v8::HeapSnapshot::GetUid"); |
6329 return ToInternal(this)->uid(); | 6331 return ToInternal(this)->uid(); |
6330 } | 6332 } |
6331 | 6333 |
6332 | 6334 |
6333 Handle<String> HeapSnapshot::GetTitle() const { | 6335 Handle<String> HeapSnapshot::GetTitle() const { |
6334 i::Isolate* isolate = i::Isolate::Current(); | 6336 i::Isolate* isolate = i::Isolate::Current(); |
6335 IsDeadCheck(isolate, "v8::HeapSnapshot::GetTitle"); | 6337 IsDeadCheck(isolate, "v8::HeapSnapshot::GetTitle"); |
6336 return Handle<String>(ToApi<String>(isolate->factory()->LookupUtf8Symbol( | 6338 return Handle<String>(ToApi<String>(isolate->factory()->InternalizeUtf8String( |
6337 ToInternal(this)->title()))); | 6339 ToInternal(this)->title()))); |
6338 } | 6340 } |
6339 | 6341 |
6340 | 6342 |
6341 const HeapGraphNode* HeapSnapshot::GetRoot() const { | 6343 const HeapGraphNode* HeapSnapshot::GetRoot() const { |
6342 i::Isolate* isolate = i::Isolate::Current(); | 6344 i::Isolate* isolate = i::Isolate::Current(); |
6343 IsDeadCheck(isolate, "v8::HeapSnapshot::GetHead"); | 6345 IsDeadCheck(isolate, "v8::HeapSnapshot::GetHead"); |
6344 return reinterpret_cast<const HeapGraphNode*>(ToInternal(this)->root()); | 6346 return reinterpret_cast<const HeapGraphNode*>(ToInternal(this)->root()); |
6345 } | 6347 } |
6346 | 6348 |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6695 | 6697 |
6696 v->VisitPointers(blocks_.first(), first_block_limit_); | 6698 v->VisitPointers(blocks_.first(), first_block_limit_); |
6697 | 6699 |
6698 for (int i = 1; i < blocks_.length(); i++) { | 6700 for (int i = 1; i < blocks_.length(); i++) { |
6699 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); | 6701 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); |
6700 } | 6702 } |
6701 } | 6703 } |
6702 | 6704 |
6703 | 6705 |
6704 } } // namespace v8::internal | 6706 } } // namespace v8::internal |
OLD | NEW |