Chromium Code Reviews| 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 |