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

Side by Side Diff: src/api.cc

Issue 9455088: Remove static initializers in v8. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address Florian's comments. Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm/assembler-arm.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 3995 matching lines...) Expand 10 before | Expand all | Expand 10 after
4006 Utils::OpenHandle(this)->SetInternalField(index, *foreign); 4006 Utils::OpenHandle(this)->SetInternalField(index, *foreign);
4007 } 4007 }
4008 ASSERT_EQ(value, GetPointerFromInternalField(index)); 4008 ASSERT_EQ(value, GetPointerFromInternalField(index));
4009 } 4009 }
4010 4010
4011 4011
4012 // --- E n v i r o n m e n t --- 4012 // --- E n v i r o n m e n t ---
4013 4013
4014 4014
4015 bool v8::V8::Initialize() { 4015 bool v8::V8::Initialize() {
4016 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); 4016 i::Isolate* isolate = i::Isolate::Current();
4017 if (isolate != NULL && isolate->IsInitialized()) { 4017 if (isolate != NULL && isolate->IsInitialized()) {
4018 return true; 4018 return true;
4019 } 4019 }
4020 return InitializeHelper(); 4020 return InitializeHelper();
4021 } 4021 }
4022 4022
4023 4023
4024 void v8::V8::SetEntropySource(EntropySource source) { 4024 void v8::V8::SetEntropySource(EntropySource source) {
4025 i::V8::SetEntropySource(source); 4025 i::V8::SetEntropySource(source);
4026 } 4026 }
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
4897 // Introduce only canonical NaN value into the VM, to avoid signaling NaNs. 4897 // Introduce only canonical NaN value into the VM, to avoid signaling NaNs.
4898 value = i::OS::nan_value(); 4898 value = i::OS::nan_value();
4899 } 4899 }
4900 ENTER_V8(isolate); 4900 ENTER_V8(isolate);
4901 i::Handle<i::Object> result = isolate->factory()->NewNumber(value); 4901 i::Handle<i::Object> result = isolate->factory()->NewNumber(value);
4902 return Utils::NumberToLocal(result); 4902 return Utils::NumberToLocal(result);
4903 } 4903 }
4904 4904
4905 4905
4906 Local<Integer> v8::Integer::New(int32_t value) { 4906 Local<Integer> v8::Integer::New(int32_t value) {
4907 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); 4907 i::Isolate* isolate = i::Isolate::Current();
4908 EnsureInitializedForIsolate(isolate, "v8::Integer::New()"); 4908 EnsureInitializedForIsolate(isolate, "v8::Integer::New()");
4909 if (i::Smi::IsValid(value)) { 4909 if (i::Smi::IsValid(value)) {
4910 return Utils::IntegerToLocal(i::Handle<i::Object>(i::Smi::FromInt(value), 4910 return Utils::IntegerToLocal(i::Handle<i::Object>(i::Smi::FromInt(value),
4911 isolate)); 4911 isolate));
4912 } 4912 }
4913 ENTER_V8(isolate); 4913 ENTER_V8(isolate);
4914 i::Handle<i::Object> result = isolate->factory()->NewNumber(value); 4914 i::Handle<i::Object> result = isolate->factory()->NewNumber(value);
4915 return Utils::IntegerToLocal(result); 4915 return Utils::IntegerToLocal(result);
4916 } 4916 }
4917 4917
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
5175 5175
5176 5176
5177 bool V8::IsExecutionTerminating(Isolate* isolate) { 5177 bool V8::IsExecutionTerminating(Isolate* isolate) {
5178 i::Isolate* i_isolate = isolate != NULL ? 5178 i::Isolate* i_isolate = isolate != NULL ?
5179 reinterpret_cast<i::Isolate*>(isolate) : i::Isolate::Current(); 5179 reinterpret_cast<i::Isolate*>(isolate) : i::Isolate::Current();
5180 return IsExecutionTerminatingCheck(i_isolate); 5180 return IsExecutionTerminatingCheck(i_isolate);
5181 } 5181 }
5182 5182
5183 5183
5184 Isolate* Isolate::GetCurrent() { 5184 Isolate* Isolate::GetCurrent() {
5185 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); 5185 i::Isolate* isolate = i::Isolate::Current();
5186 return reinterpret_cast<Isolate*>(isolate); 5186 return reinterpret_cast<Isolate*>(isolate);
5187 } 5187 }
5188 5188
5189 5189
5190 Isolate* Isolate::New() { 5190 Isolate* Isolate::New() {
5191 i::Isolate* isolate = new i::Isolate(); 5191 i::Isolate* isolate = new i::Isolate();
5192 return reinterpret_cast<Isolate*>(isolate); 5192 return reinterpret_cast<Isolate*>(isolate);
5193 } 5193 }
5194 5194
5195 5195
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
6194 6194
6195 6195
6196 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 6196 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
6197 HandleScopeImplementer* scope_implementer = 6197 HandleScopeImplementer* scope_implementer =
6198 reinterpret_cast<HandleScopeImplementer*>(storage); 6198 reinterpret_cast<HandleScopeImplementer*>(storage);
6199 scope_implementer->IterateThis(v); 6199 scope_implementer->IterateThis(v);
6200 return storage + ArchiveSpacePerThread(); 6200 return storage + ArchiveSpacePerThread();
6201 } 6201 }
6202 6202
6203 } } // namespace v8::internal 6203 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/arm/assembler-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698