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/parser.h" | 5 #include "vm/parser.h" |
| 6 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
| 9 #include "vm/bootstrap.h" | 9 #include "vm/bootstrap.h" |
| 10 #include "vm/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 5329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5340 // Parse the function name out. | 5340 // Parse the function name out. |
| 5341 const intptr_t native_pos = TokenPos(); | 5341 const intptr_t native_pos = TokenPos(); |
| 5342 const String& native_name = ParseNativeDeclaration(); | 5342 const String& native_name = ParseNativeDeclaration(); |
| 5343 | 5343 |
| 5344 // Now resolve the native function to the corresponding native entrypoint. | 5344 // Now resolve the native function to the corresponding native entrypoint. |
| 5345 const int num_params = NativeArguments::ParameterCountForResolution(func); | 5345 const int num_params = NativeArguments::ParameterCountForResolution(func); |
| 5346 bool auto_setup_scope = true; | 5346 bool auto_setup_scope = true; |
| 5347 NativeFunction native_function = NativeEntry::ResolveNative( | 5347 NativeFunction native_function = NativeEntry::ResolveNative( |
| 5348 library, native_name, num_params, &auto_setup_scope); | 5348 library, native_name, num_params, &auto_setup_scope); |
| 5349 if (native_function == NULL) { | 5349 if (native_function == NULL) { |
| 5350 ErrorMsg(native_pos, "native function '%s' cannot be found", | 5350 ErrorMsg(native_pos, "native function '%s' (%d arguments) cannot be found", |
| 5351 native_name.ToCString()); | 5351 native_name.ToCString(), func.NumParameters()); |
|
Lasse Reichstein Nielsen
2014/02/11 07:10:13
I added this while debugging, but kept it because
| |
| 5352 } | 5352 } |
| 5353 func.SetIsNativeAutoSetupScope(auto_setup_scope); | 5353 func.SetIsNativeAutoSetupScope(auto_setup_scope); |
| 5354 | 5354 |
| 5355 // Now add the NativeBodyNode and return statement. | 5355 // Now add the NativeBodyNode and return statement. |
| 5356 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); | 5356 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); |
| 5357 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); | 5357 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); |
| 5358 current_block_->statements->Add( | 5358 current_block_->statements->Add( |
| 5359 new ReturnNode(TokenPos(), | 5359 new ReturnNode(TokenPos(), |
| 5360 new NativeBodyNode(TokenPos(), | 5360 new NativeBodyNode(TokenPos(), |
| 5361 Function::ZoneHandle(func.raw()), | 5361 Function::ZoneHandle(func.raw()), |
| (...skipping 5413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10775 void Parser::SkipQualIdent() { | 10775 void Parser::SkipQualIdent() { |
| 10776 ASSERT(IsIdentifier()); | 10776 ASSERT(IsIdentifier()); |
| 10777 ConsumeToken(); | 10777 ConsumeToken(); |
| 10778 if (CurrentToken() == Token::kPERIOD) { | 10778 if (CurrentToken() == Token::kPERIOD) { |
| 10779 ConsumeToken(); // Consume the kPERIOD token. | 10779 ConsumeToken(); // Consume the kPERIOD token. |
| 10780 ExpectIdentifier("identifier expected after '.'"); | 10780 ExpectIdentifier("identifier expected after '.'"); |
| 10781 } | 10781 } |
| 10782 } | 10782 } |
| 10783 | 10783 |
| 10784 } // namespace dart | 10784 } // namespace dart |
| OLD | NEW |