From d2bac7dd534aa4b2ffe75ef88f5804b703d88d11 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 3 Oct 2011 17:46:36 -0400 Subject: 5g, 6g, 8g: registerize variables again My previous CL: changeset: 9645:ce2e5f44b310 user: Russ Cox date: Tue Sep 06 10:24:21 2011 -0400 summary: gc: unify stack frame layout introduced a bug wherein no variables were being registerized, making Go programs 2-3x slower than they had been before. This CL fixes that bug (along with some others it was hiding) and adds a test that optimization makes at least one test case faster. R=ken2 CC=golang-dev http://codereview.appspot.com/5174045 --- test/fixedbugs/bug369.dir/pkg.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/fixedbugs/bug369.dir/pkg.go (limited to 'test/fixedbugs/bug369.dir') diff --git a/test/fixedbugs/bug369.dir/pkg.go b/test/fixedbugs/bug369.dir/pkg.go new file mode 100644 index 000000000..cf5704192 --- /dev/null +++ b/test/fixedbugs/bug369.dir/pkg.go @@ -0,0 +1,15 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package pkg + +func NonASCII(b []byte, i int) int { + for i = 0; i < len(b); i++ { + if b[i] >= 0x80 { + break + } + } + return i +} + -- cgit v1.2.1