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

Side by Side Diff: src/api.cc

Issue 345903004: Split out libplatform into a separate libary (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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
« samples/process.cc ('K') | « src/DEPS ('k') | src/d8.cc » ('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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 4913 matching lines...) Expand 10 before | Expand all | Expand 10 after
4924 if (obj->IsUndefined()) return NULL; 4924 if (obj->IsUndefined()) return NULL;
4925 i::Object* foreign = i::JSObject::cast(obj)->GetInternalField(0); 4925 i::Object* foreign = i::JSObject::cast(obj)->GetInternalField(0);
4926 return i::Foreign::cast(foreign)->foreign_address(); 4926 return i::Foreign::cast(foreign)->foreign_address();
4927 } 4927 }
4928 4928
4929 4929
4930 // --- E n v i r o n m e n t --- 4930 // --- E n v i r o n m e n t ---
4931 4931
4932 4932
4933 void v8::V8::InitializePlatform(Platform* platform) { 4933 void v8::V8::InitializePlatform(Platform* platform) {
4934 #ifdef V8_USE_DEFAULT_PLATFORM
4935 FATAL("Can't override v8::Platform when using default implementation");
4936 #else
4937 i::V8::InitializePlatform(platform); 4934 i::V8::InitializePlatform(platform);
4938 #endif
4939 } 4935 }
4940 4936
4941 4937
4942 void v8::V8::ShutdownPlatform() { 4938 void v8::V8::ShutdownPlatform() {
4943 #ifdef V8_USE_DEFAULT_PLATFORM
4944 FATAL("Can't override v8::Platform when using default implementation");
4945 #else
4946 i::V8::ShutdownPlatform(); 4939 i::V8::ShutdownPlatform();
4947 #endif
4948 } 4940 }
4949 4941
4950 4942
4951 bool v8::V8::Initialize() { 4943 bool v8::V8::Initialize() {
4952 i::Isolate* isolate = i::Isolate::UncheckedCurrent(); 4944 i::Isolate* isolate = i::Isolate::UncheckedCurrent();
4953 if (isolate != NULL && isolate->IsInitialized()) { 4945 if (isolate != NULL && isolate->IsInitialized()) {
4954 return true; 4946 return true;
4955 } 4947 }
4956 return InitializeHelper(isolate); 4948 return InitializeHelper(isolate);
4957 } 4949 }
(...skipping 2668 matching lines...) Expand 10 before | Expand all | Expand 10 after
7626 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7618 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7627 Address callback_address = 7619 Address callback_address =
7628 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7620 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7629 VMState<EXTERNAL> state(isolate); 7621 VMState<EXTERNAL> state(isolate);
7630 ExternalCallbackScope call_scope(isolate, callback_address); 7622 ExternalCallbackScope call_scope(isolate, callback_address);
7631 callback(info); 7623 callback(info);
7632 } 7624 }
7633 7625
7634 7626
7635 } } // namespace v8::internal 7627 } } // namespace v8::internal
OLDNEW
« samples/process.cc ('K') | « src/DEPS ('k') | src/d8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698