OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3332 // 0 (literal string): The type of logging (corresponds to the flags). | 3332 // 0 (literal string): The type of logging (corresponds to the flags). |
3333 // This is used to determine whether or not to generate the log call. | 3333 // This is used to determine whether or not to generate the log call. |
3334 // 1 (string): Format string. Access the string at argument index 2 | 3334 // 1 (string): Format string. Access the string at argument index 2 |
3335 // with '%2s' (see Logger::LogRuntime for all the formats). | 3335 // with '%2s' (see Logger::LogRuntime for all the formats). |
3336 // 2 (array): Arguments to the format string. | 3336 // 2 (array): Arguments to the format string. |
3337 ZoneList<Expression*>* args = expr->arguments(); | 3337 ZoneList<Expression*>* args = expr->arguments(); |
3338 ASSERT_EQ(args->length(), 3); | 3338 ASSERT_EQ(args->length(), 3); |
3339 if (CodeGenerator::ShouldGenerateLog(isolate(), args->at(0))) { | 3339 if (CodeGenerator::ShouldGenerateLog(isolate(), args->at(0))) { |
3340 VisitForStackValue(args->at(1)); | 3340 VisitForStackValue(args->at(1)); |
3341 VisitForStackValue(args->at(2)); | 3341 VisitForStackValue(args->at(2)); |
3342 __ CallRuntime(Runtime::kLog, 2); | 3342 __ CallRuntime(Runtime::kHiddenLog, 2); |
3343 } | 3343 } |
3344 // Finally, we're expected to leave a value on the top of the stack. | 3344 // Finally, we're expected to leave a value on the top of the stack. |
3345 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); | 3345 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); |
3346 context()->Plug(rax); | 3346 context()->Plug(rax); |
3347 } | 3347 } |
3348 | 3348 |
3349 | 3349 |
3350 void FullCodeGenerator::EmitSubString(CallRuntime* expr) { | 3350 void FullCodeGenerator::EmitSubString(CallRuntime* expr) { |
3351 // Load the arguments on the stack and call the stub. | 3351 // Load the arguments on the stack and call the stub. |
3352 SubStringStub stub; | 3352 SubStringStub stub; |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3807 __ movp(rax, FieldOperand(cache, | 3807 __ movp(rax, FieldOperand(cache, |
3808 index.reg, | 3808 index.reg, |
3809 index.scale, | 3809 index.scale, |
3810 FixedArray::kHeaderSize + kPointerSize)); | 3810 FixedArray::kHeaderSize + kPointerSize)); |
3811 __ jmp(&done, Label::kNear); | 3811 __ jmp(&done, Label::kNear); |
3812 | 3812 |
3813 __ bind(¬_found); | 3813 __ bind(¬_found); |
3814 // Call runtime to perform the lookup. | 3814 // Call runtime to perform the lookup. |
3815 __ Push(cache); | 3815 __ Push(cache); |
3816 __ Push(key); | 3816 __ Push(key); |
3817 __ CallRuntime(Runtime::kGetFromCache, 2); | 3817 __ CallRuntime(Runtime::kHiddenGetFromCache, 2); |
3818 | 3818 |
3819 __ bind(&done); | 3819 __ bind(&done); |
3820 context()->Plug(rax); | 3820 context()->Plug(rax); |
3821 } | 3821 } |
3822 | 3822 |
3823 | 3823 |
3824 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { | 3824 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { |
3825 ZoneList<Expression*>* args = expr->arguments(); | 3825 ZoneList<Expression*>* args = expr->arguments(); |
3826 ASSERT(args->length() == 1); | 3826 ASSERT(args->length() == 1); |
3827 | 3827 |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4138 | 4138 |
4139 __ bind(&return_result); | 4139 __ bind(&return_result); |
4140 // Drop temp values from the stack, and restore context register. | 4140 // Drop temp values from the stack, and restore context register. |
4141 __ addp(rsp, Immediate(3 * kPointerSize)); | 4141 __ addp(rsp, Immediate(3 * kPointerSize)); |
4142 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 4142 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
4143 context()->Plug(rax); | 4143 context()->Plug(rax); |
4144 } | 4144 } |
4145 | 4145 |
4146 | 4146 |
4147 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { | 4147 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
4148 Handle<String> name = expr->name(); | 4148 if (expr->function() != NULL && |
4149 if (name->length() > 0 && name->Get(0) == '_') { | 4149 expr->function()->intrinsic_type == Runtime::INLINE ) { |
4150 Comment cmnt(masm_, "[ InlineRuntimeCall"); | 4150 Comment cmnt(masm_, "[ InlineRuntimeCall"); |
4151 EmitInlineRuntimeCall(expr); | 4151 EmitInlineRuntimeCall(expr); |
4152 return; | 4152 return; |
4153 } | 4153 } |
4154 | 4154 |
4155 Comment cmnt(masm_, "[ CallRuntime"); | 4155 Comment cmnt(masm_, "[ CallRuntime"); |
4156 ZoneList<Expression*>* args = expr->arguments(); | 4156 ZoneList<Expression*>* args = expr->arguments(); |
4157 int arg_count = args->length(); | 4157 int arg_count = args->length(); |
4158 | 4158 |
4159 if (expr->is_jsruntime()) { | 4159 if (expr->is_jsruntime()) { |
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4932 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4932 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
4933 Assembler::target_address_at(call_target_address, | 4933 Assembler::target_address_at(call_target_address, |
4934 unoptimized_code)); | 4934 unoptimized_code)); |
4935 return OSR_AFTER_STACK_CHECK; | 4935 return OSR_AFTER_STACK_CHECK; |
4936 } | 4936 } |
4937 | 4937 |
4938 | 4938 |
4939 } } // namespace v8::internal | 4939 } } // namespace v8::internal |
4940 | 4940 |
4941 #endif // V8_TARGET_ARCH_X64 | 4941 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |