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_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "code-stubs.h" | 9 #include "code-stubs.h" |
10 #include "codegen.h" | 10 #include "codegen.h" |
(...skipping 3311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3322 __ bind(&null); | 3322 __ bind(&null); |
3323 __ LoadRoot(r0, Heap::kNullValueRootIndex); | 3323 __ LoadRoot(r0, Heap::kNullValueRootIndex); |
3324 | 3324 |
3325 // All done. | 3325 // All done. |
3326 __ bind(&done); | 3326 __ bind(&done); |
3327 | 3327 |
3328 context()->Plug(r0); | 3328 context()->Plug(r0); |
3329 } | 3329 } |
3330 | 3330 |
3331 | 3331 |
3332 void FullCodeGenerator::EmitLog(CallRuntime* expr) { | |
3333 // Conditionally generate a log call. | |
3334 // Args: | |
3335 // 0 (literal string): The type of logging (corresponds to the flags). | |
3336 // This is used to determine whether or not to generate the log call. | |
3337 // 1 (string): Format string. Access the string at argument index 2 | |
3338 // with '%2s' (see Logger::LogRuntime for all the formats). | |
3339 // 2 (array): Arguments to the format string. | |
3340 ZoneList<Expression*>* args = expr->arguments(); | |
3341 ASSERT_EQ(args->length(), 3); | |
3342 if (CodeGenerator::ShouldGenerateLog(isolate(), args->at(0))) { | |
3343 VisitForStackValue(args->at(1)); | |
3344 VisitForStackValue(args->at(2)); | |
3345 __ CallRuntime(Runtime::kHiddenLog, 2); | |
3346 } | |
3347 | |
3348 // Finally, we're expected to leave a value on the top of the stack. | |
3349 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); | |
3350 context()->Plug(r0); | |
3351 } | |
3352 | |
3353 | |
3354 void FullCodeGenerator::EmitSubString(CallRuntime* expr) { | 3332 void FullCodeGenerator::EmitSubString(CallRuntime* expr) { |
3355 // Load the arguments on the stack and call the stub. | 3333 // Load the arguments on the stack and call the stub. |
3356 SubStringStub stub(isolate()); | 3334 SubStringStub stub(isolate()); |
3357 ZoneList<Expression*>* args = expr->arguments(); | 3335 ZoneList<Expression*>* args = expr->arguments(); |
3358 ASSERT(args->length() == 3); | 3336 ASSERT(args->length() == 3); |
3359 VisitForStackValue(args->at(0)); | 3337 VisitForStackValue(args->at(0)); |
3360 VisitForStackValue(args->at(1)); | 3338 VisitForStackValue(args->at(1)); |
3361 VisitForStackValue(args->at(2)); | 3339 VisitForStackValue(args->at(2)); |
3362 __ CallStub(&stub); | 3340 __ CallStub(&stub); |
3363 context()->Plug(r0); | 3341 context()->Plug(r0); |
(...skipping 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4864 | 4842 |
4865 ASSERT(interrupt_address == | 4843 ASSERT(interrupt_address == |
4866 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4844 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4867 return OSR_AFTER_STACK_CHECK; | 4845 return OSR_AFTER_STACK_CHECK; |
4868 } | 4846 } |
4869 | 4847 |
4870 | 4848 |
4871 } } // namespace v8::internal | 4849 } } // namespace v8::internal |
4872 | 4850 |
4873 #endif // V8_TARGET_ARCH_ARM | 4851 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |