OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/builtins/builtins.h" | 5 #include "src/builtins/builtins.h" |
6 #include "src/code-events.h" | 6 #include "src/code-events.h" |
7 #include "src/code-stub-assembler.h" | 7 #include "src/code-stub-assembler.h" |
8 #include "src/ic/ic-state.h" | 8 #include "src/ic/ic-state.h" |
9 #include "src/interface-descriptors.h" | 9 #include "src/interface-descriptors.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 PostBuildProfileAndTracing(isolate, *code, name); | 77 PostBuildProfileAndTracing(isolate, *code, name); |
78 return *code; | 78 return *code; |
79 } | 79 } |
80 | 80 |
81 // Builder for builtins implemented in TurboFan with JS linkage. | 81 // Builder for builtins implemented in TurboFan with JS linkage. |
82 Code* BuildWithCodeStubAssemblerJS(Isolate* isolate, | 82 Code* BuildWithCodeStubAssemblerJS(Isolate* isolate, |
83 CodeAssemblerGenerator generator, int argc, | 83 CodeAssemblerGenerator generator, int argc, |
84 Code::Flags flags, const char* name) { | 84 Code::Flags flags, const char* name) { |
85 HandleScope scope(isolate); | 85 HandleScope scope(isolate); |
86 Zone zone(isolate->allocator(), ZONE_NAME); | 86 Zone zone(isolate->allocator(), ZONE_NAME); |
87 const int argc_with_recv = argc + 1; | 87 const int argc_with_recv = |
| 88 (argc == SharedFunctionInfo::kDontAdaptArgumentsSentinel) ? 0 : argc + 1; |
88 CodeStubAssembler assembler(isolate, &zone, argc_with_recv, flags, name); | 89 CodeStubAssembler assembler(isolate, &zone, argc_with_recv, flags, name); |
89 generator(&assembler); | 90 generator(&assembler); |
90 Handle<Code> code = assembler.GenerateCode(); | 91 Handle<Code> code = assembler.GenerateCode(); |
91 PostBuildProfileAndTracing(isolate, *code, name); | 92 PostBuildProfileAndTracing(isolate, *code, name); |
92 return *code; | 93 return *code; |
93 } | 94 } |
94 | 95 |
95 // Builder for builtins implemented in TurboFan with CallStub linkage. | 96 // Builder for builtins implemented in TurboFan with CallStub linkage. |
96 Code* BuildWithCodeStubAssemblerCS(Isolate* isolate, | 97 Code* BuildWithCodeStubAssemblerCS(Isolate* isolate, |
97 CodeAssemblerGenerator generator, | 98 CodeAssemblerGenerator generator, |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 // TODO(jochen): Remove this. | 288 // TODO(jochen): Remove this. |
288 if (responsible_context.is_null()) { | 289 if (responsible_context.is_null()) { |
289 return true; | 290 return true; |
290 } | 291 } |
291 if (*responsible_context == target->context()) return true; | 292 if (*responsible_context == target->context()) return true; |
292 return isolate->MayAccess(responsible_context, target_global_proxy); | 293 return isolate->MayAccess(responsible_context, target_global_proxy); |
293 } | 294 } |
294 | 295 |
295 } // namespace internal | 296 } // namespace internal |
296 } // namespace v8 | 297 } // namespace v8 |
OLD | NEW |