*/
class Scope {
public:
- inline Scope(Handle<Context> context) : context_(context) {
+ explicit inline Scope(Handle<Context> context) : context_(context) {
context_->Enter();
}
inline ~Scope() { context_->Exit(); }
class NeanderObject {
public:
explicit NeanderObject(int size);
- inline NeanderObject(v8::internal::Handle<v8::internal::Object> obj);
- inline NeanderObject(v8::internal::Object* obj);
+ explicit inline NeanderObject(v8::internal::Handle<v8::internal::Object> obj);
+ explicit inline NeanderObject(v8::internal::Object* obj);
inline v8::internal::Object* get(int index);
inline void set(int index, v8::internal::Object* value);
inline v8::internal::Handle<v8::internal::JSObject> value() { return value_; }
class NeanderArray {
public:
NeanderArray();
- inline NeanderArray(v8::internal::Handle<v8::internal::Object> obj);
+ explicit inline NeanderArray(v8::internal::Handle<v8::internal::Object> obj);
inline v8::internal::Handle<v8::internal::JSObject> value() {
return obj_.value();
}
// Fill these accessors into the dictionary.
DescriptorArray* descs = map->instance_descriptors();
for (int i = 0; i < descs->number_of_descriptors(); i++) {
- PropertyDetails details = descs->GetDetails(i);
+ PropertyDetails details(descs->GetDetails(i));
ASSERT(details.type() == CALLBACKS); // Only accessors are expected.
PropertyDetails d =
PropertyDetails(details.attributes(), CALLBACKS, details.index());
class OffsetsVector {
public:
- inline OffsetsVector(int num_registers)
+ explicit inline OffsetsVector(int num_registers)
: offsets_vector_length_(num_registers) {
if (offsets_vector_length_ > Isolate::kJSRegexpStaticOffsetsVectorSize) {
vector_ = NewArray<int>(offsets_vector_length_);
inline VirtualFrame();
// Construct an invalid virtual frame, used by JumpTargets.
- inline VirtualFrame(InvalidVirtualFrameInitializer* dummy);
+ explicit inline VirtualFrame(InvalidVirtualFrameInitializer* dummy);
// Construct a virtual frame as a clone of an existing one.
explicit inline VirtualFrame(VirtualFrame* original);
void DescriptorArray::Get(int descriptor_number, Descriptor* desc) {
desc->Init(GetKey(descriptor_number),
GetValue(descriptor_number),
- GetDetails(descriptor_number));
+ PropertyDetails(GetDetails(descriptor_number)));
}
set_flag(Smi::FromInt(rest_value | AttributesField::encode(attributes)));
}
+
+template<typename Shape, typename Key>
+void Dictionary<Shape, Key>::SetEntry(int entry,
+ Object* key,
+ Object* value) {
+ SetEntry(entry, key, value, PropertyDetails(Smi::FromInt(0)));
+}
+
+
template<typename Shape, typename Key>
void Dictionary<Shape, Key>::SetEntry(int entry,
Object* key,
DescriptorArray* descs = map_of_this->instance_descriptors();
for (int i = 0; i < descs->number_of_descriptors(); i++) {
- PropertyDetails details = descs->GetDetails(i);
+ PropertyDetails details(descs->GetDetails(i));
switch (details.type()) {
case CONSTANT_FUNCTION: {
PropertyDetails d =
DescriptorArray* descs = map()->instance_descriptors();
int result = 0;
for (int i = 0; i < descs->number_of_descriptors(); i++) {
- PropertyDetails details = descs->GetDetails(i);
+ PropertyDetails details(descs->GetDetails(i));
if (details.IsProperty() && (details.attributes() & filter) == 0) {
result++;
}
if (key->IsNumber()) {
uint32_t number = static_cast<uint32_t>(key->Number());
if (from <= number && number < to) {
- SetEntry(i, sentinel, sentinel, Smi::FromInt(0));
+ SetEntry(i, sentinel, sentinel);
removed_entries++;
}
}
if (details.IsDontDelete() && mode != JSObject::FORCE_DELETION) {
return heap->false_value();
}
- SetEntry(entry, heap->null_value(), heap->null_value(), Smi::FromInt(0));
+ SetEntry(entry, heap->null_value(), heap->null_value());
HashTable<Shape, Key>::ElementRemoved();
return heap->true_value();
}
}
// Conversion for storing details as Object*.
- inline PropertyDetails(Smi* smi);
+ explicit inline PropertyDetails(Smi* smi);
inline Smi* AsSmi();
PropertyType type() { return TypeField::decode(value_); }
Object* SlowReverseLookup(Object* value);
// Sets the entry to (key, value) pair.
+ inline void SetEntry(int entry,
+ Object* key,
+ Object* value);
inline void SetEntry(int entry,
Object* key,
Object* value,
class StringHasher {
public:
- inline StringHasher(int length);
+ explicit inline StringHasher(int length);
// Returns true if the hash of this string can be computed without
// looking at the contents.
public:
virtual void Seek(unsigned pos);
inline StringInputBuffer(): unibrow::InputBuffer<String, String*, 1024>() {}
- inline StringInputBuffer(String* backing):
+ explicit inline StringInputBuffer(String* backing):
unibrow::InputBuffer<String, String*, 1024>(backing) {}
};
virtual void Seek(unsigned pos);
inline SafeStringInputBuffer()
: unibrow::InputBuffer<String, String**, 256>() {}
- inline SafeStringInputBuffer(String** backing)
+ explicit inline SafeStringInputBuffer(String** backing)
: unibrow::InputBuffer<String, String**, 256>(backing) {}
};
number_ = number;
}
+ void DescriptorResult(JSObject* holder, Smi* details, int number) {
+ lookup_type_ = DESCRIPTOR_TYPE;
+ holder_ = holder;
+ details_ = PropertyDetails(details);
+ number_ = number;
+ }
+
void ConstantResult(JSObject* holder) {
lookup_type_ = CONSTANT_TYPE;
holder_ = holder;
ASSERT(index == this->index());
}
- inline Value(uint32_t value) : value_(value) {}
+ explicit inline Value(uint32_t value) : value_(value) {}
uint32_t raw() { return value_; }
void EmitPushConstantOperand(LOperand* operand);
struct JumpTableEntry {
- inline JumpTableEntry(Address entry)
+ explicit inline JumpTableEntry(Address entry)
: label(),
address(entry) { }
Label label;