v8  3.14.5(node0.10.28)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
platform-nullos.cc
Go to the documentation of this file.
1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
4 // met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 // Platform specific code for NULLOS goes here
29 
30 // Minimal include to get access to abort, fprintf and friends for bootstrapping
31 // messages.
32 #include <stdio.h>
33 #include <stdlib.h>
34 
35 #include "v8.h"
36 
37 #include "platform.h"
38 #include "vm-state-inl.h"
39 
40 
41 namespace v8 {
42 namespace internal {
43 
44 // Give V8 the opportunity to override the default ceil behaviour.
45 double ceiling(double x) {
46  UNIMPLEMENTED();
47  return 0;
48 }
49 
50 
51 // Give V8 the opportunity to override the default fmod behavior.
52 double modulo(double x, double y) {
53  UNIMPLEMENTED();
54  return 0;
55 }
56 
57 
58 double fast_sin(double x) {
59  UNIMPLEMENTED();
60  return 0;
61 }
62 
63 
64 double fast_cos(double x) {
65  UNIMPLEMENTED();
66  return 0;
67 }
68 
69 
70 double fast_tan(double x) {
71  UNIMPLEMENTED();
72  return 0;
73 }
74 
75 
76 double fast_log(double x) {
77  UNIMPLEMENTED();
78  return 0;
79 }
80 
81 
82 // Initialize OS class early in the V8 startup.
83 void OS::SetUp() {
84  // Seed the random number generator.
85  UNIMPLEMENTED();
86 }
87 
88 
89 void OS::PostSetUp() {
90  UNIMPLEMENTED();
91 }
92 
93 
94 void OS::TearDown() {
95  UNIMPLEMENTED();
96 }
97 
98 
99 // Returns the accumulated user time for thread.
100 int OS::GetUserTime(uint32_t* secs, uint32_t* usecs) {
101  UNIMPLEMENTED();
102  *secs = 0;
103  *usecs = 0;
104  return 0;
105 }
106 
107 
108 // Returns current time as the number of milliseconds since
109 // 00:00:00 UTC, January 1, 1970.
111  UNIMPLEMENTED();
112  return 0;
113 }
114 
115 
116 // Returns ticks in microsecond resolution.
117 int64_t OS::Ticks() {
118  UNIMPLEMENTED();
119  return 0;
120 }
121 
122 
123 // Returns a string identifying the current timezone taking into
124 // account daylight saving.
125 const char* OS::LocalTimezone(double time) {
126  UNIMPLEMENTED();
127  return "<none>";
128 }
129 
130 
131 // Returns the daylight savings offset in milliseconds for the given time.
132 double OS::DaylightSavingsOffset(double time) {
133  UNIMPLEMENTED();
134  return 0;
135 }
136 
137 
139  UNIMPLEMENTED();
140  return 0;
141 }
142 
143 
144 // Returns the local time offset in milliseconds east of UTC without
145 // taking daylight savings time into account.
146 double OS::LocalTimeOffset() {
147  UNIMPLEMENTED();
148  return 0;
149 }
150 
151 
152 // Print (debug) message to console.
153 void OS::Print(const char* format, ...) {
154  UNIMPLEMENTED();
155 }
156 
157 
158 // Print (debug) message to console.
159 void OS::VPrint(const char* format, va_list args) {
160  // Minimalistic implementation for bootstrapping.
161  vfprintf(stdout, format, args);
162 }
163 
164 
165 void OS::FPrint(FILE* out, const char* format, ...) {
166  va_list args;
167  va_start(args, format);
168  VFPrint(out, format, args);
169  va_end(args);
170 }
171 
172 
173 void OS::VFPrint(FILE* out, const char* format, va_list args) {
174  vfprintf(out, format, args);
175 }
176 
177 
178 // Print error message to console.
179 void OS::PrintError(const char* format, ...) {
180  // Minimalistic implementation for bootstrapping.
181  va_list args;
182  va_start(args, format);
183  VPrintError(format, args);
184  va_end(args);
185 }
186 
187 
188 // Print error message to console.
189 void OS::VPrintError(const char* format, va_list args) {
190  // Minimalistic implementation for bootstrapping.
191  vfprintf(stderr, format, args);
192 }
193 
194 
195 int OS::SNPrintF(char* str, size_t size, const char* format, ...) {
196  UNIMPLEMENTED();
197  return 0;
198 }
199 
200 
201 int OS::VSNPrintF(char* str, size_t size, const char* format, va_list args) {
202  UNIMPLEMENTED();
203  return 0;
204 }
205 
206 
208  return 0;
209 }
210 
211 
212 double OS::nan_value() {
213  UNIMPLEMENTED();
214  return 0;
215 }
216 
217 
219  UNIMPLEMENTED();
220 }
221 
222 
224  UNIMPLEMENTED();
225 }
226 
227 
229  UNIMPLEMENTED();
230 }
231 
232 
233 bool OS::IsOutsideAllocatedSpace(void* address) {
234  UNIMPLEMENTED();
235  return false;
236 }
237 
238 
239 size_t OS::AllocateAlignment() {
240  UNIMPLEMENTED();
241  return 0;
242 }
243 
244 
245 void* OS::Allocate(const size_t requested,
246  size_t* allocated,
247  bool executable) {
248  UNIMPLEMENTED();
249  return NULL;
250 }
251 
252 
253 void OS::Free(void* buf, const size_t length) {
254  // TODO(1240712): potential system call return value which is ignored here.
255  UNIMPLEMENTED();
256 }
257 
258 
259 void OS::Guard(void* address, const size_t size) {
260  UNIMPLEMENTED();
261 }
262 
263 
264 void OS::Sleep(int milliseconds) {
265  UNIMPLEMENTED();
266 }
267 
268 
269 void OS::Abort() {
270  // Minimalistic implementation for bootstrapping.
271  abort();
272 }
273 
274 
275 void OS::DebugBreak() {
276  UNIMPLEMENTED();
277 }
278 
279 
280 OS::MemoryMappedFile* OS::MemoryMappedFile::open(const char* name) {
281  UNIMPLEMENTED();
282  return NULL;
283 }
284 
285 
286 OS::MemoryMappedFile* OS::MemoryMappedFile::create(const char* name, int size,
287  void* initial) {
288  UNIMPLEMENTED();
289  return NULL;
290 }
291 
292 
294  UNIMPLEMENTED();
295 }
296 
297 
298 void OS::SignalCodeMovingGC() {
299  UNIMPLEMENTED();
300 }
301 
302 
303 int OS::StackWalk(Vector<OS::StackFrame> frames) {
304  UNIMPLEMENTED();
305  return 0;
306 }
307 
308 
309 VirtualMemory::VirtualMemory(size_t size, void* address_hint) {
310  UNIMPLEMENTED();
311 }
312 
313 
315  UNIMPLEMENTED();
316 }
317 
318 
320  UNIMPLEMENTED();
321  return false;
322 }
323 
324 
325 bool VirtualMemory::Commit(void* address, size_t size, bool executable) {
326  UNIMPLEMENTED();
327  return false;
328 }
329 
330 
331 bool VirtualMemory::Uncommit(void* address, size_t size) {
332  UNIMPLEMENTED();
333  return false;
334 }
335 
336 
337 bool VirtualMemory::Guard(void* address) {
338  UNIMPLEMENTED();
339  return false;
340 }
341 
342 
343 class Thread::PlatformData : public Malloced {
344  public:
346  UNIMPLEMENTED();
347  }
348 
349  void* pd_data_;
350 };
351 
352 
353 Thread::Thread(const Options& options)
354  : data_(new PlatformData()),
355  stack_size_(options.stack_size) {
356  set_name(options.name);
357  UNIMPLEMENTED();
358 }
359 
360 
361 Thread::Thread(const char* name)
362  : data_(new PlatformData()),
363  stack_size_(0) {
364  set_name(name);
365  UNIMPLEMENTED();
366 }
367 
368 
369 Thread::~Thread() {
370  delete data_;
371  UNIMPLEMENTED();
372 }
373 
374 
375 void Thread::set_name(const char* name) {
376  strncpy(name_, name, sizeof(name_));
377  name_[sizeof(name_) - 1] = '\0';
378 }
379 
380 
381 void Thread::Start() {
382  UNIMPLEMENTED();
383 }
384 
385 
386 void Thread::Join() {
387  UNIMPLEMENTED();
388 }
389 
390 
392  UNIMPLEMENTED();
393  return static_cast<LocalStorageKey>(0);
394 }
395 
396 
398  UNIMPLEMENTED();
399 }
400 
401 
403  UNIMPLEMENTED();
404  return NULL;
405 }
406 
407 
408 void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
409  UNIMPLEMENTED();
410 }
411 
412 
413 void Thread::YieldCPU() {
414  UNIMPLEMENTED();
415 }
416 
417 
418 class NullMutex : public Mutex {
419  public:
420  NullMutex() : data_(NULL) {
421  UNIMPLEMENTED();
422  }
423 
424  virtual ~NullMutex() {
425  UNIMPLEMENTED();
426  }
427 
428  virtual int Lock() {
429  UNIMPLEMENTED();
430  return 0;
431  }
432 
433  virtual int Unlock() {
434  UNIMPLEMENTED();
435  return 0;
436  }
437 
438  private:
439  void* data_;
440 };
441 
442 
443 Mutex* OS::CreateMutex() {
444  UNIMPLEMENTED();
445  return new NullMutex();
446 }
447 
448 
449 class NullSemaphore : public Semaphore {
450  public:
451  explicit NullSemaphore(int count) : data_(NULL) {
452  UNIMPLEMENTED();
453  }
454 
455  virtual ~NullSemaphore() {
456  UNIMPLEMENTED();
457  }
458 
459  virtual void Wait() {
460  UNIMPLEMENTED();
461  }
462 
463  virtual void Signal() {
464  UNIMPLEMENTED();
465  }
466  private:
467  void* data_;
468 };
469 
470 
471 Semaphore* OS::CreateSemaphore(int count) {
472  UNIMPLEMENTED();
473  return new NullSemaphore(count);
474 }
475 
476 
478  public:
480  UNIMPLEMENTED();
481  }
482 };
483 
484 
485 ProfileSampler::ProfileSampler(int interval) {
486  UNIMPLEMENTED();
487  // Shared setup follows.
488  data_ = new PlatformData();
489  interval_ = interval;
490  active_ = false;
491 }
492 
493 
494 ProfileSampler::~ProfileSampler() {
495  UNIMPLEMENTED();
496  // Shared tear down follows.
497  delete data_;
498 }
499 
500 
501 void ProfileSampler::Start() {
502  UNIMPLEMENTED();
503 }
504 
505 
506 void ProfileSampler::Stop() {
507  UNIMPLEMENTED();
508 }
509 
510 
511 } } // namespace v8::internal
double fast_tan(double x)
static void * GetThreadLocal(LocalStorageKey key)
static void Free(void *address, const size_t size)
Thread(const Options &options)
static int VSNPrintF(Vector< char > str, const char *format, va_list args)
static int64_t Ticks()
static void SignalCodeMovingGC()
double ceiling(double x)
static bool IsOutsideAllocatedSpace(void *pointer)
static const char * LocalTimezone(double time)
static int GetUserTime(uint32_t *secs, uint32_t *usecs)
static void VFPrint(FILE *out, const char *format, va_list args)
double fast_sin(double x)
static MemoryMappedFile * open(const char *name)
static void Abort()
static LocalStorageKey CreateThreadLocalKey()
static MemoryMappedFile * create(const char *name, int size, void *initial)
double fast_log(double x)
bool Commit(void *address, size_t size, bool is_executable)
static void VPrint(const char *format, va_list args)
static void Guard(void *address, const size_t size)
static void VPrintError(const char *format, va_list args)
double modulo(double x, double y)
static bool ArmCpuHasFeature(CpuFeature feature)
static Mutex * CreateMutex()
static double TimeCurrentMillis()
static CpuImplementer GetCpuImplementer()
static void DebugBreak()
static void DeleteThreadLocalKey(LocalStorageKey key)
static void Sleep(const int milliseconds)
static void Print(const char *format,...)
static void TearDown()
static int SNPrintF(Vector< char > str, const char *format,...)
static Semaphore * CreateSemaphore(int count)
static double nan_value()
#define UNIMPLEMENTED()
Definition: checks.h:48
static void SetThreadLocal(LocalStorageKey key, void *value)
static void * Allocate(const size_t requested, size_t *allocated, bool is_executable)
static int StackWalk(Vector< StackFrame > frames)
static void PostSetUp()
static void PrintError(const char *format,...)
static void LogSharedLibraryAddresses()
static void SetUp()
const char * name() const
Definition: platform.h:466
static double DaylightSavingsOffset(double time)
static size_t AllocateAlignment()
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if NULL
Definition: flags.cc:301
static uint64_t CpuFeaturesImpliedByPlatform()
static int GetLastError()
static void FPrint(FILE *out, const char *format,...)
double fast_cos(double x)
static double LocalTimeOffset()
static bool ArmUsingHardFloat()
bool Uncommit(void *address, size_t size)
const char * name() const
Definition: platform.h:484