Skip to content

Commit 6d436c1

Browse files
committed
Drop JSReference, it's not used anymore
It's originally used in teleporter Interpreter, but it's dropped now.
1 parent b9fd2e2 commit 6d436c1

File tree

3 files changed

+11
-111
lines changed

3 files changed

+11
-111
lines changed

Diff for: iv/lv5/jsreference.h

-55
This file was deleted.

Diff for: iv/lv5/jsval.h

+11-40
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <iv/lv5/jsobject_fwd.h>
1111
#include <iv/lv5/context.h>
1212
#include <iv/lv5/jsenv.h>
13-
#include <iv/lv5/jsreference.h>
1413
#include <iv/lv5/jsbooleanobject.h>
1514
#include <iv/lv5/jsnumberobject.h>
1615
#include <iv/lv5/jsstringobject.h>
@@ -114,10 +113,6 @@ inline bool JSLayout::IsObject() const {
114113
return IsCell() && cell()->tag() == radio::OBJECT;
115114
}
116115

117-
inline bool JSLayout::IsReference() const {
118-
return IsCell() && cell()->tag() == radio::REFERENCE;
119-
}
120-
121116
inline bool JSLayout::IsEnvironment() const {
122117
return IsCell() && cell()->tag() == radio::ENVIRONMENT;
123118
}
@@ -130,11 +125,6 @@ inline bool JSLayout::IsPrimitive() const {
130125
return IsNumber() || IsString() || IsBoolean() || IsSymbol();
131126
}
132127

133-
inline JSReference* JSLayout::reference() const {
134-
assert(IsReference());
135-
return static_cast<JSReference*>(value_.cell_);
136-
}
137-
138128
inline JSEnv* JSLayout::environment() const {
139129
assert(IsEnvironment());
140130
return static_cast<JSEnv*>(value_.cell_);
@@ -219,10 +209,6 @@ inline void JSLayout::set_value(JSSymbol* val) {
219209
value_.cell_ = static_cast<radio::Cell*>(val);
220210
}
221211

222-
inline void JSLayout::set_value(JSReference* val) {
223-
value_.cell_ = static_cast<radio::Cell*>(val);
224-
}
225-
226212
inline void JSLayout::set_value(JSEnv* val) {
227213
value_.cell_ = static_cast<radio::Cell*>(val);
228214
}
@@ -323,16 +309,15 @@ namespace jsval32 {
323309

324310
static const uint32_t kOtherCellTag = 0xffffffff; // cell range end
325311
static const uint32_t kEnvironmentTag = 0xfffffffe;
326-
static const uint32_t kReferenceTag = 0xfffffffd;
327-
static const uint32_t kStringTag = 0xfffffffc;
328-
static const uint32_t kSymbolTag = 0xfffffffb;
329-
static const uint32_t kObjectTag = 0xfffffffa; // cell range start
330-
static const uint32_t kEmptyTag = 0xfffffff9;
331-
static const uint32_t kUndefinedTag = 0xfffffff8;
332-
static const uint32_t kNullTag = 0xfffffff7;
333-
static const uint32_t kBoolTag = 0xfffffff6;
334-
static const uint32_t kNumberTag = 0xfffffff5;
335-
static const uint32_t kInt32Tag = 0xfffffff4;
312+
static const uint32_t kStringTag = 0xfffffffd;
313+
static const uint32_t kSymbolTag = 0xfffffffc;
314+
static const uint32_t kObjectTag = 0xfffffffb; // cell range start
315+
static const uint32_t kEmptyTag = 0xfffffffa;
316+
static const uint32_t kUndefinedTag = 0xfffffff9;
317+
static const uint32_t kNullTag = 0xfffffff8;
318+
static const uint32_t kBoolTag = 0xfffffff7;
319+
static const uint32_t kNumberTag = 0xfffffff6;
320+
static const uint32_t kInt32Tag = 0xfffffff5;
336321

337322
inline bool InPtrRange(uint32_t tag) {
338323
return kObjectTag <= tag;
@@ -384,10 +369,6 @@ inline bool JSLayout::IsNumber() const {
384369
return value_.struct_.tag_ < detail::jsval32::kNumberTag;
385370
}
386371

387-
inline bool JSLayout::IsReference() const {
388-
return value_.struct_.tag_ == detail::jsval32::kReferenceTag;
389-
}
390-
391372
inline bool JSLayout::IsEnvironment() const {
392373
return value_.struct_.tag_ == detail::jsval32::kEnvironmentTag;
393374
}
@@ -404,11 +385,6 @@ inline bool JSLayout::IsPrimitive() const {
404385
return IsNumber() || IsString() || IsBoolean() || IsSymbol();
405386
}
406387

407-
inline JSReference* JSLayout::reference() const {
408-
assert(IsReference());
409-
return value_.struct_.payload_.reference_;
410-
}
411-
412388
inline JSEnv* JSLayout::environment() const {
413389
assert(IsEnvironment());
414390
return value_.struct_.payload_.environment_;
@@ -500,11 +476,6 @@ inline void JSLayout::set_value(JSSymbol* val) {
500476
value_.struct_.tag_ = detail::jsval32::kSymbolTag;
501477
}
502478

503-
inline void JSLayout::set_value(JSReference* ref) {
504-
value_.struct_.payload_.reference_ = ref;
505-
value_.struct_.tag_ = detail::jsval32::kReferenceTag;
506-
}
507-
508479
inline void JSLayout::set_value(JSEnv* ref) {
509480
value_.struct_.payload_.environment_ = ref;
510481
value_.struct_.tag_ = detail::jsval32::kEnvironmentTag;
@@ -854,7 +825,7 @@ inline JSVal JSVal::ToPrimitive(Context* ctx,
854825
if (IsObject()) {
855826
return object()->DefaultValue(ctx, hint, e);
856827
} else {
857-
assert(!IsEnvironment() && !IsReference() && !IsEmpty());
828+
assert(!IsEnvironment() && !IsEmpty());
858829
return *this;
859830
}
860831
}
@@ -902,7 +873,7 @@ inline bool JSLayout::IsCallable() const {
902873
}
903874

904875
inline void JSLayout::CheckObjectCoercible(Error* e) const {
905-
assert(!IsEnvironment() && !IsReference() && !IsEmpty());
876+
assert(!IsEnvironment() && !IsEmpty());
906877
if (IsNullOrUndefined()) {
907878
e->Report(Error::Type, "null or undefined has no properties");
908879
}

Diff for: iv/lv5/jsval_fwd.h

-16
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class Cell;
2727
class Error;
2828
class JSEnv;
2929
class Context;
30-
class JSReference;
3130
class JSEnv;
3231
class JSObject;
3332
class JSString;
@@ -51,7 +50,6 @@ struct Layout<4, true> {
5150
JSObject* object_;
5251
JSString* string_;
5352
JSSymbol* symbol_;
54-
JSReference* reference_;
5553
JSEnv* environment_;
5654
int32_t int32_;
5755
radio::Cell* cell_;
@@ -75,7 +73,6 @@ struct Layout<4, false> {
7573
JSObject* object_;
7674
JSString* string_;
7775
JSSymbol* symbol_;
78-
JSReference* reference_;
7976
JSEnv* environment_;
8077
int32_t int32_;
8178
radio::Cell* cell_;
@@ -100,7 +97,6 @@ struct Layout<8, true> {
10097
JSObject* object_;
10198
JSString* string_;
10299
JSSymbol* symbol_;
103-
JSReference* reference_;
104100
JSEnv* environment_;
105101
JSVal* jsvalref_;
106102
int32_t int32_;
@@ -128,7 +124,6 @@ struct Layout<8, false> {
128124
JSObject* object_;
129125
JSString* string_;
130126
JSSymbol* symbol_;
131-
JSReference* reference_;
132127
JSEnv* environment_;
133128
JSVal* jsvalref_;
134129
int32_t int32_;
@@ -274,16 +269,12 @@ class JSLayout {
274269

275270
bool IsObject() const;
276271

277-
bool IsReference() const;
278-
279272
bool IsEnvironment() const;
280273

281274
bool IsOtherCell() const;
282275

283276
bool IsPrimitive() const;
284277

285-
JSReference* reference() const;
286-
287278
JSEnv* environment() const;
288279

289280
JSString* string() const;
@@ -314,8 +305,6 @@ class JSLayout {
314305

315306
void set_value(JSSymbol* val);
316307

317-
void set_value(JSReference* val);
318-
319308
void set_value(JSEnv* val);
320309

321310
void set_value(detail::JSTrueType val);
@@ -395,11 +384,6 @@ class JSVal : public JSLayout {
395384
set_value(val);
396385
}
397386

398-
JSVal(JSReference* val) // NOLINT
399-
: JSLayout() {
400-
set_value(val);
401-
}
402-
403387
JSVal(JSEnv* val) // NOLINT
404388
: JSLayout() {
405389
set_value(val);

0 commit comments

Comments
 (0)