Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: src/api.cc

Issue 8635011: Introduce short external strings without pointer cache. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/heap.h » ('j') | src/ia32/codegen-ia32.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4542 matching lines...) Expand 10 before | Expand all | Expand 10 after
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)) { 4559 if (isolate->string_tracker()->IsFreshUnusedString(obj)) {
4560 return false; 4560 return false;
4561 } 4561 }
4562 int size = obj->Size(); // Byte size of the original string. 4562 int size = obj->Size(); // Byte size of the original string.
4563 if (size < i::ExternalString::kSize) 4563 if (size < i::ExternalString::kShortSize)
Lasse Reichstein 2011/11/23 08:43:20 Put braces around the then-statement.
Yang 2011/11/23 09:58:48 Done.
4564 return false; 4564 return false;
4565 i::StringShape shape(*obj); 4565 i::StringShape shape(*obj);
4566 return !shape.IsExternal(); 4566 return !shape.IsExternal();
4567 } 4567 }
4568 4568
4569 4569
4570 Local<v8::Object> v8::Object::New() { 4570 Local<v8::Object> v8::Object::New() {
4571 i::Isolate* isolate = i::Isolate::Current(); 4571 i::Isolate* isolate = i::Isolate::Current();
4572 EnsureInitializedForIsolate(isolate, "v8::Object::New()"); 4572 EnsureInitializedForIsolate(isolate, "v8::Object::New()");
4573 LOG_API(isolate, "Object::New"); 4573 LOG_API(isolate, "Object::New");
(...skipping 1543 matching lines...) Expand 10 before | Expand all | Expand 10 after
6117 6117
6118 6118
6119 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 6119 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
6120 HandleScopeImplementer* scope_implementer = 6120 HandleScopeImplementer* scope_implementer =
6121 reinterpret_cast<HandleScopeImplementer*>(storage); 6121 reinterpret_cast<HandleScopeImplementer*>(storage);
6122 scope_implementer->IterateThis(v); 6122 scope_implementer->IterateThis(v);
6123 return storage + ArchiveSpacePerThread(); 6123 return storage + ArchiveSpacePerThread();
6124 } 6124 }
6125 6125
6126 } } // namespace v8::internal 6126 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/heap.h » ('j') | src/ia32/codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698