Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: pkg/analyzer/lib/src/summary/idl.dart

Issue 2779993002: Store literal values and invocations arguments only for constants and untyped literals. (Closed)
Patch Set: Update IDL documentation. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 /** 5 /**
6 * This file is an "idl" style description of the summary format. It 6 * This file is an "idl" style description of the summary format. It
7 * contains abstract classes which declare the interface for reading data from 7 * contains abstract classes which declare the interface for reading data from
8 * summaries. It is parsed and transformed into code that implements the 8 * summaries. It is parsed and transformed into code that implements the
9 * summary format. 9 * summary format.
10 * 10 *
(...skipping 2179 matching lines...) Expand 10 before | Expand all | Expand 10 after
2190 * Pop the top `n` values from the stack (where `n` is obtained from 2190 * Pop the top `n` values from the stack (where `n` is obtained from
2191 * [UnlinkedExpr.ints]) into a list (filled from the end) and take the next 2191 * [UnlinkedExpr.ints]) into a list (filled from the end) and take the next
2192 * `n` values from [UnlinkedExpr.strings] and use the lists of names and 2192 * `n` values from [UnlinkedExpr.strings] and use the lists of names and
2193 * values to create named arguments. Then pop the top `m` values from the 2193 * values to create named arguments. Then pop the top `m` values from the
2194 * stack (where `m` is obtained from [UnlinkedExpr.ints]) into a list (filled 2194 * stack (where `m` is obtained from [UnlinkedExpr.ints]) into a list (filled
2195 * from the end) and use them as positional arguments. Use the lists of 2195 * from the end) and use them as positional arguments. Use the lists of
2196 * positional and names arguments to invoke a constant constructor obtained 2196 * positional and names arguments to invoke a constant constructor obtained
2197 * from [UnlinkedExpr.references], and push the resulting value back onto the 2197 * from [UnlinkedExpr.references], and push the resulting value back onto the
2198 * stack. 2198 * stack.
2199 * 2199 *
2200 * Arguments are skipped, and `0` are specified as the numbers of arguments
2201 * on the stack, if the expression is not a constant. We store expression of
2202 * variable initializers to perform top-level inference, and arguments are
2203 * never used to infer types.
2204 *
2200 * Note that for an invocation of the form `const a.b(...)` (where no type 2205 * Note that for an invocation of the form `const a.b(...)` (where no type
2201 * arguments are specified), it is impossible to tell from the unresolved AST 2206 * arguments are specified), it is impossible to tell from the unresolved AST
2202 * alone whether `a` is a class name and `b` is a constructor name, or `a` is 2207 * alone whether `a` is a class name and `b` is a constructor name, or `a` is
2203 * a prefix name and `b` is a class name. For consistency between AST based 2208 * a prefix name and `b` is a class name. For consistency between AST based
2204 * and elements based summaries, references to default constructors are always 2209 * and elements based summaries, references to default constructors are always
2205 * recorded as references to corresponding classes. 2210 * recorded as references to corresponding classes.
2206 */ 2211 */
2207 invokeConstructor, 2212 invokeConstructor,
2208 2213
2209 /** 2214 /**
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
2433 * values to create named arguments. Then pop the top `m` values from the 2438 * values to create named arguments. Then pop the top `m` values from the
2434 * stack (where `m` is obtained from [UnlinkedExpr.ints]) into a list (filled 2439 * stack (where `m` is obtained from [UnlinkedExpr.ints]) into a list (filled
2435 * from the end) and use them as positional arguments. Use the lists of 2440 * from the end) and use them as positional arguments. Use the lists of
2436 * positional and names arguments to invoke a method (or a function) with 2441 * positional and names arguments to invoke a method (or a function) with
2437 * the reference from [UnlinkedExpr.references]. If `k` is nonzero (where 2442 * the reference from [UnlinkedExpr.references]. If `k` is nonzero (where
2438 * `k` is obtained from [UnlinkedExpr.ints]), obtain `k` type arguments from 2443 * `k` is obtained from [UnlinkedExpr.ints]), obtain `k` type arguments from
2439 * [UnlinkedExpr.references] and use them as generic type arguments for the 2444 * [UnlinkedExpr.references] and use them as generic type arguments for the
2440 * aforementioned method or function. Push the result of the invocation onto 2445 * aforementioned method or function. Push the result of the invocation onto
2441 * the stack. 2446 * the stack.
2442 * 2447 *
2448 * Arguments are skipped, and `0` are specified as the numbers of arguments
2449 * on the stack, if the expression is not a constant. We store expression of
2450 * variable initializers to perform top-level inference, and arguments are
2451 * never used to infer types.
2452 *
2443 * In general `a.b` cannot not be distinguished between: `a` is a prefix and 2453 * In general `a.b` cannot not be distinguished between: `a` is a prefix and
2444 * `b` is a top-level function; or `a` is an object and `b` is the name of a 2454 * `b` is a top-level function; or `a` is an object and `b` is the name of a
2445 * method. This operation should be used for a sequence of identifiers 2455 * method. This operation should be used for a sequence of identifiers
2446 * `a.b.b.c.d.e` ending with an invokable result. 2456 * `a.b.b.c.d.e` ending with an invokable result.
2447 */ 2457 */
2448 invokeMethodRef, 2458 invokeMethodRef,
2449 2459
2450 /** 2460 /**
2451 * Pop the top `n` values from the stack (where `n` is obtained from 2461 * Pop the top `n` values from the stack (where `n` is obtained from
2452 * [UnlinkedExpr.ints]) into a list (filled from the end) and take the next 2462 * [UnlinkedExpr.ints]) into a list (filled from the end) and take the next
2453 * `n` values from [UnlinkedExpr.strings] and use the lists of names and 2463 * `n` values from [UnlinkedExpr.strings] and use the lists of names and
2454 * values to create named arguments. Then pop the top `m` values from the 2464 * values to create named arguments. Then pop the top `m` values from the
2455 * stack (where `m` is obtained from [UnlinkedExpr.ints]) into a list (filled 2465 * stack (where `m` is obtained from [UnlinkedExpr.ints]) into a list (filled
2456 * from the end) and use them as positional arguments. Use the lists of 2466 * from the end) and use them as positional arguments. Use the lists of
2457 * positional and names arguments to invoke the method with the name from 2467 * positional and names arguments to invoke the method with the name from
2458 * [UnlinkedExpr.strings] of the target popped from the stack. If `k` is 2468 * [UnlinkedExpr.strings] of the target popped from the stack. If `k` is
2459 * nonzero (where `k` is obtained from [UnlinkedExpr.ints]), obtain `k` type 2469 * nonzero (where `k` is obtained from [UnlinkedExpr.ints]), obtain `k` type
2460 * arguments from [UnlinkedExpr.references] and use them as generic type 2470 * arguments from [UnlinkedExpr.references] and use them as generic type
2461 * arguments for the aforementioned method. Push the result of the 2471 * arguments for the aforementioned method. Push the result of the
2462 * invocation onto the stack. 2472 * invocation onto the stack.
2463 * 2473 *
2474 * Arguments are skipped, and `0` are specified as the numbers of arguments
2475 * on the stack, if the expression is not a constant. We store expression of
2476 * variable initializers to perform top-level inference, and arguments are
2477 * never used to infer types.
2478 *
2464 * This operation should be used for invocation of a method invocation 2479 * This operation should be used for invocation of a method invocation
2465 * where `target` is known to be an object instance. 2480 * where `target` is known to be an object instance.
2466 */ 2481 */
2467 invokeMethod, 2482 invokeMethod,
2468 2483
2469 /** 2484 /**
2470 * Begin a new cascade section. Duplicate the top value of the stack. 2485 * Begin a new cascade section. Duplicate the top value of the stack.
2471 */ 2486 */
2472 cascadeSectionBegin, 2487 cascadeSectionBegin,
2473 2488
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
3325 @Id(11) 3340 @Id(11)
3326 int get visibleLength; 3341 int get visibleLength;
3327 3342
3328 /** 3343 /**
3329 * If a local variable, the beginning of the visible range; zero otherwise. 3344 * If a local variable, the beginning of the visible range; zero otherwise.
3330 */ 3345 */
3331 @informative 3346 @informative
3332 @Id(12) 3347 @Id(12)
3333 int get visibleOffset; 3348 int get visibleOffset;
3334 } 3349 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698