Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/code_generator.h" | 8 #include "vm/code_generator.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 854 GenerateCall(node_sequence->token_index(), &label, PcDescriptors::kOther); | 854 GenerateCall(node_sequence->token_index(), &label, PcDescriptors::kOther); |
| 855 | 855 |
| 856 // If this node_sequence is the body of the function being compiled, and if | 856 // If this node_sequence is the body of the function being compiled, and if |
| 857 // this function is not a closure, do not link the current context as the | 857 // this function is not a closure, do not link the current context as the |
| 858 // parent of the newly allocated context, as it is not accessible. Instead, | 858 // parent of the newly allocated context, as it is not accessible. Instead, |
| 859 // save it in a pre-allocated variable and restore it on exit. | 859 // save it in a pre-allocated variable and restore it on exit. |
| 860 if ((node_sequence == parsed_function_.node_sequence()) && | 860 if ((node_sequence == parsed_function_.node_sequence()) && |
| 861 (parsed_function_.saved_context_var() != NULL)) { | 861 (parsed_function_.saved_context_var() != NULL)) { |
| 862 GenerateStoreVariable( | 862 GenerateStoreVariable( |
| 863 *parsed_function_.saved_context_var(), CTX, kNoRegister); | 863 *parsed_function_.saved_context_var(), CTX, kNoRegister); |
| 864 const Immediate raw_null = | 864 const Object& raw_null = Object::ZoneHandle(Object::null()); |
|
srdjan
2012/06/15 21:10:34
Object::ZoneHandle() is enough to get null handle.
| |
| 865 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 865 __ StoreIntoObjectNoBarrier(EAX, |
| 866 __ movl(CTX, raw_null); | 866 FieldAddress(EAX, Context::parent_offset()), |
| 867 raw_null); | |
| 868 } else { | |
| 869 // Chain the new context in EAX to its parent in CTX. | |
| 870 __ StoreIntoObject(EAX, FieldAddress(EAX, Context::parent_offset()), CTX); | |
| 867 } | 871 } |
| 868 | 872 |
| 869 // Chain the new context in EAX to its parent in CTX. | |
| 870 __ StoreIntoObject(EAX, FieldAddress(EAX, Context::parent_offset()), CTX); | |
| 871 // Set new context as current context. | 873 // Set new context as current context. |
| 872 __ movl(CTX, EAX); | 874 __ movl(CTX, EAX); |
| 873 set_context_level(scope->context_level()); | 875 set_context_level(scope->context_level()); |
| 874 | 876 |
| 875 // If this node_sequence is the body of the function being compiled, copy | 877 // If this node_sequence is the body of the function being compiled, copy |
| 876 // the captured parameters from the frame into the context. | 878 // the captured parameters from the frame into the context. |
| 877 if (node_sequence == parsed_function_.node_sequence()) { | 879 if (node_sequence == parsed_function_.node_sequence()) { |
| 878 ASSERT(scope->context_level() == 1); | 880 ASSERT(scope->context_level() == 1); |
| 879 const Immediate raw_null = | 881 const Immediate raw_null = |
| 880 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 882 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
| (...skipping 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2943 const Error& error = Error::Handle( | 2945 const Error& error = Error::Handle( |
| 2944 Parser::FormatError(script, token_index, "Error", format, args)); | 2946 Parser::FormatError(script, token_index, "Error", format, args)); |
| 2945 va_end(args); | 2947 va_end(args); |
| 2946 Isolate::Current()->long_jump_base()->Jump(1, error); | 2948 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2947 UNREACHABLE(); | 2949 UNREACHABLE(); |
| 2948 } | 2950 } |
| 2949 | 2951 |
| 2950 } // namespace dart | 2952 } // namespace dart |
| 2951 | 2953 |
| 2952 #endif // defined TARGET_ARCH_IA32 | 2954 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |