Skip to content

Commit

Permalink
Remove functions white-listed for use of try-finally and switch, add …
Browse files Browse the repository at this point in the history
…JS_SET_CURRENT_ISOLATE.

R=asgerf@google.com

Review URL: https://codereview.chromium.org//1237573002 .
  • Loading branch information
karlklose committed Jul 14, 2015
1 parent 868d2c6 commit 04dacd2
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 828 deletions.
12 changes: 11 additions & 1 deletion pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3207,7 +3207,7 @@ class JsIrBuilderVisitor extends IrBuilderVisitor {
}
return irBuilder.buildForeignCode(
js.js.expressionTemplateYielding(
backend.emitter.staticFunctionAccess(function)),
backend.emitter.staticFunctionAccess(closure)),
<ir.Primitive>[],
NativeBehavior.PURE,
dependency: closure);
Expand Down Expand Up @@ -3309,6 +3309,16 @@ class JsIrBuilderVisitor extends IrBuilderVisitor {
const <ir.Primitive>[],
NativeBehavior.PURE);

case 'JS_SET_STATIC_STATE':
validateArgumentCount(exactly: 1);

ir.Primitive value = visit(argumentNodes.single);
String isolateName = backend.namer.staticStateHolder;
return irBuilder.buildForeignCode(
js.js.parseForeignJS("$isolateName = #"),
<ir.Primitive>[value],
NativeBehavior.PURE);

case 'JS_CALL_IN_ISOLATE':
validateArgumentCount(exactly: 2);

Expand Down
14 changes: 1 addition & 13 deletions pkg/compiler/lib/src/js_backend/codegen/task.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,7 @@ class CpsFunctionCompiler implements FunctionCompiler {
// switch.
if (element.isNative ||
element.isPatched ||
libraryName == 'origin library(dart:typed_data)' ||
// Using switch or try-finally.
library.isInternalLibrary && name == 'unwrapException' ||
library.isPlatformLibrary && className == 'IterableBase' ||
library.isInternalLibrary && className == 'Closure' ||
libraryName == 'origin library(dart:collection)' &&
name == 'mapToString' ||
libraryName == 'library(dart:html)' && name == 'sanitizeNode' ||
className == '_IsolateContext' ||
className == 'IsolateNatives' ||
className == '_Deserializer' ||
name == '_rootRun' ||
name == '_microtaskLoopEntry') {
libraryName == 'origin library(dart:typed_data)') {
compiler.log('Using SSA compiler for platform element $element');
return fallbackCompiler.compile(work);
}
Expand Down
7 changes: 2 additions & 5 deletions pkg/pkg.status
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ analyzer/test/generated/compile_time_error_code_test: Crash # The null object do
analyzer/test/generated/element_test: Crash # The null object does not have a getter '_element'.
analyzer/test/generated/incremental_resolver_test: Crash # The null object does not have a getter '_element'.
analyzer/test/generated/incremental_scanner_test: Crash # The null object does not have a getter '_element'.
analyzer/test/generated/java_core_test: RuntimeError # receiver._addHashTableEntry$2 is not a function
analyzer/test/generated/non_error_resolver_test: Crash # The null object does not have a getter '_element'.
analyzer/test/generated/parser_test: Crash # The null object does not have a getter '_element'.
analyzer/test/generated/resolver_test: Crash # The null object does not have a getter '_element'.
Expand All @@ -176,6 +175,7 @@ analyzer/test/instrumentation/instrumentation_test: Crash # The null object does
analyzer/test/parse_compilation_unit_test: Crash # The null object does not have a getter '_element'.
analyzer/test/source/package_map_provider_test: Crash # The null object does not have a getter '_element'.
analyzer/test/source/package_map_resolver_test: Crash # The null object does not have a getter '_element'.
analyzer/test/source/sdk_ext_test: Crash # The null object does not have a getter '_element'.
analyzer/test/src/context/cache_test: Crash # The null object does not have a getter '_element'.
analyzer/test/src/context/context_test: Crash # The null object does not have a getter '_element'.
analyzer/test/src/task/dart_test: Crash # The null object does not have a getter '_element'.
Expand All @@ -190,7 +190,4 @@ analyzer/test/src/task/manager_test: Crash # The null object does not have a get
analyzer/test/src/task/model_test: Crash # The null object does not have a getter '_element'.
analyzer/test/src/util/asserts_test: Crash # The null object does not have a getter '_element'.
analyzer/test/src/util/lru_map_test: Crash # The null object does not have a getter '_element'.
fixnum/test/int_32_test: RuntimeError # receiver._addHashTableEntry$2 is not a function
fixnum/test/int_64_test: RuntimeError # receiver._addHashTableEntry$2 is not a function
typed_data/test/typed_buffers_test/none: RuntimeError # receiver._addHashTableEntry$2 is not a function
typed_mock/test/typed_mock_test: RuntimeError # receiver._addHashTableEntry$2 is not a function
typed_data/test/typed_buffers_test/none: RuntimeError # Please triage this failure.
Loading

0 comments on commit 04dacd2

Please sign in to comment.