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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "code-stubs.h" | 9 #include "code-stubs.h" |
10 #include "codegen.h" | 10 #include "codegen.h" |
(...skipping 3261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3272 __ bind(&null); | 3272 __ bind(&null); |
3273 __ mov(eax, isolate()->factory()->null_value()); | 3273 __ mov(eax, isolate()->factory()->null_value()); |
3274 | 3274 |
3275 // All done. | 3275 // All done. |
3276 __ bind(&done); | 3276 __ bind(&done); |
3277 | 3277 |
3278 context()->Plug(eax); | 3278 context()->Plug(eax); |
3279 } | 3279 } |
3280 | 3280 |
3281 | 3281 |
3282 void FullCodeGenerator::EmitLog(CallRuntime* expr) { | |
3283 // Conditionally generate a log call. | |
3284 // Args: | |
3285 // 0 (literal string): The type of logging (corresponds to the flags). | |
3286 // This is used to determine whether or not to generate the log call. | |
3287 // 1 (string): Format string. Access the string at argument index 2 | |
3288 // with '%2s' (see Logger::LogRuntime for all the formats). | |
3289 // 2 (array): Arguments to the format string. | |
3290 ZoneList<Expression*>* args = expr->arguments(); | |
3291 ASSERT_EQ(args->length(), 3); | |
3292 if (CodeGenerator::ShouldGenerateLog(isolate(), args->at(0))) { | |
3293 VisitForStackValue(args->at(1)); | |
3294 VisitForStackValue(args->at(2)); | |
3295 __ CallRuntime(Runtime::kHiddenLog, 2); | |
3296 } | |
3297 // Finally, we're expected to leave a value on the top of the stack. | |
3298 __ mov(eax, isolate()->factory()->undefined_value()); | |
3299 context()->Plug(eax); | |
3300 } | |
3301 | |
3302 | |
3303 void FullCodeGenerator::EmitSubString(CallRuntime* expr) { | 3282 void FullCodeGenerator::EmitSubString(CallRuntime* expr) { |
3304 // Load the arguments on the stack and call the stub. | 3283 // Load the arguments on the stack and call the stub. |
3305 SubStringStub stub(isolate()); | 3284 SubStringStub stub(isolate()); |
3306 ZoneList<Expression*>* args = expr->arguments(); | 3285 ZoneList<Expression*>* args = expr->arguments(); |
3307 ASSERT(args->length() == 3); | 3286 ASSERT(args->length() == 3); |
3308 VisitForStackValue(args->at(0)); | 3287 VisitForStackValue(args->at(0)); |
3309 VisitForStackValue(args->at(1)); | 3288 VisitForStackValue(args->at(1)); |
3310 VisitForStackValue(args->at(2)); | 3289 VisitForStackValue(args->at(2)); |
3311 __ CallStub(&stub); | 3290 __ CallStub(&stub); |
3312 context()->Plug(eax); | 3291 context()->Plug(eax); |
(...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4849 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4828 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
4850 Assembler::target_address_at(call_target_address, | 4829 Assembler::target_address_at(call_target_address, |
4851 unoptimized_code)); | 4830 unoptimized_code)); |
4852 return OSR_AFTER_STACK_CHECK; | 4831 return OSR_AFTER_STACK_CHECK; |
4853 } | 4832 } |
4854 | 4833 |
4855 | 4834 |
4856 } } // namespace v8::internal | 4835 } } // namespace v8::internal |
4857 | 4836 |
4858 #endif // V8_TARGET_ARCH_IA32 | 4837 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |