Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Stop using HeapType in IC and Crankshaft
Browse files Browse the repository at this point in the history
BUG=

Review URL: https://codereview.chromium.org/935603002

Cr-Commit-Position: refs/heads/master@{#26696}
  • Loading branch information
verwaest authored and Commit bot committed Feb 17, 2015
1 parent 0a4047a commit 119cb56
Show file tree
Hide file tree
Showing 25 changed files with 397 additions and 531 deletions.
29 changes: 6 additions & 23 deletions src/accessors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,10 @@ static V8_INLINE bool CheckForName(Handle<Name> name,

// Returns true for properties that are accessors to object fields.
// If true, *object_offset contains offset of object field.
template <class T>
bool Accessors::IsJSObjectFieldAccessor(typename T::TypeHandle type,
Handle<Name> name,
bool Accessors::IsJSObjectFieldAccessor(Handle<Map> map, Handle<Name> name,
int* object_offset) {
Isolate* isolate = name->GetIsolate();

if (type->Is(T::String())) {
return CheckForName(name, isolate->factory()->length_string(),
String::kLengthOffset, object_offset);
}

if (!type->IsClass()) return false;
Handle<Map> map = type->AsClass()->Map();

switch (map->instance_type()) {
case JS_ARRAY_TYPE:
return
Expand All @@ -107,23 +97,16 @@ bool Accessors::IsJSObjectFieldAccessor(typename T::TypeHandle type,
CheckForName(name, isolate->factory()->byte_offset_string(),
JSDataView::kByteOffsetOffset, object_offset);
default:
if (map->instance_type() < FIRST_NONSTRING_TYPE) {
return CheckForName(name, isolate->factory()->length_string(),
String::kLengthOffset, object_offset);
}

return false;
}
}


template
bool Accessors::IsJSObjectFieldAccessor<Type>(Type* type,
Handle<Name> name,
int* object_offset);


template
bool Accessors::IsJSObjectFieldAccessor<HeapType>(Handle<HeapType> type,
Handle<Name> name,
int* object_offset);


bool SetPropertyOnInstanceIfInherited(
Isolate* isolate, const v8::PropertyCallbackInfo<void>& info,
v8::Local<v8::Name> name, Handle<Object> value) {
Expand Down
4 changes: 1 addition & 3 deletions src/accessors.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ class Accessors : public AllStatic {

// Returns true for properties that are accessors to object fields.
// If true, *object_offset contains offset of object field.
template <class T>
static bool IsJSObjectFieldAccessor(typename T::TypeHandle type,
Handle<Name> name,
static bool IsJSObjectFieldAccessor(Handle<Map> map, Handle<Name> name,
int* object_offset);

static Handle<AccessorInfo> MakeAccessor(
Expand Down
Loading

0 comments on commit 119cb56

Please sign in to comment.