| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 4538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4549 } | 4549 } |
| 4550 return result; | 4550 return result; |
| 4551 } | 4551 } |
| 4552 | 4552 |
| 4553 | 4553 |
| 4554 bool v8::String::CanMakeExternal() { | 4554 bool v8::String::CanMakeExternal() { |
| 4555 if (!internal::FLAG_clever_optimizations) return false; | 4555 if (!internal::FLAG_clever_optimizations) return false; |
| 4556 i::Handle<i::String> obj = Utils::OpenHandle(this); | 4556 i::Handle<i::String> obj = Utils::OpenHandle(this); |
| 4557 i::Isolate* isolate = obj->GetIsolate(); | 4557 i::Isolate* isolate = obj->GetIsolate(); |
| 4558 if (IsDeadCheck(isolate, "v8::String::CanMakeExternal()")) return false; | 4558 if (IsDeadCheck(isolate, "v8::String::CanMakeExternal()")) return false; |
| 4559 if (isolate->string_tracker()->IsFreshUnusedString(obj)) return false; | 4559 if (isolate->string_tracker()->IsFreshUnusedString(obj)) { |
| 4560 return false; |
| 4561 } |
| 4560 int size = obj->Size(); // Byte size of the original string. | 4562 int size = obj->Size(); // Byte size of the original string. |
| 4561 if (size < i::ExternalString::kShortSize) return false; | 4563 if (size < i::ExternalString::kSize) |
| 4564 return false; |
| 4562 i::StringShape shape(*obj); | 4565 i::StringShape shape(*obj); |
| 4563 return !shape.IsExternal(); | 4566 return !shape.IsExternal(); |
| 4564 } | 4567 } |
| 4565 | 4568 |
| 4566 | 4569 |
| 4567 Local<v8::Object> v8::Object::New() { | 4570 Local<v8::Object> v8::Object::New() { |
| 4568 i::Isolate* isolate = i::Isolate::Current(); | 4571 i::Isolate* isolate = i::Isolate::Current(); |
| 4569 EnsureInitializedForIsolate(isolate, "v8::Object::New()"); | 4572 EnsureInitializedForIsolate(isolate, "v8::Object::New()"); |
| 4570 LOG_API(isolate, "Object::New"); | 4573 LOG_API(isolate, "Object::New"); |
| 4571 ENTER_V8(isolate); | 4574 ENTER_V8(isolate); |
| (...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6114 | 6117 |
| 6115 | 6118 |
| 6116 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 6119 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
| 6117 HandleScopeImplementer* scope_implementer = | 6120 HandleScopeImplementer* scope_implementer = |
| 6118 reinterpret_cast<HandleScopeImplementer*>(storage); | 6121 reinterpret_cast<HandleScopeImplementer*>(storage); |
| 6119 scope_implementer->IterateThis(v); | 6122 scope_implementer->IterateThis(v); |
| 6120 return storage + ArchiveSpacePerThread(); | 6123 return storage + ArchiveSpacePerThread(); |
| 6121 } | 6124 } |
| 6122 | 6125 |
| 6123 } } // namespace v8::internal | 6126 } } // namespace v8::internal |
| OLD | NEW |