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

Unified Diff: src/api.cc

Issue 6737003: Removing unneeded TLS fetch from v8::Null and friends (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/apiutils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index af8054f1b446dd86ef7e6f92335427235cfb5820..311cb8554240b18115baff156f7170ea4a11493e 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -315,44 +315,6 @@ void ImplementationUtilities::ZapHandleRange(i::Object** begin,
#endif
-v8::Handle<v8::Primitive> ImplementationUtilities::Undefined() {
Vitaly Repeshko 2011/03/25 13:48:04 Yes, inlining these is the right thing to do. IIRC
- i::Isolate* isolate = i::Isolate::Current();
- if (!EnsureInitializedForIsolate(isolate, "v8::Undefined()")) {
- return v8::Handle<v8::Primitive>();
- }
- return v8::Handle<Primitive>(ToApi<Primitive>(
- isolate->factory()->undefined_value()));
-}
-
-
-v8::Handle<v8::Primitive> ImplementationUtilities::Null() {
- i::Isolate* isolate = i::Isolate::UncheckedCurrent();
- if (!EnsureInitializedForIsolate(isolate, "v8::Null()"))
- return v8::Handle<v8::Primitive>();
- return v8::Handle<Primitive>(
- ToApi<Primitive>(isolate->factory()->null_value()));
-}
-
-
-v8::Handle<v8::Boolean> ImplementationUtilities::True() {
- i::Isolate* isolate = i::Isolate::Current();
- if (!EnsureInitializedForIsolate(isolate, "v8::True()")) {
- return v8::Handle<v8::Boolean>();
- }
- return v8::Handle<v8::Boolean>(ToApi<Boolean>(
- isolate->factory()->true_value()));
-}
-
-
-v8::Handle<v8::Boolean> ImplementationUtilities::False() {
- i::Isolate* isolate = i::Isolate::Current();
- if (!EnsureInitializedForIsolate(isolate, "v8::False()")) {
- return v8::Handle<v8::Boolean>();
- }
- return v8::Handle<v8::Boolean>(ToApi<Boolean>(
- isolate->factory()->false_value()));
-}
-
void V8::SetFlagsFromString(const char* str, int length) {
i::FlagList::SetFlagsFromString(str, length);
}
@@ -413,28 +375,41 @@ Extension::Extension(const char* name,
v8::Handle<Primitive> Undefined() {
i::Isolate* isolate = i::Isolate::Current();
LOG_API(isolate, "Undefined");
Vitaly Repeshko 2011/03/25 13:48:04 This logging is useless.
- return ImplementationUtilities::Undefined();
+ if (!EnsureInitializedForIsolate(isolate, "v8::Undefined()")) {
+ return v8::Handle<v8::Primitive>();
+ }
+ return v8::Handle<Primitive>(ToApi<Primitive>(
+ isolate->factory()->undefined_value()));
}
v8::Handle<Primitive> Null() {
i::Isolate* isolate = i::Isolate::Current();
LOG_API(isolate, "Null");
- return ImplementationUtilities::Null();
+ if (!EnsureInitializedForIsolate(isolate, "v8::Null()"))
Vitaly Repeshko 2011/03/25 13:48:04 Let's make all if-s consistent by using {} when th
+ return v8::Handle<v8::Primitive>();
+ return v8::Handle<Primitive>(
+ ToApi<Primitive>(isolate->factory()->null_value()));
}
v8::Handle<Boolean> True() {
i::Isolate* isolate = i::Isolate::Current();
LOG_API(isolate, "True");
- return ImplementationUtilities::True();
+ if (!EnsureInitializedForIsolate(isolate, "v8::True()"))
+ return v8::Handle<Boolean>();
+ return v8::Handle<Boolean>(
+ ToApi<Boolean>(isolate->factory()->true_value()));
}
v8::Handle<Boolean> False() {
i::Isolate* isolate = i::Isolate::Current();
LOG_API(isolate, "False");
- return ImplementationUtilities::False();
+ if (!EnsureInitializedForIsolate(isolate, "v8::False()"))
+ return v8::Handle<Boolean>();
+ return v8::Handle<Boolean>(
+ ToApi<Boolean>(isolate->factory()->false_value()));
}
@@ -5280,7 +5255,7 @@ Handle<Value> HeapGraphEdge::GetName() const {
edge->index())));
default: UNREACHABLE();
}
- return ImplementationUtilities::Undefined();
+ return v8::Undefined();
}
« no previous file with comments | « no previous file | src/apiutils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698