Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Unified Diff: src/code-stubs-hydrogen.cc

Issue 329463005: Revert 21720: "Introduce FieldIndex to unify and abstract property/field offset" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/code-stubs.h ('k') | src/deoptimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index 88e71faca9ee9dca4db2991d81117fbb8568a147..9e974138926d711ee4f5033364152d836d3d60a1 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -5,7 +5,6 @@
#include "src/v8.h"
#include "src/code-stubs.h"
-#include "src/field-index.h"
#include "src/hydrogen.h"
#include "src/lithium.h"
@@ -60,7 +59,9 @@ class CodeStubGraphBuilderBase : public HGraphBuilder {
Isolate* isolate() { return info_.isolate(); }
HLoadNamedField* BuildLoadNamedField(HValue* object,
- FieldIndex index);
+ Representation representation,
+ int offset,
+ bool is_inobject);
enum ArgumentClass {
NONE,
@@ -552,15 +553,14 @@ Handle<Code> KeyedLoadFastElementStub::GenerateCode() {
HLoadNamedField* CodeStubGraphBuilderBase::BuildLoadNamedField(
- HValue* object, FieldIndex index) {
- Representation representation = index.is_double()
- ? Representation::Double()
- : Representation::Tagged();
- int offset = index.offset();
- HObjectAccess access = index.is_inobject()
+ HValue* object,
+ Representation representation,
+ int offset,
+ bool is_inobject) {
+ HObjectAccess access = is_inobject
? HObjectAccess::ForObservableJSObjectOffset(offset, representation)
: HObjectAccess::ForBackingStoreOffset(offset, representation);
- if (index.is_double()) {
+ if (representation.IsDouble()) {
// Load the heap number.
object = Add<HLoadNamedField>(
object, static_cast<HValue*>(NULL),
@@ -574,7 +574,10 @@ HLoadNamedField* CodeStubGraphBuilderBase::BuildLoadNamedField(
template<>
HValue* CodeStubGraphBuilder<LoadFieldStub>::BuildCodeStub() {
- return BuildLoadNamedField(GetParameter(0), casted_stub()->index());
+ return BuildLoadNamedField(GetParameter(0),
+ casted_stub()->representation(),
+ casted_stub()->offset(),
+ casted_stub()->is_inobject());
}
@@ -585,10 +588,10 @@ Handle<Code> LoadFieldStub::GenerateCode() {
template<>
HValue* CodeStubGraphBuilder<StringLengthStub>::BuildCodeStub() {
- HValue* string = BuildLoadNamedField(GetParameter(0),
- FieldIndex::ForInObjectOffset(JSValue::kValueOffset));
- return BuildLoadNamedField(string,
- FieldIndex::ForInObjectOffset(String::kLengthOffset));
+ HValue* string = BuildLoadNamedField(
+ GetParameter(0), Representation::Tagged(), JSValue::kValueOffset, true);
+ return BuildLoadNamedField(
+ string, Representation::Tagged(), String::kLengthOffset, true);
}
« no previous file with comments | « src/code-stubs.h ('k') | src/deoptimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698