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

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

Issue 12700006: Replace ICStub for array.length with hydrogen stub (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: New patch Created 7 years, 9 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
Index: src/code-stubs-hydrogen.cc
diff --git a/src/code-stubs-hydrogen.cc b/src/code-stubs-hydrogen.cc
index ab2fb08a44c12e85491f7b67fd527b802fc2a0f7..64e6e0a912a4cc2e95416266230cb2acfd356e4e 100644
--- a/src/code-stubs-hydrogen.cc
+++ b/src/code-stubs-hydrogen.cc
@@ -30,6 +30,7 @@
#include "code-stubs.h"
#include "hydrogen.h"
#include "lithium.h"
+#include "stub-cache.h"
namespace v8 {
namespace internal {
@@ -237,6 +238,33 @@ Handle<Code> KeyedLoadFastElementStub::GenerateCode() {
template <>
+HValue* CodeStubGraphBuilder<FastArrayLengthStub>::BuildCodeStub() {
+ HInstruction* load = BuildFastArrayLengthLoad(GetParameter(0));
+ AddInstruction(load);
+ return load;
+}
+
+
+Handle<Code> FastArrayLengthStub::GenerateCode() {
+ CodeStubGraphBuilder<FastArrayLengthStub> builder(this);
+ LChunk* chunk = OptimizeGraph(builder.CreateGraph());
+ return chunk->Codegen(Code::COMPILED_STUB);
+}
+
+void FastArrayLengthStub::InitializeInterfaceDescriptor(
+ Isolate* isolate,
+ CodeStubInterfaceDescriptor* descriptor) {
+ descriptor->register_param_count_ = 2;
danno 2013/03/12 11:16:16 Descriptors are persistent, but the lifetime of re
+ // See LoadStubCompiler::registers().
+ registers_[0] = receiver_;
+ registers_[1] = LoadStubCompiler::name();
+ descriptor->register_params_ = registers_;
+ descriptor->deoptimization_handler_ =
+ Runtime::FunctionForId(Runtime::kUnexpectedDeopt)->entry;
+}
+
+
+template <>
HValue* CodeStubGraphBuilder<TransitionElementsKindStub>::BuildCodeStub() {
Zone* zone = this->zone();

Powered by Google App Engine
This is Rietveld 408576698