| 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 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 if (emit_debug_code()) { | 992 if (emit_debug_code()) { |
| 993 push(scratch); | 993 push(scratch); |
| 994 // Read the first word and compare to native_context_map. | 994 // Read the first word and compare to native_context_map. |
| 995 mov(scratch, FieldOperand(scratch, HeapObject::kMapOffset)); | 995 mov(scratch, FieldOperand(scratch, HeapObject::kMapOffset)); |
| 996 cmp(scratch, isolate()->factory()->native_context_map()); | 996 cmp(scratch, isolate()->factory()->native_context_map()); |
| 997 Check(equal, "JSGlobalObject::native_context should be a native context."); | 997 Check(equal, "JSGlobalObject::native_context should be a native context."); |
| 998 pop(scratch); | 998 pop(scratch); |
| 999 } | 999 } |
| 1000 | 1000 |
| 1001 // Check if both contexts are the same. | 1001 // Check if both contexts are the same. |
| 1002 cmp(scratch, FieldOperand(holder_reg, JSGlobalProxy::kContextOffset)); | 1002 cmp(scratch, FieldOperand(holder_reg, JSGlobalProxy::kNativeContextOffset)); |
| 1003 j(equal, &same_contexts); | 1003 j(equal, &same_contexts); |
| 1004 | 1004 |
| 1005 // Compare security tokens, save holder_reg on the stack so we can use it | 1005 // Compare security tokens, save holder_reg on the stack so we can use it |
| 1006 // as a temporary register. | 1006 // as a temporary register. |
| 1007 // | 1007 // |
| 1008 // TODO(119): avoid push(holder_reg)/pop(holder_reg) | 1008 // TODO(119): avoid push(holder_reg)/pop(holder_reg) |
| 1009 push(holder_reg); | 1009 push(holder_reg); |
| 1010 // Check that the security token in the calling global object is | 1010 // Check that the security token in the calling global object is |
| 1011 // compatible with the security token in the receiving global | 1011 // compatible with the security token in the receiving global |
| 1012 // object. | 1012 // object. |
| 1013 mov(holder_reg, FieldOperand(holder_reg, JSGlobalProxy::kContextOffset)); | 1013 mov(holder_reg, |
| 1014 FieldOperand(holder_reg, JSGlobalProxy::kNativeContextOffset)); |
| 1014 | 1015 |
| 1015 // Check the context is a native context. | 1016 // Check the context is a native context. |
| 1016 if (emit_debug_code()) { | 1017 if (emit_debug_code()) { |
| 1017 cmp(holder_reg, isolate()->factory()->null_value()); | 1018 cmp(holder_reg, isolate()->factory()->null_value()); |
| 1018 Check(not_equal, "JSGlobalProxy::context() should not be null."); | 1019 Check(not_equal, "JSGlobalProxy::context() should not be null."); |
| 1019 | 1020 |
| 1020 push(holder_reg); | 1021 push(holder_reg); |
| 1021 // Read the first word and compare to native_context_map(), | 1022 // Read the first word and compare to native_context_map(), |
| 1022 mov(holder_reg, FieldOperand(holder_reg, HeapObject::kMapOffset)); | 1023 mov(holder_reg, FieldOperand(holder_reg, HeapObject::kMapOffset)); |
| 1023 cmp(holder_reg, isolate()->factory()->native_context_map()); | 1024 cmp(holder_reg, isolate()->factory()->native_context_map()); |
| (...skipping 1899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2923 // Load the prototype from the map and loop if non-null. | 2924 // Load the prototype from the map and loop if non-null. |
| 2924 bind(&check_prototype); | 2925 bind(&check_prototype); |
| 2925 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); | 2926 mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); |
| 2926 cmp(ecx, isolate()->factory()->null_value()); | 2927 cmp(ecx, isolate()->factory()->null_value()); |
| 2927 j(not_equal, &next); | 2928 j(not_equal, &next); |
| 2928 } | 2929 } |
| 2929 | 2930 |
| 2930 } } // namespace v8::internal | 2931 } } // namespace v8::internal |
| 2931 | 2932 |
| 2932 #endif // V8_TARGET_ARCH_IA32 | 2933 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |