runtime/vm/benchmark_test.cc
// The specific api functions called here are a bit arbitrary.  We are
// trying to get a sense of the overhead for using the dart api.
The specific api functions called here are a bit arbitrary.  We are
trying to get a sense of the overhead for using the dart api.
The specific api functions called here are a bit arbitrary . We are trying to get a sense of the overhead for using the dart api .
static void UseDartApi(Dart_NativeArguments args) {
  int count = Dart_GetNativeArgumentCount(args);
  EXPECT_EQ(3, count);
  intptr_t receiver_value;
  Dart_Handle result = Dart_GetNativeReceiver(args, &receiver_value);
  EXPECT_VALID(result);
  EXPECT_EQ(7, receiver_value);
  Dart_Handle param1 = Dart_GetNativeArgument(args, 1);
  EXPECT_VALID(param1);
  EXPECT(Dart_IsInteger(param1));
  bool fits = false;
  result = Dart_IntegerFitsIntoInt64(param1, &fits);
  EXPECT_VALID(result);
  EXPECT(fits);
  int64_t value1;
  result = Dart_IntegerToInt64(param1, &value1);
  EXPECT_VALID(result);
  EXPECT_LE(0, value1);
  EXPECT_LE(value1, 1000000);
  Dart_SetReturnValue(args, Dart_NewInteger(value1 * receiver_value));
}
static void UseDartApi ( Dart_NativeArguments args ) { int count = Dart_GetNativeArgumentCount ( args ) ; EXPECT_EQ ( 3 , count ) ; intptr_t receiver_value ; Dart_Handle result = Dart_GetNativeReceiver ( args , & receiver_value ) ; EXPECT_VALID ( result ) ; EXPECT_EQ ( 7 , receiver_value ) ; Dart_Handle param1 = Dart_GetNativeArgument ( args , 1 ) ; EXPECT_VALID ( param1 ) ; EXPECT ( Dart_IsInteger ( param1 ) ) ; bool fits = false ; result = Dart_IntegerFitsIntoInt64 ( param1 , & fits ) ; EXPECT_VALID ( result ) ; EXPECT ( fits ) ; int64_t value1 ; result = Dart_IntegerToInt64 ( param1 , & value1 ) ; EXPECT_VALID ( result ) ; EXPECT_LE ( 0 , value1 ) ; EXPECT_LE ( value1 , 1000000 ) ; Dart_SetReturnValue ( args , Dart_NewInteger ( value1 * receiver_value ) ) ; }
The specific api functions called here are a bit arbitrary.
The specific api functions called here are a bit arbitrary .
// Get native field from receiver. // Get param1. // Return param + receiver.field.