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 "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "code-stubs.h" | 9 #include "code-stubs.h" |
10 #include "codegen.h" | 10 #include "codegen.h" |
(...skipping 3250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3261 __ bind(&null); | 3261 __ bind(&null); |
3262 __ LoadRoot(rax, Heap::kNullValueRootIndex); | 3262 __ LoadRoot(rax, Heap::kNullValueRootIndex); |
3263 | 3263 |
3264 // All done. | 3264 // All done. |
3265 __ bind(&done); | 3265 __ bind(&done); |
3266 | 3266 |
3267 context()->Plug(rax); | 3267 context()->Plug(rax); |
3268 } | 3268 } |
3269 | 3269 |
3270 | 3270 |
3271 void FullCodeGenerator::EmitLog(CallRuntime* expr) { | |
3272 // Conditionally generate a log call. | |
3273 // Args: | |
3274 // 0 (literal string): The type of logging (corresponds to the flags). | |
3275 // This is used to determine whether or not to generate the log call. | |
3276 // 1 (string): Format string. Access the string at argument index 2 | |
3277 // with '%2s' (see Logger::LogRuntime for all the formats). | |
3278 // 2 (array): Arguments to the format string. | |
3279 ZoneList<Expression*>* args = expr->arguments(); | |
3280 ASSERT_EQ(args->length(), 3); | |
3281 if (CodeGenerator::ShouldGenerateLog(isolate(), args->at(0))) { | |
3282 VisitForStackValue(args->at(1)); | |
3283 VisitForStackValue(args->at(2)); | |
3284 __ CallRuntime(Runtime::kHiddenLog, 2); | |
3285 } | |
3286 // Finally, we're expected to leave a value on the top of the stack. | |
3287 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); | |
3288 context()->Plug(rax); | |
3289 } | |
3290 | |
3291 | |
3292 void FullCodeGenerator::EmitSubString(CallRuntime* expr) { | 3271 void FullCodeGenerator::EmitSubString(CallRuntime* expr) { |
3293 // Load the arguments on the stack and call the stub. | 3272 // Load the arguments on the stack and call the stub. |
3294 SubStringStub stub(isolate()); | 3273 SubStringStub stub(isolate()); |
3295 ZoneList<Expression*>* args = expr->arguments(); | 3274 ZoneList<Expression*>* args = expr->arguments(); |
3296 ASSERT(args->length() == 3); | 3275 ASSERT(args->length() == 3); |
3297 VisitForStackValue(args->at(0)); | 3276 VisitForStackValue(args->at(0)); |
3298 VisitForStackValue(args->at(1)); | 3277 VisitForStackValue(args->at(1)); |
3299 VisitForStackValue(args->at(2)); | 3278 VisitForStackValue(args->at(2)); |
3300 __ CallStub(&stub); | 3279 __ CallStub(&stub); |
3301 context()->Plug(rax); | 3280 context()->Plug(rax); |
(...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4854 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4833 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
4855 Assembler::target_address_at(call_target_address, | 4834 Assembler::target_address_at(call_target_address, |
4856 unoptimized_code)); | 4835 unoptimized_code)); |
4857 return OSR_AFTER_STACK_CHECK; | 4836 return OSR_AFTER_STACK_CHECK; |
4858 } | 4837 } |
4859 | 4838 |
4860 | 4839 |
4861 } } // namespace v8::internal | 4840 } } // namespace v8::internal |
4862 | 4841 |
4863 #endif // V8_TARGET_ARCH_X64 | 4842 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |