OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/code-stubs.h" | 5 #include "src/code-stubs.h" |
6 #include "src/compiler/js-graph.h" | 6 #include "src/compiler/js-graph.h" |
7 #include "src/compiler/node-properties.h" | 7 #include "src/compiler/node-properties.h" |
8 #include "src/compiler/typer.h" | 8 #include "src/compiler/typer.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 13 matching lines...) Expand all Loading... |
24 HeapConstant(isolate()->builtins()->AllocateInOldSpace())); | 24 HeapConstant(isolate()->builtins()->AllocateInOldSpace())); |
25 } | 25 } |
26 | 26 |
27 Node* JSGraph::ToNumberBuiltinConstant() { | 27 Node* JSGraph::ToNumberBuiltinConstant() { |
28 return CACHED(kToNumberBuiltinConstant, | 28 return CACHED(kToNumberBuiltinConstant, |
29 HeapConstant(isolate()->builtins()->ToNumber())); | 29 HeapConstant(isolate()->builtins()->ToNumber())); |
30 } | 30 } |
31 | 31 |
32 Node* JSGraph::CEntryStubConstant(int result_size, SaveFPRegsMode save_doubles, | 32 Node* JSGraph::CEntryStubConstant(int result_size, SaveFPRegsMode save_doubles, |
33 ArgvMode argv_mode, bool builtin_exit_frame) { | 33 ArgvMode argv_mode, bool builtin_exit_frame) { |
34 if (save_doubles == kDontSaveFPRegs && argv_mode == kArgvOnStack && | 34 if (save_doubles == kDontSaveFPRegs && argv_mode == kArgvOnStack) { |
35 result_size == 1) { | 35 DCHECK(result_size >= 1 && result_size <= 3); |
| 36 if (!builtin_exit_frame) { |
| 37 CachedNode key; |
| 38 if (result_size == 1) { |
| 39 key = kCEntryStub1Constant; |
| 40 } else if (result_size == 2) { |
| 41 key = kCEntryStub2Constant; |
| 42 } else { |
| 43 DCHECK(result_size == 3); |
| 44 key = kCEntryStub3Constant; |
| 45 } |
| 46 return CACHED( |
| 47 key, HeapConstant(CEntryStub(isolate(), result_size, save_doubles, |
| 48 argv_mode, builtin_exit_frame) |
| 49 .GetCode())); |
| 50 } |
36 CachedNode key = builtin_exit_frame | 51 CachedNode key = builtin_exit_frame |
37 ? kCEntryStubWithBuiltinExitFrameConstant | 52 ? kCEntryStub1WithBuiltinExitFrameConstant |
38 : kCEntryStubConstant; | 53 : kCEntryStub1Constant; |
39 return CACHED(key, | 54 return CACHED(key, |
40 HeapConstant(CEntryStub(isolate(), result_size, save_doubles, | 55 HeapConstant(CEntryStub(isolate(), result_size, save_doubles, |
41 argv_mode, builtin_exit_frame) | 56 argv_mode, builtin_exit_frame) |
42 .GetCode())); | 57 .GetCode())); |
43 } | 58 } |
44 CEntryStub stub(isolate(), result_size, save_doubles, argv_mode, | 59 CEntryStub stub(isolate(), result_size, save_doubles, argv_mode, |
45 builtin_exit_frame); | 60 builtin_exit_frame); |
46 return HeapConstant(stub.GetCode()); | 61 return HeapConstant(stub.GetCode()); |
47 } | 62 } |
48 | 63 |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 for (size_t i = 0; i < arraysize(cached_nodes_); i++) { | 292 for (size_t i = 0; i < arraysize(cached_nodes_); i++) { |
278 if (Node* node = cached_nodes_[i]) { | 293 if (Node* node = cached_nodes_[i]) { |
279 if (!node->IsDead()) nodes->push_back(node); | 294 if (!node->IsDead()) nodes->push_back(node); |
280 } | 295 } |
281 } | 296 } |
282 } | 297 } |
283 | 298 |
284 } // namespace compiler | 299 } // namespace compiler |
285 } // namespace internal | 300 } // namespace internal |
286 } // namespace v8 | 301 } // namespace v8 |
OLD | NEW |