-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start implementing internal V8 APIs (#12821)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
- Loading branch information
1 parent
5bc45e2
commit dc2929d
Showing
86 changed files
with
3,636 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "V8Array.h" | ||
|
||
#include "V8HandleScope.h" | ||
|
||
using JSC::ArrayAllocationProfile; | ||
using JSC::JSArray; | ||
using JSC::JSValue; | ||
|
||
namespace v8 { | ||
|
||
Local<Array> Array::New(Isolate* isolate, Local<Value>* elements, size_t length) | ||
{ | ||
V8_UNIMPLEMENTED(); | ||
// TODO fix for v8 layout | ||
Zig::GlobalObject* globalObject = isolate->globalObject(); | ||
JSArray* array = JSC::constructArray(globalObject, | ||
static_cast<ArrayAllocationProfile*>(nullptr), | ||
reinterpret_cast<JSValue*>(elements), | ||
(unsigned int)length); | ||
return isolate->currentHandleScope()->createLocal<Array>(array); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#pragma once | ||
|
||
#include "v8.h" | ||
#include "V8Object.h" | ||
#include "V8Local.h" | ||
#include "V8Isolate.h" | ||
#include "V8Value.h" | ||
|
||
namespace v8 { | ||
|
||
class Array : public Object { | ||
public: | ||
BUN_EXPORT static Local<Array> New(Isolate* isolate, Local<Value>* elements, size_t length); | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "V8Boolean.h" | ||
#include "V8HandleScope.h" | ||
|
||
namespace v8 { | ||
|
||
bool Boolean::Value() const | ||
{ | ||
return localToJSValue(Isolate::GetCurrent()->globalInternals()).asBoolean(); | ||
} | ||
|
||
Local<Boolean> Boolean::New(Isolate* isolate, bool value) | ||
{ | ||
return isolate->currentHandleScope()->createLocal<Boolean>(JSC::jsBoolean(value)); | ||
} | ||
|
||
} |
Oops, something went wrong.