The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.

Please select the desired protocol below to get the URL.

This URL has Read-Only access.

Statistics
| Branch: | Revision:

main_repo / deps / v8 / src / platform-nullos.cc @ 40c0f755

History | View | Annotate | Download (8.08 KB)

1
// Copyright 2006-2008 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

    
39

    
40
namespace v8 { namespace internal {
41

    
42
// Give V8 the opportunity to override the default ceil behaviour.
43
double ceiling(double x) {
44
  UNIMPLEMENTED();
45
  return 0;
46
}
47

    
48

    
49
// Initialize OS class early in the V8 startup.
50
void OS::Setup() {
51
  // Seed the random number generator.
52
  UNIMPLEMENTED();
53
}
54

    
55

    
56
// Returns the accumulated user time for thread.
57
int OS::GetUserTime(uint32_t* secs,  uint32_t* usecs) {
58
  UNIMPLEMENTED();
59
  *secs = 0;
60
  *usecs = 0;
61
  return 0;
62
}
63

    
64

    
65
// Returns current time as the number of milliseconds since
66
// 00:00:00 UTC, January 1, 1970.
67
double OS::TimeCurrentMillis() {
68
  UNIMPLEMENTED();
69
  return 0;
70
}
71

    
72

    
73
// Returns ticks in microsecond resolution.
74
int64_t OS::Ticks() {
75
  UNIMPLEMENTED();
76
  return 0;
77
}
78

    
79

    
80
// Returns a string identifying the current timezone taking into
81
// account daylight saving.
82
char* OS::LocalTimezone(double time) {
83
  UNIMPLEMENTED();
84
  return "<none>";
85
}
86

    
87

    
88
// Returns the daylight savings offset in milliseconds for the given time.
89
double OS::DaylightSavingsOffset(double time) {
90
  UNIMPLEMENTED();
91
  return 0;
92
}
93

    
94

    
95
// Returns the local time offset in milliseconds east of UTC without
96
// taking daylight savings time into account.
97
double OS::LocalTimeOffset() {
98
  UNIMPLEMENTED();
99
  return 0;
100
}
101

    
102

    
103
// Print (debug) message to console.
104
void OS::Print(const char* format, ...) {
105
  UNIMPLEMENTED();
106
}
107

    
108

    
109
// Print (debug) message to console.
110
void OS::VPrint(const char* format, va_list args) {
111
  // Minimalistic implementation for bootstrapping.
112
  vfprintf(stdout, format, args);
113
}
114

    
115

    
116
// Print error message to console.
117
void OS::PrintError(const char* format, ...) {
118
  // Minimalistic implementation for bootstrapping.
119
  va_list args;
120
  va_start(args, format);
121
  VPrintError(format, args);
122
  va_end(args);
123
}
124

    
125

    
126
// Print error message to console.
127
void OS::VPrintError(const char* format, va_list args) {
128
  // Minimalistic implementation for bootstrapping.
129
  vfprintf(stderr, format, args);
130
}
131

    
132

    
133
int OS::SNPrintF(char* str, size_t size, const char* format, ...) {
134
  UNIMPLEMENTED();
135
  return 0;
136
}
137

    
138

    
139
int OS::VSNPrintF(char* str, size_t size, const char* format, va_list args) {
140
  UNIMPLEMENTED();
141
  return 0;
142
}
143

    
144

    
145
double OS::nan_value() {
146
  UNIMPLEMENTED();
147
  return 0;
148
}
149

    
150
bool OS::IsOutsideAllocatedSpace(void* address) {
151
  UNIMPLEMENTED();
152
  return false;
153
}
154

    
155

    
156
size_t OS::AllocateAlignment() {
157
  UNIMPLEMENTED();
158
  return 0;
159
}
160

    
161

    
162
void* OS::Allocate(const size_t requested,
163
                   size_t* allocated,
164
                   bool executable) {
165
  UNIMPLEMENTED();
166
  return NULL;
167
}
168

    
169

    
170
void OS::Free(void* buf, const size_t length) {
171
  // TODO(1240712): potential system call return value which is ignored here.
172
  UNIMPLEMENTED();
173
}
174

    
175

    
176
#ifdef ENABLE_HEAP_PROTECTION
177

    
178
void OS::Protect(void* address, size_t size) {
179
  UNIMPLEMENTED();
180
}
181

    
182

    
183
void OS::Unprotect(void* address, size_t size, bool is_executable) {
184
  UNIMPLEMENTED();
185
}
186

    
187
#endif
188

    
189

    
190
void OS::Sleep(int milliseconds) {
191
  UNIMPLEMENTED();
192
}
193

    
194

    
195
void OS::Abort() {
196
  // Minimalistic implementation for bootstrapping.
197
  abort();
198
}
199

    
200

    
201
void OS::DebugBreak() {
202
  UNIMPLEMENTED();
203
}
204

    
205

    
206
OS::MemoryMappedFile* OS::MemoryMappedFile::create(const char* name, int size,
207
    void* initial) {
208
  UNIMPLEMENTED();
209
  return NULL;
210
}
211

    
212

    
213
void OS::LogSharedLibraryAddresses() {
214
  UNIMPLEMENTED();
215
}
216

    
217

    
218
int OS::StackWalk(OS::StackFrame* frames, int frames_size) {
219
  UNIMPLEMENTED();
220
  return 0;
221
}
222

    
223

    
224
VirtualMemory::VirtualMemory(size_t size, void* address_hint) {
225
  UNIMPLEMENTED();
226
}
227

    
228

    
229
VirtualMemory::~VirtualMemory() {
230
  UNIMPLEMENTED();
231
}
232

    
233

    
234
bool VirtualMemory::IsReserved() {
235
  UNIMPLEMENTED();
236
  return false;
237
}
238

    
239

    
240
bool VirtualMemory::Commit(void* address, size_t size, bool executable) {
241
  UNIMPLEMENTED();
242
  return false;
243
}
244

    
245

    
246
bool VirtualMemory::Uncommit(void* address, size_t size) {
247
  UNIMPLEMENTED();
248
  return false;
249
}
250

    
251

    
252
class ThreadHandle::PlatformData : public Malloced {
253
 public:
254
  explicit PlatformData(ThreadHandle::Kind kind) {
255
    UNIMPLEMENTED();
256
  }
257

    
258
  void* pd_data_;
259
};
260

    
261

    
262
ThreadHandle::ThreadHandle(Kind kind) {
263
  UNIMPLEMENTED();
264
  // Shared setup follows.
265
  data_ = new PlatformData(kind);
266
}
267

    
268

    
269
void ThreadHandle::Initialize(ThreadHandle::Kind kind) {
270
  UNIMPLEMENTED();
271
}
272

    
273

    
274
ThreadHandle::~ThreadHandle() {
275
  UNIMPLEMENTED();
276
  // Shared tear down follows.
277
  delete data_;
278
}
279

    
280

    
281
bool ThreadHandle::IsSelf() const {
282
  UNIMPLEMENTED();
283
  return false;
284
}
285

    
286

    
287
bool ThreadHandle::IsValid() const {
288
  UNIMPLEMENTED();
289
  return false;
290
}
291

    
292

    
293
Thread::Thread() : ThreadHandle(ThreadHandle::INVALID) {
294
  UNIMPLEMENTED();
295
}
296

    
297

    
298
Thread::~Thread() {
299
  UNIMPLEMENTED();
300
}
301

    
302

    
303
void Thread::Start() {
304
  UNIMPLEMENTED();
305
}
306

    
307

    
308
void Thread::Join() {
309
  UNIMPLEMENTED();
310
}
311

    
312

    
313
Thread::LocalStorageKey Thread::CreateThreadLocalKey() {
314
  UNIMPLEMENTED();
315
  return static_cast<LocalStorageKey>(0);
316
}
317

    
318

    
319
void Thread::DeleteThreadLocalKey(LocalStorageKey key) {
320
  UNIMPLEMENTED();
321
}
322

    
323

    
324
void* Thread::GetThreadLocal(LocalStorageKey key) {
325
  UNIMPLEMENTED();
326
  return NULL;
327
}
328

    
329

    
330
void Thread::SetThreadLocal(LocalStorageKey key, void* value) {
331
  UNIMPLEMENTED();
332
}
333

    
334

    
335
void Thread::YieldCPU() {
336
  UNIMPLEMENTED();
337
}
338

    
339

    
340
class NullMutex : public Mutex {
341
 public:
342
  NullMutex() : data_(NULL) {
343
    UNIMPLEMENTED();
344
  }
345

    
346
  virtual ~NullMutex() {
347
    UNIMPLEMENTED();
348
  }
349

    
350
  virtual int Lock() {
351
    UNIMPLEMENTED();
352
    return 0;
353
  }
354

    
355
  virtual int Unlock() {
356
    UNIMPLEMENTED();
357
    return 0;
358
  }
359

    
360
 private:
361
  void* data_;
362
};
363

    
364

    
365
Mutex* OS::CreateMutex() {
366
  UNIMPLEMENTED();
367
  return new NullMutex();
368
}
369

    
370

    
371
class NullSemaphore : public Semaphore {
372
 public:
373
  explicit NullSemaphore(int count) : data_(NULL) {
374
    UNIMPLEMENTED();
375
  }
376

    
377
  virtual ~NullSemaphore() {
378
    UNIMPLEMENTED();
379
  }
380

    
381
  virtual void Wait() {
382
    UNIMPLEMENTED();
383
  }
384

    
385
  virtual void Signal() {
386
    UNIMPLEMENTED();
387
  }
388
 private:
389
  void* data_;
390
};
391

    
392

    
393
Semaphore* OS::CreateSemaphore(int count) {
394
  UNIMPLEMENTED();
395
  return new NullSemaphore(count);
396
}
397

    
398
#ifdef ENABLE_LOGGING_AND_PROFILING
399

    
400
class ProfileSampler::PlatformData  : public Malloced {
401
 public:
402
  PlatformData() {
403
    UNIMPLEMENTED();
404
  }
405
};
406

    
407

    
408
ProfileSampler::ProfileSampler(int interval) {
409
  UNIMPLEMENTED();
410
  // Shared setup follows.
411
  data_ = new PlatformData();
412
  interval_ = interval;
413
  active_ = false;
414
}
415

    
416

    
417
ProfileSampler::~ProfileSampler() {
418
  UNIMPLEMENTED();
419
  // Shared tear down follows.
420
  delete data_;
421
}
422

    
423

    
424
void ProfileSampler::Start() {
425
  UNIMPLEMENTED();
426
}
427

    
428

    
429
void ProfileSampler::Stop() {
430
  UNIMPLEMENTED();
431
}
432

    
433
#endif  // ENABLE_LOGGING_AND_PROFILING
434

    
435
} }  // namespace v8::internal