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

Side by Side Diff: src/api.cc

Issue 10199019: Make String::Empty inlineable. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 8 months 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 | « include/v8.h ('k') | src/heap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4612 matching lines...) Expand 10 before | Expand all | Expand 10 after
4623 4623
4624 void* External::Value() const { 4624 void* External::Value() const {
4625 if (IsDeadCheck(i::Isolate::Current(), "v8::External::Value()")) return 0; 4625 if (IsDeadCheck(i::Isolate::Current(), "v8::External::Value()")) return 0;
4626 i::Handle<i::Object> obj = Utils::OpenHandle(this); 4626 i::Handle<i::Object> obj = Utils::OpenHandle(this);
4627 return ExternalValueImpl(obj); 4627 return ExternalValueImpl(obj);
4628 } 4628 }
4629 4629
4630 4630
4631 Local<String> v8::String::Empty() { 4631 Local<String> v8::String::Empty() {
4632 i::Isolate* isolate = i::Isolate::Current(); 4632 i::Isolate* isolate = i::Isolate::Current();
4633 EnsureInitializedForIsolate(isolate, "v8::String::Empty()"); 4633 if (!EnsureInitializedForIsolate(isolate, "v8::String::Empty()")) {
Sven Panne 2012/04/25 06:56:22 Just out of curiosity: Why do we need this change?
Michael Starzinger 2012/04/25 08:18:31 Yes, IMHO we need this change in tons of other pla
4634 return v8::Local<String>();
4635 }
4634 LOG_API(isolate, "String::Empty()"); 4636 LOG_API(isolate, "String::Empty()");
4635 return Utils::ToLocal(isolate->factory()->empty_symbol()); 4637 return Utils::ToLocal(isolate->factory()->empty_symbol());
4636 } 4638 }
4637 4639
4638 4640
4639 Local<String> v8::String::New(const char* data, int length) { 4641 Local<String> v8::String::New(const char* data, int length) {
4640 i::Isolate* isolate = i::Isolate::Current(); 4642 i::Isolate* isolate = i::Isolate::Current();
4641 EnsureInitializedForIsolate(isolate, "v8::String::New()"); 4643 EnsureInitializedForIsolate(isolate, "v8::String::New()");
4642 LOG_API(isolate, "String::New(char)"); 4644 LOG_API(isolate, "String::New(char)");
4643 if (length == 0) return Empty(); 4645 if (length == 0) return Empty();
(...skipping 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after
6409 6411
6410 6412
6411 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 6413 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
6412 HandleScopeImplementer* scope_implementer = 6414 HandleScopeImplementer* scope_implementer =
6413 reinterpret_cast<HandleScopeImplementer*>(storage); 6415 reinterpret_cast<HandleScopeImplementer*>(storage);
6414 scope_implementer->IterateThis(v); 6416 scope_implementer->IterateThis(v);
6415 return storage + ArchiveSpacePerThread(); 6417 return storage + ArchiveSpacePerThread();
6416 } 6418 }
6417 6419
6418 } } // namespace v8::internal 6420 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698