OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 the V8 project authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "src/code-stubs.h" | |
6 #include "src/compiler/graph.h" | |
7 #include "src/compiler/linkage.h" | |
8 #include "src/compiler/pipeline.h" | |
9 #include "src/compiler/raw-machine-assembler.h" | |
10 #include "src/handles.h" | |
11 | |
12 namespace v8 { | |
13 namespace internal { | |
14 | |
15 Handle<Code> StringLengthStub::GenerateCode() { | |
16 using namespace v8::internal::compiler; | |
17 CompilationInfoWithZone info(this, isolate()); | |
18 Graph graph(info.zone()); | |
19 CallDescriptor* descriptor = Linkage::ComputeIncoming(info.zone(), &info); | |
20 RawMachineAssembler m(isolate(), &graph, descriptor->GetMachineSignature()); | |
21 | |
22 Node* str = m.Load(kMachAnyTagged, m.Parameter(0), | |
23 m.Int32Constant(JSValue::kValueOffset - kHeapObjectTag)); | |
24 Node* len = m.Load(kMachAnyTagged, str, | |
25 m.Int32Constant(String::kLengthOffset - kHeapObjectTag)); | |
26 m.Return(len); | |
27 | |
28 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
| |
29 } | |
30 | |
31 } // namespace internal | |
32 } // namespace v8 | |
OLD | NEW |