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

Unified Diff: runtime/vm/intrinsifier_ia32.cc

Issue 883263004: Allows turning on checked mode on a per-isolate basis (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/intrinsifier_ia32.cc
===================================================================
--- runtime/vm/intrinsifier_ia32.cc (revision 43426)
+++ runtime/vm/intrinsifier_ia32.cc (working copy)
@@ -33,6 +33,11 @@
intptr_t Intrinsifier::ParameterSlotFromSp() { return 0; }
+static bool TypeChecksEnabled() {
+ return FLAG_enable_type_checks || Isolate::Current()->checked_mode();
+}
+
+
static intptr_t ComputeObjectArrayTypeArgumentsOffset() {
const Library& core_lib = Library::Handle(Library::CoreLibrary());
const Class& cls = Class::Handle(
@@ -49,7 +54,7 @@
// update. Array length is always a Smi.
void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) {
Label fall_through;
- if (FLAG_enable_type_checks) {
+ if (TypeChecksEnabled()) {
const intptr_t type_args_field_offset =
ComputeObjectArrayTypeArgumentsOffset();
// Inline simple tests (Smi, null), fallthrough if not positive.
@@ -150,7 +155,7 @@
// On stack: growable array (+2), value (+1), return-address (+0).
void Intrinsifier::GrowableArray_add(Assembler* assembler) {
// In checked mode we need to type-check the incoming argument.
- if (FLAG_enable_type_checks) return;
+ if (TypeChecksEnabled()) return;
Label fall_through;
__ movl(EAX, Address(ESP, + 2 * kWordSize)); // Array.

Powered by Google App Engine
This is Rietveld 408576698