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 3222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3233 i::Handle<i::JSFunction> func = Utils::OpenHandle(this); | 3233 i::Handle<i::JSFunction> func = Utils::OpenHandle(this); |
3234 if (func->shared()->script()->IsScript()) { | 3234 if (func->shared()->script()->IsScript()) { |
3235 i::Handle<i::Script> script(i::Script::cast(func->shared()->script())); | 3235 i::Handle<i::Script> script(i::Script::cast(func->shared()->script())); |
3236 return i::GetScriptLineNumber(script, func->shared()->start_position()); | 3236 return i::GetScriptLineNumber(script, func->shared()->start_position()); |
3237 } | 3237 } |
3238 return kLineOffsetNotFound; | 3238 return kLineOffsetNotFound; |
3239 } | 3239 } |
3240 | 3240 |
3241 | 3241 |
3242 int String::Length() const { | 3242 int String::Length() const { |
3243 if (IsDeadCheck(i::Isolate::Current(), "v8::String::Length()")) return 0; | 3243 i::Handle<i::String> str = Utils::OpenHandle(this); |
3244 return Utils::OpenHandle(this)->length(); | 3244 if (IsDeadCheck(str->GetIsolate(), "v8::String::Length()")) return 0; |
| 3245 return str->length(); |
3245 } | 3246 } |
3246 | 3247 |
3247 | 3248 |
3248 int String::Utf8Length() const { | 3249 int String::Utf8Length() const { |
3249 if (IsDeadCheck(i::Isolate::Current(), "v8::String::Utf8Length()")) return 0; | 3250 i::Handle<i::String> str = Utils::OpenHandle(this); |
3250 return Utils::OpenHandle(this)->Utf8Length(); | 3251 if (IsDeadCheck(str->GetIsolate(), "v8::String::Utf8Length()")) return 0; |
| 3252 return str->Utf8Length(); |
3251 } | 3253 } |
3252 | 3254 |
3253 | 3255 |
3254 int String::WriteUtf8(char* buffer, | 3256 int String::WriteUtf8(char* buffer, |
3255 int capacity, | 3257 int capacity, |
3256 int* nchars_ref, | 3258 int* nchars_ref, |
3257 WriteHints hints) const { | 3259 WriteHints hints) const { |
3258 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 3260 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3259 if (IsDeadCheck(isolate, "v8::String::WriteUtf8()")) return 0; | 3261 if (IsDeadCheck(isolate, "v8::String::WriteUtf8()")) return 0; |
3260 LOG_API(isolate, "String::WriteUtf8"); | 3262 LOG_API(isolate, "String::WriteUtf8"); |
(...skipping 2440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5701 | 5703 |
5702 | 5704 |
5703 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 5705 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
5704 HandleScopeImplementer* thread_local = | 5706 HandleScopeImplementer* thread_local = |
5705 reinterpret_cast<HandleScopeImplementer*>(storage); | 5707 reinterpret_cast<HandleScopeImplementer*>(storage); |
5706 thread_local->IterateThis(v); | 5708 thread_local->IterateThis(v); |
5707 return storage + ArchiveSpacePerThread(); | 5709 return storage + ArchiveSpacePerThread(); |
5708 } | 5710 } |
5709 | 5711 |
5710 } } // namespace v8::internal | 5712 } } // namespace v8::internal |
OLD | NEW |