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

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

Issue 300283002: Introduce FieldIndex to unify and abstract property/field offset (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix mutable boxed double runtime function 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 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));
}
« 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