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 3340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3351 // 0 (literal string): The type of logging (corresponds to the flags). | 3351 // 0 (literal string): The type of logging (corresponds to the flags). |
3352 // This is used to determine whether or not to generate the log call. | 3352 // This is used to determine whether or not to generate the log call. |
3353 // 1 (string): Format string. Access the string at argument index 2 | 3353 // 1 (string): Format string. Access the string at argument index 2 |
3354 // with '%2s' (see Logger::LogRuntime for all the formats). | 3354 // with '%2s' (see Logger::LogRuntime for all the formats). |
3355 // 2 (array): Arguments to the format string. | 3355 // 2 (array): Arguments to the format string. |
3356 ZoneList<Expression*>* args = expr->arguments(); | 3356 ZoneList<Expression*>* args = expr->arguments(); |
3357 ASSERT_EQ(args->length(), 3); | 3357 ASSERT_EQ(args->length(), 3); |
3358 if (CodeGenerator::ShouldGenerateLog(isolate(), args->at(0))) { | 3358 if (CodeGenerator::ShouldGenerateLog(isolate(), args->at(0))) { |
3359 VisitForStackValue(args->at(1)); | 3359 VisitForStackValue(args->at(1)); |
3360 VisitForStackValue(args->at(2)); | 3360 VisitForStackValue(args->at(2)); |
3361 __ CallRuntime(Runtime::kLog, 2); | 3361 __ CallRuntime(Runtime::kHiddenLog, 2); |
3362 } | 3362 } |
3363 // Finally, we're expected to leave a value on the top of the stack. | 3363 // Finally, we're expected to leave a value on the top of the stack. |
3364 __ mov(eax, isolate()->factory()->undefined_value()); | 3364 __ mov(eax, isolate()->factory()->undefined_value()); |
3365 context()->Plug(eax); | 3365 context()->Plug(eax); |
3366 } | 3366 } |
3367 | 3367 |
3368 | 3368 |
3369 void FullCodeGenerator::EmitSubString(CallRuntime* expr) { | 3369 void FullCodeGenerator::EmitSubString(CallRuntime* expr) { |
3370 // Load the arguments on the stack and call the stub. | 3370 // Load the arguments on the stack and call the stub. |
3371 SubStringStub stub; | 3371 SubStringStub stub; |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3826 __ cmp(key, FixedArrayElementOperand(cache, tmp)); | 3826 __ cmp(key, FixedArrayElementOperand(cache, tmp)); |
3827 __ j(not_equal, ¬_found); | 3827 __ j(not_equal, ¬_found); |
3828 | 3828 |
3829 __ mov(eax, FixedArrayElementOperand(cache, tmp, 1)); | 3829 __ mov(eax, FixedArrayElementOperand(cache, tmp, 1)); |
3830 __ jmp(&done); | 3830 __ jmp(&done); |
3831 | 3831 |
3832 __ bind(¬_found); | 3832 __ bind(¬_found); |
3833 // Call runtime to perform the lookup. | 3833 // Call runtime to perform the lookup. |
3834 __ push(cache); | 3834 __ push(cache); |
3835 __ push(key); | 3835 __ push(key); |
3836 __ CallRuntime(Runtime::kGetFromCache, 2); | 3836 __ CallRuntime(Runtime::kHiddenGetFromCache, 2); |
3837 | 3837 |
3838 __ bind(&done); | 3838 __ bind(&done); |
3839 context()->Plug(eax); | 3839 context()->Plug(eax); |
3840 } | 3840 } |
3841 | 3841 |
3842 | 3842 |
3843 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { | 3843 void FullCodeGenerator::EmitHasCachedArrayIndex(CallRuntime* expr) { |
3844 ZoneList<Expression*>* args = expr->arguments(); | 3844 ZoneList<Expression*>* args = expr->arguments(); |
3845 ASSERT(args->length() == 1); | 3845 ASSERT(args->length() == 1); |
3846 | 3846 |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4136 __ mov(eax, result_operand); | 4136 __ mov(eax, result_operand); |
4137 // Drop temp values from the stack, and restore context register. | 4137 // Drop temp values from the stack, and restore context register. |
4138 __ add(esp, Immediate(3 * kPointerSize)); | 4138 __ add(esp, Immediate(3 * kPointerSize)); |
4139 | 4139 |
4140 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 4140 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
4141 context()->Plug(eax); | 4141 context()->Plug(eax); |
4142 } | 4142 } |
4143 | 4143 |
4144 | 4144 |
4145 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { | 4145 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
4146 Handle<String> name = expr->name(); | 4146 if (expr->function() != NULL && |
4147 if (name->length() > 0 && name->Get(0) == '_') { | 4147 expr->function()->intrinsic_type == Runtime::INLINE ) { |
Yang
2014/03/25 13:19:59
stray white space after Runtime::INLINE.
| |
4148 Comment cmnt(masm_, "[ InlineRuntimeCall"); | 4148 Comment cmnt(masm_, "[ InlineRuntimeCall"); |
4149 EmitInlineRuntimeCall(expr); | 4149 EmitInlineRuntimeCall(expr); |
4150 return; | 4150 return; |
4151 } | 4151 } |
4152 | 4152 |
4153 Comment cmnt(masm_, "[ CallRuntime"); | 4153 Comment cmnt(masm_, "[ CallRuntime"); |
4154 ZoneList<Expression*>* args = expr->arguments(); | 4154 ZoneList<Expression*>* args = expr->arguments(); |
4155 | 4155 |
4156 if (expr->is_jsruntime()) { | 4156 if (expr->is_jsruntime()) { |
4157 // Push the builtins object as receiver. | 4157 // Push the builtins object as receiver. |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4934 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4934 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
4935 Assembler::target_address_at(call_target_address, | 4935 Assembler::target_address_at(call_target_address, |
4936 unoptimized_code)); | 4936 unoptimized_code)); |
4937 return OSR_AFTER_STACK_CHECK; | 4937 return OSR_AFTER_STACK_CHECK; |
4938 } | 4938 } |
4939 | 4939 |
4940 | 4940 |
4941 } } // namespace v8::internal | 4941 } } // namespace v8::internal |
4942 | 4942 |
4943 #endif // V8_TARGET_ARCH_IA32 | 4943 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |