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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 | 1044 |
1045 // Convert the object to a JS object. | 1045 // Convert the object to a JS object. |
1046 Label convert, done_convert; | 1046 Label convert, done_convert; |
1047 __ JumpIfSmi(eax, &convert, Label::kNear); | 1047 __ JumpIfSmi(eax, &convert, Label::kNear); |
1048 __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ecx); | 1048 __ CmpObjectType(eax, FIRST_SPEC_OBJECT_TYPE, ecx); |
1049 __ j(above_equal, &done_convert, Label::kNear); | 1049 __ j(above_equal, &done_convert, Label::kNear); |
1050 __ bind(&convert); | 1050 __ bind(&convert); |
1051 __ push(eax); | 1051 __ push(eax); |
1052 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); | 1052 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); |
1053 __ bind(&done_convert); | 1053 __ bind(&done_convert); |
| 1054 PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); |
1054 __ push(eax); | 1055 __ push(eax); |
1055 | 1056 |
1056 // Check for proxies. | 1057 // Check for proxies. |
1057 Label call_runtime, use_cache, fixed_array; | 1058 Label call_runtime, use_cache, fixed_array; |
1058 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); | 1059 STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE); |
1059 __ CmpObjectType(eax, LAST_JS_PROXY_TYPE, ecx); | 1060 __ CmpObjectType(eax, LAST_JS_PROXY_TYPE, ecx); |
1060 __ j(below_equal, &call_runtime); | 1061 __ j(below_equal, &call_runtime); |
1061 | 1062 |
1062 // Check cache validity in generated code. This is a fast case for | 1063 // Check cache validity in generated code. This is a fast case for |
1063 // the JSObject::IsSimpleEnum cache validity checks. If we cannot | 1064 // the JSObject::IsSimpleEnum cache validity checks. If we cannot |
1064 // guarantee cache validity, call the runtime system to check cache | 1065 // guarantee cache validity, call the runtime system to check cache |
1065 // validity or get the property names in a fixed array. | 1066 // validity or get the property names in a fixed array. |
1066 __ CheckEnumCache(&call_runtime); | 1067 __ CheckEnumCache(&call_runtime); |
1067 | 1068 |
1068 __ mov(eax, FieldOperand(eax, HeapObject::kMapOffset)); | 1069 __ mov(eax, FieldOperand(eax, HeapObject::kMapOffset)); |
1069 __ jmp(&use_cache, Label::kNear); | 1070 __ jmp(&use_cache, Label::kNear); |
1070 | 1071 |
1071 // Get the set of properties to enumerate. | 1072 // Get the set of properties to enumerate. |
1072 __ bind(&call_runtime); | 1073 __ bind(&call_runtime); |
1073 __ push(eax); | 1074 __ push(eax); |
1074 __ CallRuntime(Runtime::kGetPropertyNamesFast, 1); | 1075 __ CallRuntime(Runtime::kGetPropertyNamesFast, 1); |
| 1076 PrepareForBailoutForId(stmt->EnumId(), TOS_REG); |
1075 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), | 1077 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), |
1076 isolate()->factory()->meta_map()); | 1078 isolate()->factory()->meta_map()); |
1077 __ j(not_equal, &fixed_array); | 1079 __ j(not_equal, &fixed_array); |
1078 | 1080 |
1079 | 1081 |
1080 // We got a map in register eax. Get the enumeration cache from it. | 1082 // We got a map in register eax. Get the enumeration cache from it. |
1081 Label no_descriptors; | 1083 Label no_descriptors; |
1082 __ bind(&use_cache); | 1084 __ bind(&use_cache); |
1083 | 1085 |
1084 __ EnumLength(edx, eax); | 1086 __ EnumLength(edx, eax); |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1611 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); | 1613 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); |
1612 } else { | 1614 } else { |
1613 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 1615 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
1614 __ mov(eax, FieldOperand(edi, JSFunction::kLiteralsOffset)); | 1616 __ mov(eax, FieldOperand(edi, JSFunction::kLiteralsOffset)); |
1615 __ mov(ebx, Immediate(Smi::FromInt(expr->literal_index()))); | 1617 __ mov(ebx, Immediate(Smi::FromInt(expr->literal_index()))); |
1616 __ mov(ecx, Immediate(constant_properties)); | 1618 __ mov(ecx, Immediate(constant_properties)); |
1617 __ mov(edx, Immediate(Smi::FromInt(flags))); | 1619 __ mov(edx, Immediate(Smi::FromInt(flags))); |
1618 FastCloneShallowObjectStub stub(isolate(), properties_count); | 1620 FastCloneShallowObjectStub stub(isolate(), properties_count); |
1619 __ CallStub(&stub); | 1621 __ CallStub(&stub); |
1620 } | 1622 } |
| 1623 PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG); |
1621 | 1624 |
1622 // If result_saved is true the result is on top of the stack. If | 1625 // If result_saved is true the result is on top of the stack. If |
1623 // result_saved is false the result is in eax. | 1626 // result_saved is false the result is in eax. |
1624 bool result_saved = false; | 1627 bool result_saved = false; |
1625 | 1628 |
1626 // Mark all computed expressions that are bound to a key that | 1629 // Mark all computed expressions that are bound to a key that |
1627 // is shadowed by a later occurrence of the same key. For the | 1630 // is shadowed by a later occurrence of the same key. For the |
1628 // marked expressions, no store code is emitted. | 1631 // marked expressions, no store code is emitted. |
1629 expr->CalculateEmitStore(zone()); | 1632 expr->CalculateEmitStore(zone()); |
1630 | 1633 |
(...skipping 3501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5132 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 5135 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
5133 Assembler::target_address_at(call_target_address, | 5136 Assembler::target_address_at(call_target_address, |
5134 unoptimized_code)); | 5137 unoptimized_code)); |
5135 return OSR_AFTER_STACK_CHECK; | 5138 return OSR_AFTER_STACK_CHECK; |
5136 } | 5139 } |
5137 | 5140 |
5138 | 5141 |
5139 } } // namespace v8::internal | 5142 } } // namespace v8::internal |
5140 | 5143 |
5141 #endif // V8_TARGET_ARCH_X87 | 5144 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |