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

Unified Diff: src/compiler/code-stubs-turbofan.cc

Issue 925373002: Test StringLengthStub generation via TurboFan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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-hydrogen.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-stubs-turbofan.cc
diff --git a/src/compiler/code-stubs-turbofan.cc b/src/compiler/code-stubs-turbofan.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4ee17185fb43353d8071e6406ef26b1c7c5cc880
--- /dev/null
+++ b/src/compiler/code-stubs-turbofan.cc
@@ -0,0 +1,32 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "src/code-stubs.h"
+#include "src/compiler/graph.h"
+#include "src/compiler/linkage.h"
+#include "src/compiler/pipeline.h"
+#include "src/compiler/raw-machine-assembler.h"
+#include "src/handles.h"
+
+namespace v8 {
+namespace internal {
+
+Handle<Code> StringLengthStub::GenerateCode() {
+ using namespace v8::internal::compiler;
+ CompilationInfoWithZone info(this, isolate());
+ Graph graph(info.zone());
+ CallDescriptor* descriptor = Linkage::ComputeIncoming(info.zone(), &info);
+ RawMachineAssembler m(isolate(), &graph, descriptor->GetMachineSignature());
+
+ Node* str = m.Load(kMachAnyTagged, m.Parameter(0),
+ m.Int32Constant(JSValue::kValueOffset - kHeapObjectTag));
+ Node* len = m.Load(kMachAnyTagged, str,
+ m.Int32Constant(String::kLengthOffset - kHeapObjectTag));
+ m.Return(len);
+
+ return Pipeline::GenerateCodeForTesting(&info, &graph, m.Export());
titzer 2015/02/17 11:46:46 This method will need to be renamed to pass the pr
+}
+
+} // namespace internal
+} // namespace v8
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698