| Index: src/code-stubs-hydrogen.cc
|
| diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
|
| index 9e974138926d711ee4f5033364152d836d3d60a1..88e71faca9ee9dca4db2991d81117fbb8568a147 100644
|
| --- a/src/code-stubs-hydrogen.cc
|
| +++ b/src/code-stubs-hydrogen.cc
|
| @@ -5,6 +5,7 @@
|
| #include "src/v8.h"
|
|
|
| #include "src/code-stubs.h"
|
| +#include "src/field-index.h"
|
| #include "src/hydrogen.h"
|
| #include "src/lithium.h"
|
|
|
| @@ -59,9 +60,7 @@ class CodeStubGraphBuilderBase : public HGraphBuilder {
|
| Isolate* isolate() { return info_.isolate(); }
|
|
|
| HLoadNamedField* BuildLoadNamedField(HValue* object,
|
| - Representation representation,
|
| - int offset,
|
| - bool is_inobject);
|
| + FieldIndex index);
|
|
|
| enum ArgumentClass {
|
| NONE,
|
| @@ -553,14 +552,15 @@ Handle<Code> KeyedLoadFastElementStub::GenerateCode() {
|
|
|
|
|
| HLoadNamedField* CodeStubGraphBuilderBase::BuildLoadNamedField(
|
| - HValue* object,
|
| - Representation representation,
|
| - int offset,
|
| - bool is_inobject) {
|
| - HObjectAccess access = is_inobject
|
| + HValue* object, FieldIndex index) {
|
| + Representation representation = index.is_double()
|
| + ? Representation::Double()
|
| + : Representation::Tagged();
|
| + int offset = index.offset();
|
| + HObjectAccess access = index.is_inobject()
|
| ? HObjectAccess::ForObservableJSObjectOffset(offset, representation)
|
| : HObjectAccess::ForBackingStoreOffset(offset, representation);
|
| - if (representation.IsDouble()) {
|
| + if (index.is_double()) {
|
| // Load the heap number.
|
| object = Add<HLoadNamedField>(
|
| object, static_cast<HValue*>(NULL),
|
| @@ -574,10 +574,7 @@ HLoadNamedField* CodeStubGraphBuilderBase::BuildLoadNamedField(
|
|
|
| template<>
|
| HValue* CodeStubGraphBuilder<LoadFieldStub>::BuildCodeStub() {
|
| - return BuildLoadNamedField(GetParameter(0),
|
| - casted_stub()->representation(),
|
| - casted_stub()->offset(),
|
| - casted_stub()->is_inobject());
|
| + return BuildLoadNamedField(GetParameter(0), casted_stub()->index());
|
| }
|
|
|
|
|
| @@ -588,10 +585,10 @@ Handle<Code> LoadFieldStub::GenerateCode() {
|
|
|
| template<>
|
| HValue* CodeStubGraphBuilder<StringLengthStub>::BuildCodeStub() {
|
| - HValue* string = BuildLoadNamedField(
|
| - GetParameter(0), Representation::Tagged(), JSValue::kValueOffset, true);
|
| - return BuildLoadNamedField(
|
| - string, Representation::Tagged(), String::kLengthOffset, true);
|
| + HValue* string = BuildLoadNamedField(GetParameter(0),
|
| + FieldIndex::ForInObjectOffset(JSValue::kValueOffset));
|
| + return BuildLoadNamedField(string,
|
| + FieldIndex::ForInObjectOffset(String::kLengthOffset));
|
| }
|
|
|
|
|
|
|