10
10
#include < iv/lv5/jsobject_fwd.h>
11
11
#include < iv/lv5/context.h>
12
12
#include < iv/lv5/jsenv.h>
13
- #include < iv/lv5/jsreference.h>
14
13
#include < iv/lv5/jsbooleanobject.h>
15
14
#include < iv/lv5/jsnumberobject.h>
16
15
#include < iv/lv5/jsstringobject.h>
@@ -114,10 +113,6 @@ inline bool JSLayout::IsObject() const {
114
113
return IsCell () && cell ()->tag () == radio::OBJECT;
115
114
}
116
115
117
- inline bool JSLayout::IsReference () const {
118
- return IsCell () && cell ()->tag () == radio::REFERENCE;
119
- }
120
-
121
116
inline bool JSLayout::IsEnvironment () const {
122
117
return IsCell () && cell ()->tag () == radio::ENVIRONMENT;
123
118
}
@@ -130,11 +125,6 @@ inline bool JSLayout::IsPrimitive() const {
130
125
return IsNumber () || IsString () || IsBoolean () || IsSymbol ();
131
126
}
132
127
133
- inline JSReference* JSLayout::reference () const {
134
- assert (IsReference ());
135
- return static_cast <JSReference*>(value_.cell_ );
136
- }
137
-
138
128
inline JSEnv* JSLayout::environment () const {
139
129
assert (IsEnvironment ());
140
130
return static_cast <JSEnv*>(value_.cell_ );
@@ -219,10 +209,6 @@ inline void JSLayout::set_value(JSSymbol* val) {
219
209
value_.cell_ = static_cast <radio::Cell*>(val);
220
210
}
221
211
222
- inline void JSLayout::set_value (JSReference* val) {
223
- value_.cell_ = static_cast <radio::Cell*>(val);
224
- }
225
-
226
212
inline void JSLayout::set_value (JSEnv* val) {
227
213
value_.cell_ = static_cast <radio::Cell*>(val);
228
214
}
@@ -323,16 +309,15 @@ namespace jsval32 {
323
309
324
310
static const uint32_t kOtherCellTag = 0xffffffff ; // cell range end
325
311
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 ;
336
321
337
322
inline bool InPtrRange (uint32_t tag) {
338
323
return kObjectTag <= tag;
@@ -384,10 +369,6 @@ inline bool JSLayout::IsNumber() const {
384
369
return value_.struct_ .tag_ < detail::jsval32::kNumberTag ;
385
370
}
386
371
387
- inline bool JSLayout::IsReference () const {
388
- return value_.struct_ .tag_ == detail::jsval32::kReferenceTag ;
389
- }
390
-
391
372
inline bool JSLayout::IsEnvironment () const {
392
373
return value_.struct_ .tag_ == detail::jsval32::kEnvironmentTag ;
393
374
}
@@ -404,11 +385,6 @@ inline bool JSLayout::IsPrimitive() const {
404
385
return IsNumber () || IsString () || IsBoolean () || IsSymbol ();
405
386
}
406
387
407
- inline JSReference* JSLayout::reference () const {
408
- assert (IsReference ());
409
- return value_.struct_ .payload_ .reference_ ;
410
- }
411
-
412
388
inline JSEnv* JSLayout::environment () const {
413
389
assert (IsEnvironment ());
414
390
return value_.struct_ .payload_ .environment_ ;
@@ -500,11 +476,6 @@ inline void JSLayout::set_value(JSSymbol* val) {
500
476
value_.struct_ .tag_ = detail::jsval32::kSymbolTag ;
501
477
}
502
478
503
- inline void JSLayout::set_value (JSReference* ref) {
504
- value_.struct_ .payload_ .reference_ = ref;
505
- value_.struct_ .tag_ = detail::jsval32::kReferenceTag ;
506
- }
507
-
508
479
inline void JSLayout::set_value (JSEnv* ref) {
509
480
value_.struct_ .payload_ .environment_ = ref;
510
481
value_.struct_ .tag_ = detail::jsval32::kEnvironmentTag ;
@@ -854,7 +825,7 @@ inline JSVal JSVal::ToPrimitive(Context* ctx,
854
825
if (IsObject ()) {
855
826
return object ()->DefaultValue (ctx, hint, e);
856
827
} else {
857
- assert (!IsEnvironment () && !IsReference () && ! IsEmpty ());
828
+ assert (!IsEnvironment () && !IsEmpty ());
858
829
return *this ;
859
830
}
860
831
}
@@ -902,7 +873,7 @@ inline bool JSLayout::IsCallable() const {
902
873
}
903
874
904
875
inline void JSLayout::CheckObjectCoercible (Error* e) const {
905
- assert (!IsEnvironment () && !IsReference () && ! IsEmpty ());
876
+ assert (!IsEnvironment () && !IsEmpty ());
906
877
if (IsNullOrUndefined ()) {
907
878
e->Report (Error::Type, " null or undefined has no properties" );
908
879
}
0 commit comments